Fluid Flow Solvers
For convenience, we provide a simple implementation of fluid flow equations in
echemfem.FlowSolver
, which can be used to obtain a velocity field for
the echemfem.EchemSolver
.
Navier-Stokes Solver
The echemfem.NavierStokesFlowSolver
class contains an implementation
for the steady-state incompressible Navier-Stokes equations. Both
nondimensional and dimensional equations are available.
We are solving for velocity \(\mathbf u\) and pressure \(p\). The
dimensional version of the momentum equation is
\[-\nu \nabla^2 \mathbf u + \mathbf u \cdot \nabla \mathbf u + \frac{1}{\rho} \nabla p = 0,\]
where \(\nu\) is the kinematic viscosity and \(\rho\) is the density.
It is also common to use the dynamic viscosity \(\mu = \nu \rho\)
The nondimensional version is
\[- \frac{1}{\mathrm{Re}}\nabla^2 \mathbf u + \mathbf u \cdot \nabla \mathbf u + \nabla p = 0,\]
where all quantities have been nondimensionalized, and \(\mathrm{Re}=
\frac{\bar {\mathbf u} L}{\nu}\) is the Reynolds number, where \(L\) is the
characteristic length.
In both cases, we also have the incompressibility condition
\[\nabla \cdot \mathbf{u} = 0.\]
Physical parameters are passed as a
dict
in the fluid_params
argument.
Specifically, for the dimensional version, the user must pass the following keys:
To use the nondimensional version, the user must pass the following key:
Navier-Stokes-Brinkman Solver
The echemfem.NavierStokesBrinkmanFlowSolver
class contains an
implementation for the steady-state incompressible Navier-Stokes-Brinkman
equations. Both nondimensional and dimensional equations are available.
The dimensional version of the momentum equation is
\[-\nabla\cdot\left(\nu_\mathrm{eff} \nabla\mathbf u \right)+ \mathbf u \cdot \nabla \mathbf u + \frac{1}{\rho} \nabla p + \nu K^{-1} \mathbf u = 0,\]
where \(\nu_\mathrm{eff}\) is the effective viscosity in the porous medium,
and \(K\), its permeability. It is also common to use the effective dynamic
viscosity \(\mu_\mathrm{eff} = \nu_\mathrm{eff} \rho\).
The inverse permeability \(K^{-1}\) can be provided directly in cases where
it is zero in some regions, i.e. liquid-only regions. It is common to take
\(\nu_\mathrm{eff}=\nu\) for simplicity (the default here).
The nondimensional implementation currently assumes \(\nu_\mathrm{eff}=\nu\)
and \(K^{-1}>0\), such that
\[- \frac{1}{\mathrm{Re}}\nabla^2 \mathbf u + \mathbf u \cdot \nabla \mathbf u + \nabla p + \frac{1}{\mathrm{Re}\mathrm{Da}} \mathbf u = 0,\]
where all quantities have been nondimensionalized and
\(\mathrm{Da}=\frac{K}{L^2}\) is the Darcy number.
In addition to the parameters provided for Navier-Stokes, the physical
parameters below must be provided.
For the dimensional version, the user must also pass the following keys:
"permeability"
or "inverse permeability"
: \(K\) and \(K^{-1}\), respectively
Optional: "effective kinematic viscosity"
or "effective dynamic viscosity"
: \(\nu_\mathrm{eff}\) and \(\mu_\mathrm{eff}\), respectively
To use the nondimensional version, the user must pass the following key:
Boundary conditions
A dict
containing boundary markers is passed when creating a
FlowSolver
object. Below are the different options for boundary_markers
keys.
"no slip"
: Sets velocity to zero, \(\mathbf u = 0\).
"inlet velocity"
: Sets inlet velocity, \(\mathbf u = \mathbf
u_\mathrm{in}\), which is passed in fluid_params
as "inlet velocity"
.
"outlet velocity"
: Sets outlet velocity, \(\mathbf u = \mathbf
u_\mathrm{out}\), which is passed in fluid_params
as "outlet
velocity"
.
"inlet pressure"
: Sets inlet velocity, \(p = p_\mathrm{in}\), which
is passed in fluid_params
as "inlet pressure"
.
"outlet pressure"
: Sets outlet pressure, \(p = p_\mathrm{out}\),
which is passed in fluid_params
as "outlet pressure"
.
Numerical considerations
The discretization is done using Taylor-Hood elements [TH73]
(piecewise linear pressure, piecewise quadratic velocity), which satisfy the
inf-sup condition [Babuvska71, Bre74, Lad63].
To achieve convergence other than at a low Reynolds number, it may be required
to do continuation on the parameter so that Newton’s method has better initial
guesses. This can be done for example, by passing the Reynolds number as a
firedrake.constant.Constant
, and assigning a larger value after each
solve.
The highest Reynolds number that can be provided is dictated by the validity of
the steady-sate assumption. Indeed, as the Reynolds number increases, steady
flow becomes unstable. The critical Reynolds number at which transient effects
occur is problem dependent, typically somewhere within
\(10^2<\mathrm{Re}<10^4\).
For the Darcy number, using a very small value (\(\mathrm{Da}\sim
10^{-6}\)) can be used to simulate a nearly impermeable wall, which is commonly
done in topology optimization. For smaller values, convergence issues can
arise. Reversly, as \(\mathrm{Da}\to\infty\), we simply recover
Navier-Stokes.
References
[Babuvska71]
Ivo Babuška. Error-bounds for finite element method. Numerische Mathematik, 16(4):322–333, 1971.
[Bre74]
Franco Brezzi. On the existence, uniqueness and approximation of saddle-point problems arising from Lagrangian multipliers. Publications des séminaires de mathématiques et informatique de Rennes, pages 1–26, 1974.
[Lad63]
O Ladyzhenskaya. The mathematical theory of incompressible viscous flows. 1963.
[TH73]
Cedric Taylor and Paul Hood. A numerical solution of the Navier-Stokes equations using the finite element technique. Computers & Fluids, 1(1):73–100, 1973.