Skip to main content

A Scipy-Fenics 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 dolfin_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.

Note: the branch lau-included already contains the module sadptprj_riclyap_adi

Documentation

Documentation of the code goes here.

Installation as Module

pip install dolfin_navier_scipy

Changelog

v1.1.3

  • catch the case that the datapoints do not extend to the full time range
  • enforce explicit specification of the FEM scheme in problem_setups.gen_bccont_fems

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

dolfin_navier_scipy-1.4.0.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dolfin_navier_scipy-1.4.0-py3-none-any.whl (60.9 kB view details)

Uploaded Python 3

File details

Details for the file dolfin_navier_scipy-1.4.0.tar.gz.

File metadata

  • Download URL: dolfin_navier_scipy-1.4.0.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for dolfin_navier_scipy-1.4.0.tar.gz
Algorithm Hash digest
SHA256 d41967de1babf8c54f2aee1ea0625fa405024cc8c39f3eacdedc6f17d84905de
MD5 157888a17fe3f075329b39d561fd5005
BLAKE2b-256 fe6ddfd79f85e4dc7c326d19ba9aa1ed830adca85c1d3cc7e512094035173970

See more details on using hashes here.

File details

Details for the file dolfin_navier_scipy-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dolfin_navier_scipy-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1bd1bb81edbdf03b923c97def482640aba16d85cc77a353c808034d356d66a2
MD5 6d03edaf13401fb4a180897bf95e97c7
BLAKE2b-256 4514001d26996a717df8d8784bf01b422795385107e16d4908d752eaf9ead023

See more details on using hashes here.

Supported by

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