-
Notifications
You must be signed in to change notification settings - Fork 48
Home
Oasis is an open source finite element Navier-Stokes solver written from scratch in Python using building blocks from FEniCS. The solver is unstructured, runs with MPI and interfaces, through FEniCS, to the state-of-the-art linear algebra backend PETSc. Oasis advocates a high-level, programmable Python user interface, where the user is placed in complete control of every aspect of the solver. A version of the solver, which is using piecewise linear elements for both velocity and pressure, has been shown to more or less exactly reproduce the classical spectral turbulent channel simulations of Moser, Kim and Mansour at Re_tau=180 [Phys. Fluids, vol 11(4), p. 964]. The computational speed is dominated by the iterative solvers provided by the linear algebra backend (PETSc). That is, there is very little overhead in the high-level finite element assembly of the variational forms. Higher order accuracy is also demonstrated and new solvers may be easily added within the same framework. In addition to solving for the velocity and pressure, the user may also add any number of passive or reactive scalars to the flow field.
There are currently two solvers implemented, one for steady-state and one for transient flows. The transient solver uses the fractional step algorithm for any finite element discretization of the actual Navier Stokes equations. The steady-state solver is coupled using a mixed space for velocity and pressure. The code that implements the basic form of the solvers are located in root files
Problems are solved by either running NSfracStep
or NSCoupled
directly, or by using the oasis executable. A problem keyword is required plus any other recognized parameters. For example, the Taylor Green problem (see problems/NSfracStep/TaylorGreen2D.py) is solved through the call
oasis NSfracStep problem=TaylorGreen2D
The coupled solver may be run for axisymmetric problems using cylinder coordinates. The flow through an axisymmetric nozzle may thus be solved through the call
oasis NSCoupled problem=Nozzle2D solver=cylindrical
Predefined problems are located in the problems
folder. Userdefined problems must be located in the same folder that one is running the executable oasis
from.
The complete 2D Taylor Green flow is presented here as well:
The implementation of Oasis is pythonic in nature and organized in a Python package using modules, and not classes. For each solver to run it needs to import exactly one mesh and one dictionary of parameters NS_parameters
. The mesh and the dictionary are created in separate modules, or python files. In these modules all problem specific information, like boundary and initial conditions, has to be provided.
The solvers are written such that the tailored problem module may interact with the solver at specific locations through several Hooks - or python methods. For example, there is one hook used to initialize the solver and one used to set boundary conditions. All possible hooks have a default version in the problems/NSfracStep/__init__.py and problems/NSCoupled/__init__.py modules.