Let solve the stokes equation considering a Poiseuille flow profile.
We have the following system of equations,
where denotes the flow speed,
the fluid pressure,
the fluid viscosity.
The last boundary condition expresses a null pressure fixed on the outlet.
The Poiseuille profile on the boundary is,
The method used to obtain the strong formulation is closed to the one used for the laplacian (see section Laplacian Examples ).
We multiply the first equation by a test function and we integrate on the domain
,
where $n$ denotes a normal vector on the boundary.
The divergence theorem (or Gauss's theorem) gives,
We have to add a consistency terms to the equation to guaranty the symmetry of the bilinear form.
This term is provided by the second equation. We multiply this equation by a test function and we integrate on the domain
,
Finally, we deduce from the equations and after rearranging the integrals the variationnal formulation,
We have an equation which can be rewritten as find such that for all
where is a bilinear form, continuous, coercive and where
is a linear form.
Let's see the Feel++ code corresponding to this mathematical statement (source "doc/manual/tutorial/mystokes.cpp"
).
We suppose for this example the viscosity and
.
The procedure to create the mesh is very simple.
You have to provide to the command line (or via the cfg file) the gmsh.filename option.
You can provide a .geo or a
.msh file (created via gmsh).
As for the laplacian problem, the code is very closed to the mathematical formulation.
We define the product of function spaces for the flow speed and the flow pressur using THch<order>()
(TH stands for Taylor-Hoods) function which is Pch<N+1>
Pch<N>
for respectively flow speed and pressure spaces.
We take an element in this space. Then we define the integrals of the variationnal formulation for the left and the right hand side. Finally, we apply the Poiseuille profile on the boundary.
We call the solver to resolve the problem (Solver).