Skip to main content

A Scipy-FenicsX interface for incompressible Navier-Stokes

Project description

dolfin_navier_scipy

DOI PyPI version Documentation Status

This python module dns provides an interface between the FEM toolbox FEniCS and SciPy in view of simulation and control of incompressible flows. Basically, FEniCS is used to discretize the incompressible Navier-Stokes equations in space. Then dns makes the discretized operators available in SciPy for use in model reduction, simulation, or control and optimization.

dns also contains a solver for the steady state and time dependent problems.

Quick Start

To get started, create the needed subdirectories and run one of the tests/time_dep_nse_.py files, e.g.

pip install sadptprj_riclyap_adi
cd tests
mkdir data
mkdir results
# export PYTHONPATH="$PYTHONPATH:path/to/repo/"  # add the repo to the path
# pip install dolfinx_navier_scipy                # or install the module using pip
python3 time_dep_nse_expnonl.py

Then, to examine the results, launch

paraview results/vel_TH__timestep.pvd

Test Cases and Examples

A selection:

  • tests/mini_setup.py: a minimal setup for a steady-state simulation
  • tests/steadystate_schaefer-turek_2D-1.py: the 2D steady-state cylinder wake benchmark by Schäfer/Turek
  • tests/steadystate_rotcyl.py: the 2D cylinder wake with a freely rotating cylinder as benchmarked in Richter et al.
  • tests/time_dep_nse_.py: time integration with Picard and Newton linearization
  • tests/time_dep_nse_expnonl.py: time integration with explicit treatment of the nonlinearity
  • tests/time_dep_nse_bcrob.py: time integration of the cylinder wake with boundary controls
  • tests/time_dep_nse_krylov.py: time integration with iterative solves of the state equations via krypy
  • tests/time_dep_nse_double_rotcyl_bcrob.py: rotating double cylinder via Robin boundary conditions

Dependencies

The latter is my home-brew module that includes the submodule lin_alg_utils with routines for solving the saddle point problem as it arises in the (v,p) formulation of the NSE.

Documentation

The (old) documentation of the code goes here.

Installation as Module

pip install dolfinx_navier_scipy

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dolfinx_navier_scipy-0.0.0.tar.gz (83.2 kB view details)

Uploaded Source

Built Distribution

dolfinx_navier_scipy-0.0.0-py3-none-any.whl (58.3 kB view details)

Uploaded Python 3

File details

Details for the file dolfinx_navier_scipy-0.0.0.tar.gz.

File metadata

  • Download URL: dolfinx_navier_scipy-0.0.0.tar.gz
  • Upload date:
  • Size: 83.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for dolfinx_navier_scipy-0.0.0.tar.gz
Algorithm Hash digest
SHA256 17a7c49140ca5b9a5951d122c4d6d064955f60654735252e18319008fec11b43
MD5 ae22217b819c917cb9c765d23ec05597
BLAKE2b-256 73b66a2757c3228c05f94ce27d07cdda3fe4e468588a03f63827f5a46040824f

See more details on using hashes here.

File details

Details for the file dolfinx_navier_scipy-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dolfinx_navier_scipy-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 716291bc61164a6d100d5f0d606ae55e72a9f290f64c4f5dec1a5151cb3a2e2e
MD5 de951a228819da2c4a26f662cb99daf3
BLAKE2b-256 f861196805075ac2bc65a0110e690f61bd2eda939cb5b41a3e0527f20a065687

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page