"Model": "NavierStokes"
The CFD Toolbox supports both the Stokes and the incompressible NavierStokes equations.
The fluid mechanics model (NavierStokes
or Stokes
) can be selected in json file:
"Model": "NavierStokes"
The next step is to define the fluid material by setting its properties namely the density \(\rho_f\) and viscosity \(\mu_f\). In next table, we find the correspondance between the mathematical names and the json names.
Parameter  Symbol 

\(\mu_f\) 

\(\rho_f\) 

A Materials
section is introduced in json file in order to configure the fluid properties. For each mesh marker, we can define the material properties associated.
"Materials":
{
"<marker>"
{
"name":"water",
"rho":"1.0e3",
"mu":"1.0"
}
}
The non Newtonian properties are defined in cfg file in fluid section.
The viscosity law is activated by:
option  values 

viscosity.law 
newtonian, power_law, walburnschneck_law, carreau_law, carreauyasuda_law 
Then, each model are configured with the options reported in the following table:
Viscosity law  options  unit 

power_law 
power_law.k power_law.n 
dimensionless dimensionless 
walburnschneck_law 
hematocrit TPMA walburnschneck_law.C1 walburnschneck_law.C2 walburnschneck_law.C3 walburnschneck_law.C4 
Percentage g/l dimensionless dimensionless dimensionless l/g 
carreau_law 
viscosity.zero_shear viscosity.infinite_shear carreau_law.lambda carreau_law.n 
\(kg.m^{1}.s^{1}\) dimensionless dimensionless 
carreauyasuda_law 
viscosity.zero_shear viscosity.infinite_shear carreauyasuda_law.lambda carreauyasuda_law.n carreauyasuda_law.a 
\(kg/(m \times s)\) \(kg/(m \times s)\) dimensionless dimensionless dimensionless 
We start by a listing of boundary conditions supported in fluid mechanics model.
A Dirichlet condition on velocity field reads:
\boldsymbol{u}_f = \boldsymbol{g} \quad \text{ on } \Gamma
or only a component of vector \(\boldsymbol{u}_f =(u_f^1,u_f^2 ,u_f^3 )\)
u_f^i = g \quad \text{ on } \Gamma
Several methods are available to enforce the boundary condition:
elimination
Nitsche
Lagrange multiplier
p & = g \\ \boldsymbol{u}_f \times {\boldsymbol{ n }} & = \boldsymbol{0}
Name  Expression 

Neumann_scalar 
\(\boldsymbol{\sigma}_{f} \boldsymbol{n} = g \ \boldsymbol{n} \) 
Neumann_vectorial 
\(\boldsymbol{\sigma}_{f} \boldsymbol{n} = \boldsymbol{g} \) 
Neumann_tensor2 
\(\boldsymbol{\sigma}_{f} \boldsymbol{n} = g \ \boldsymbol{n}\) 
\boldsymbol{u}_f \cdot \boldsymbol{ n } = 0
The boundary condition at inlets allow to define a velocity profile on a set of marked faces \(\Gamma_{\mathrm{inlet}}\) in fluid mesh:
\boldsymbol{u}_f =  g \ \boldsymbol{ n } \quad \text{ on } \Gamma_{\mathrm{inlet}}
The function \(g\) is computed from flow velocity profiles:
\text{Find } g \in C^0(\Gamma) \text{ such that } \\ \begin{eqnarray} g &=& \beta \quad &\text{ in } \Gamma \setminus \partial\Gamma \\ g&=&0 \quad &\text{ on } \partial\Gamma \end{eqnarray}
\text{Find } g \in H^2(\Gamma) \text{ such that : } \\ \begin{eqnarray} \Delta g &=& \beta \quad &\text{ in } \Gamma \\ g&=&0 \quad &\text{ on } \partial\Gamma \end{eqnarray}
where \(\beta\) is a constant determined by adding a constraint to the inflow:
\(\max( g ) = \alpha \)
\(\int_\Gamma ( g \ \boldsymbol{n} ) \cdot \boldsymbol{n} = \alpha\)
Option  Value  Default value  Description 

shape 

select a shape profile for inflow 

constraint 

give a constraint wich controle velocity 

expr 
string 
symbolic expression of constraint value 
Option  Value  Default value  Description 

model 
free,windkessel 
free 
select an outlet modeling 
\boldsymbol{\sigma}_{f} \boldsymbol{ n } = \boldsymbol{0}
We use a 3element Windkessel model for modeling an outflow boundary condition. We define \(P_l\) a pressure and \(Q_l\) the flow rate. The outflow model is discribed by the following system of differential equations:
\left\{ \begin{aligned} C_{d,l} \frac{\partial \pi_l}{\partial t} + \frac{\pi_l}{R_{d,l}} = Q_l \\ P_l = R_{p,l} Q_l + \pi_l \end{aligned} \right.
Coefficients \(R_{p,l}\) and \(R_{d,l}\) represent respectively the proximal and distal resistance. The constant \(C_{d,l}\) is the capacitance of blood vessel. The unknowns \(P_l\) and \(\pi_l\) are called proximal pressure and distal pressure. Then we define the coupling between this outflow model and the fluid model by these two relationships:
\begin{align} Q_l &= \int_{\Gamma_l} \boldsymbol{u}_f \cdot \boldsymbol{ n }_f \\ \boldsymbol{\sigma}_f \boldsymbol{ n }_f &= P_l \boldsymbol{ n }_f \end{align}
Option  Value  Description 

windkessel_coupling 
explicit, implicit 
coupling type with the NavierStokes equation 
windkessel_Rd 
real 
distal resistance 
windkessel_Rp 
real 
proximal resistance 
windkessel_Cd 
real 
capacitance 
Boundary conditions are set in the json files in the category BoundaryConditions
.
Then <field>
and <bc_type>
are chosen from type of boundary condition.
The parameter <marker>
corresponds to mesh marker where the boundary condition is applied.
Finally, we define some specific options inside a marker.
"BoundaryConditions":
{
"<field>":
{
"<bc_type>":
{
"<marker>":
{
"<option1>":"<value1>",
"<option2>":"<value2>",
// ...
}
}
}
}
Field  Name  Option  Entity 

velocity 
Dirichlet 
expr type number alemesh_bc 
faces, edges, points 
velocity_x velocity_y velocity_z 
Dirichlet 
expr type number alemesh_bc 
faces, edges, points 
velocity 
Neumann_scalar 
expr number alemesh_bc 
faces 
velocity 
Neumann_vectorial 
expr number alemesh_bc 
faces 
velocity 
Neumann_tensor2 
expr number alemesh_bc 
faces 
velocity 
slip 
alemesh_bc 
faces 
pressure 
Dirichlet 
expr number alemesh_bc 
faces 
fluid 
outlet 
number alemesh_bc model windkessel_coupling windkessel_Rd windkessel_Rp windkessel_Cd 
faces 
fluid 
inlet 
expr shape constraint number alemesh_bc 
faces 
Body forces are also defined in BoundaryConditions
category in json file.
"VolumicForces":
{
"<marker>":
{
"expr":"{0,0,gravityCst*7850}:gravityCst"
}
}
The marker corresponds to mesh elements marked with this tag. If the marker is an empty string, it corresponds to all elements of the mesh.
"PostProcess":
{
"Fields":["field1","field2",...],
"Measures":
{
"<measure type>":
{
"label":
{
"<range type>":"value",
"fields":["field1","field3"]
}
}
}
}
The fields allowed to be exported in the Fields
section are:
velocity
pressure
displacement
vorticity
stress or normalstress
wallshearstress
density
viscosity
pid
alemesh
Points
Force
FlowRate
Pressure
VelocityDivergence
In order to evaluate velocity or pressure at specific points and save the results in .csv file, the user must define:
"<tag>" representing this data in the .csv file
the coordinate of point
the fields evaluated ("pressure" or "velocity")
"Points":
{
"<tag>":
{
"coord":"{0.6,0.2,0}",
"fields":"pressure"
},
"<tag>":
{
"coord":"{0.15,0.2,0}",
"fields":"velocity"
}
}
The flow rate can be evaluated and save on .csv file. The user must define:
"<tag>" representing this data in the .csv file
"<face_marker>" representing the name of marked face
the fluid direction ("interior_normal" or "exterior_normal") of the flow rate.
"FlowRate":
{
"<tag>":
{
"markers":"<face_marker>",
"direction":"interior_normal"
},
"<tag>":
{
"markers":"<face_marker>",
"direction":"exterior_normal"
}
}
A function defined by a symbolic expression can be represented as a finite element field thanks to nodal projection. This function can be exported.
"Functions":
{
"toto":{ "expr":"x*y:x:y"},
"toto2":{ "expr":"0.5*ubar*x*y:x:y:ubar"},
"totoV":{ "expr":"{2*x,y}:x:y"}
},
"PostProcess":
{
"Fields":["velocity","pressure","pid","totoV","toto","toto2"],
}
Galerkin leatSquare (GLS) stabilization methods can be activated from the cfg file by adding stabilizationgls=1
in the fluid
prefix.
Others options available are enumerated in the next table and must be given with the prefix fluid.stabilizationgls
.
Option  Value  Default value  Description 

type 


type of stabilization 
parameter.method 


method used to compute the stabilization parameter 
parameter.hsize.method 


method used for evalute an element mesh size 
parameter.eigenvalue.penallambdaK 
real 
0. 
add a mass matrix scaled by this factor in the eigen value problem for the stabilization parameter 
convectiondiffusion.location.expressions 
string 
if given, the stabilization is apply only on mesh location which verify 
Documentation pending 
programme avalaible :
feelpp_toolbox_fluid_2d
feelpp_toolbox_fluid_3d
mpirun np 4 feelpp_toolbox_fluid_2d configfile=<myfile.cfg>
The second Newton’s law allows us to define the fundamental equation of the solid mechanic, as follows
Name  \(\mathcal{W}_S(J_s)\)  \(\boldsymbol{\Sigma}_s^{\text{iso}}\) 

NeoHookean 
\(\mu_s J^{2/3}(\boldsymbol{I}  \frac{1}{3} \text{tr}(\boldsymbol{C}) \ \boldsymbol{C}^{1}) \) 
Name  \(\mathcal{W}_S(J_s)\)  \(\boldsymbol{\Sigma}_s^\text{vol}\) 

classic 
\(\frac{\kappa}{2} \left( J_s  1 \right)^2\) 

simo1985 
\(\frac{\kappa}{2} \left( ln(J_s) \right)\) 
We interest us here to a 1D reduced model, named generalized string.
The axisymmetric form, which will interest us here, is a tube of length \(L\) and radius \(R_0\). It is oriented following the axis \(z\) and \(r\) represent the radial axis. The reduced domain, named \(\Omega_s^*\) is represented by the dotted line. So the domain, where radial displacement \(\eta_s\) is calculated, is \(\Omega_s^*=\lbrack0,L\rbrack\).
We introduce then \(\Omega_s^{'*}\), where we also need to estimate a radial displacement as before. The unique variance is this displacement direction.
The mathematical problem associated to this reduce model can be describe as
where \(\eta_s\), the radial displacement that satisfy this equation, \(k\) is the Timoshenko’s correction factor, and \(\gamma_v\) is a viscoelasticity parameter. The material is defined by its density \(\rho_s^*\), its Young’s modulus \(E_s\), its Poisson’s ratio \(\nu_s\) and its shear modulus \(G_s\)
At the end, we take \( \eta_s=0\text{ on }\partial\Omega_s^*\) as a boundary condition, which will fixed the wall to its extremities.
The solid mechanics model can be selected in json file :
"Model":"HyperElasticity"
Model  Name in json 

Linear Elasticity 

Hyper Elasticity 

When materials are closed to incompressibility formulation in displacement/pressure are available.
Model  Name  Volumic law 

SaintVenantKirchhoff 

classic, simo1985 
NeoHookean 

classic, simo1985 
option: mechanicalproperties.compressible.volumic_law
The Lamé coefficients are deducing from the Young’s modulus \(E_s\) and the Poisson’s ratio \(\nu_s\) of the material we work on and can be express
"Materials":
{
"<marker>":
{
"name":"solid",
"E":"1.4e6",
"nu":"0.4",
"rho":"1e3"
}
}
where E
stands for the Young’s modulus in Pa, nu
the Poisson’s ratio (
dimensionless ) and rho
the density in \(kg\cdot m^{3}\).
Name  Options  Type 

Dirichlet 
faces, edges and componentwise 
"Dirichlet" 
Neumann 
scalar, vectorial 
"Neumann_scalar" or "Neumann_vectorial" 
Pressure follower , 
Nonlinear boundary condition set in deformed domain 
TODO 
Robin 
TODO 
TODO 
Name  Options  Type 

Expression 
Vectorial 
"VolumicForces" 
The fields allowed to be exported in the Fields
section are:
displacement
velocity
acceleration
stress or normalstress
pressure
materialproperties
pid
fsi
VonMises
Tresca
principalstresses
all
Points
Maximum
Minimum
VolumeVariation
Same syntax as FluidMechanics with available Fields :
displacement
velocity
acceleration
pressure
principalstress0
principalstress1
principalstress2
sigma_xx, sigma_xy, …
The Maximum and minimum can be evaluated and save on .csv file. User need to define (i) <Type> ("Maximum" or "Minimum"), (ii) "<tag>" representing this data in the .csv file, (iii) "<marker>" representing the name of marked entities and (iv) the field where extremum is computed.
"<Type>":
{
"<tag>":
{
"markers":"marker>",
"fields":["displacement","velocity"]
}
}
"VolumeVariation":<marker>
programme avalaible :
feelpp_toolbox_solid_2d
feelpp_toolbox_solid_3d
mpirun np 4 feelpp_toolbox_solid_2d configfile=<myfile.cfg>
The Fluid Structure models are formed from the combination of a Solid model and a Fluid model.
In order to have a correct fluidstructure model, we need to add to the solid model and the fluid model equations some coupling conditions :
\(\boldsymbol{(1)}, \boldsymbol{(2)}, \boldsymbol{(3)}\) are the fluidstruture coupling conditions, respectively velocities continuity, constraint continuity and geometric continuity.
For the coupling conditions, between the 2D fluid and 1D structure, we need to modify the original ones \(\boldsymbol{(1)},\boldsymbol{(2)}, \boldsymbol{(3)}\) by
Notation 
Quantity 
Unit 
\(\boldsymbol{u}_f\) 
fluid velocity 
\(m.s^{1}\) 
\(\boldsymbol{\sigma}_f\) 
fluid stress tensor 
\(N.m^{2}\) 
\(\boldsymbol{\eta}_s\) 
displacement 
\(m\) 
\(\boldsymbol{F}_s\) 
deformation gradient 
dimensionless 
\(\boldsymbol{\Sigma}_s\) 
second PiolaKirchhoff tensor 
\(N.m^{2}\) 
\(\mathcal{A}_f^t\) 
Arbitrary Lagrangian Eulerian ( ALE ) map 
dimensionless 
and
Let’s describe how the json file is build.
Model  Name 

Advection 

Stokes 

Boundary conditions are set in the json files
"BoundaryConditions":
{
"field":
{
"<condition type>":
{
"marker":
{
"expr": "value"
}
}
}
}
where all component of vectorial field can be access with <field>_x
for the x component where <field>
is the name of the vectorial field.
The condition types are explain in the two following tables.
Name  Options  Type 

Dirichlet 
faces, edges and componentwise 
"Dirichlet" 
Neumann 
scalar, vectorial 
"Neumann_scalar" or "Neumann_vectorial" 
Here is a example code, that use this model on a ring domain.
Here is the code
First at all, we define our model type with
typedef FeelModels::Advection< Simplex<FEELPP_DIM,1>, Lagrange<OrderAdvection, Scalar,Continuous,PointSetFekete> > model_type;
This definition allows us to create our advection model object FM like this
auto Adv = model_type::New("advection");
The method New
retrieve all data from the configuration and json files, as well build a mesh if need.
With this object, we can initialize our model parameters, such as boundaries conditions. Data on our model and on the numeric solver are then save and print on the terminal. This is made by
Adv>init(); Adv>printAndSaveInfo();
Now that our model is completed, we can solve the associated problem. To begin the resolution
Adv>isStationary()
determine if our model is stationary or not.
If it is, then we need to solve our system only one time and export the obtained results.
Adv>solve(); Adv>exportResults();
If it’s not, our model is time reliant, and a loop on time is necessary. Our model is then solved and the results are export at each time step.
for ( ; !Adv>timeStepBase()>isFinished(); Adv>updateTimeStep() ) { Adv>solve(); Adv>exportResults(); }
{% include "../Examples/advection_model.cpp" %}
The config file is used to define options, linked to our case, we would have the possibility to change at will. It can be, for example, files paths as follows
# advection [advection] geofile=$cfgdir/ring2d.geo filename=$cfgdir/ring2d.json [exporter] directory=simul/advect2d/ring/data format=ensightgold
It can also be resolution dependent parameters such as mesh elements size, methods used to define our problem and solvers.
# time [advection.bdf] order=2 [ts] timeinitial=0.0 timestep=1 timefinal=1 steady=true [advection.gmsh] hsize=0.03 # backend advection and projection pcfactormatsolverpackagetype=mumps pctype=lu #kspmonitor=1 kspconvergedreason=true kspmaxit=1000 #snesmonitor=1 snesconvergedreason=true snesmaxitreuse=3 sneskspmaxitreuse=20
In this case, we choose LU as the preconditioner method, with a mesh size equal to 0.03. As for time discretization, we use a BDF at order 2.
{% include "../Examples/ring2d.cfg" %}
First at all, we define some general information like the name ( and short name ) and the model we would like to use
"Name": "Ring2d",
"ShortName": "Ring2d",
"Model": "Advection",
In this case, we have only boundary conditions to define. Here, we impose homogeneous Dirichlet conditions.
"BoundaryConditions":
{
"advection":
{
"Dirichlet":
{
"Bottom":
{
"expr":"0"
},
"Left":
{
"expr":"0"
},
"InnerCircle":
{
"expr":"0"
},
"OuterCircle":
{
"expr":"0"
}
}
}
}
{% include "../Examples/ring2d.json" %}
Once you’ve a build dir, you just have to realise the command make
at
{buildir}/applications/models/advection
This will generate an executable named feelpp_application_advection_2d
. To execute it, you need to give the path of the cfg file associated to your case, with configfile
.
For example
./feelpp_application_advection_2d configfile={sourcedir}/applications/models/advection/ring/ring2d.cfg
is how to execute the case ahead.
The result files are then stored by default in
feel/simul/advect2d/{domain_shape}/data/{processor_used}
If we return once again at our example, the result files are in
feel/simul/advect2d/ring/data/np_1
This section focuses on defining and solving of a thermoelectric model, which couples heat transfer and electrostatic models. The current flow inside an electrical conductor leads to the heating of the material, due to Joule effect. The temperature in the conductor can be deduced from the standard heat equation whose source term reads from the electrical potential to mimic the Joule effect.
In the following sections, the domain is denoted by \(\Omega \subset \mathbb{R}^d\), \(d=2,3\) and its border by \(\Gamma\).
The electrostatic model consists in a diffusion equation. The electrical potential \(V\) satisfies
where \(\sigma\) is the electrical conductivity.
The electrical conductivity \(\sigma\) often depends on the temperature. The thermoelectric model becomes nonlinear in this case. 
The current flow within the conductor is modeled by a difference in electrical potential between the current input \(\Gamma_{in} \subset \Gamma\) and the current output \(\Gamma_{out} \subset \Gamma\).
\(V=0 ~~\text{on}~~ \Gamma_{in}\)
\(V=V_{out} ~~\text{on}~~ \Gamma_{out}\).
We consider in this model that all other boundaries are electrically insulating. This conditions reads from the current density \(\mathbf{j} =  \sigma \nabla V\) as
\(\mathbf{j}\cdot\mathbf{n} = \sigma\nabla V\cdot\mathbf{n} = 0 ~~\text{on}~~ \Gamma \setminus (\Gamma_{in} \cup \Gamma_{out})\).
The local form of Joule’s law defines the heat source corresponding to Joule effect as the dot product of the current density \(\mathbf{j} =  \sigma \nabla V\) by the electric field \(E=\nabla V\). This product \(P = \sigma \nabla V \cdot \nabla V\) will be the source term of the heat equation defined in the next section.
The temperature \(T\) satisfies the standard heat equation with the previously introduced Joule effect as source term,
where \(k\) is the thermal conductivity.
As for the electrical conductivity \(\sigma\), the thermal conductivity \(k\) can also depends on temperature. 
The thermal flux can eventually be controled by a water cooling process which limit the heating. The thermal exchange between the electrical conductor and the cooling water is governed by a convection phenomenon involving a heat transfert coefficient \(h\) and the water temperature \(T_c\). This cooling process is handled by a Robin condition on the cooled regions \(\Gamma_{c} \subset \Gamma\)
\(k\nabla T\cdot\mathbf{n} = h(TT_c) ~~\text{on}~~ \Gamma_{C}\)
We consider that the thermal exchanges are limited to the cooled region, which amounts to apply an homogeneous Neumann condition on all other boundaries.
\(k\nabla T\cdot \mathbf{n} = 0 ~~\text{on}~~ \Gamma \setminus \Gamma_{C}\)
In the thermoelectric model, we have 4 parameters
\(\sigma\) the electrical conductivity
\(k\) the thermal conductivity
\(T_c\) the water cooling temperature
\(h\) the heat transfer coefficient
These parameters can be scalars of fields. 
We gather in the following table parameter ranges, nominal values as well as units for \(\sigma, k, T_c, h\).
Parameters 
Ranges 
Nominal value 
Units 
\(\sigma\) 
\([52.10^{6};58.10^{6}\)] 
\(53\cdot 10^{6}\) 
\(S \cdot m^{1}\) 
\(k\) 
\([360;380\)] 
\(370\) 
\(W\cdot m^{1} \cdot K^{1}$\) 
\(T_c\) 
\([293;310\)] 
\(300\) 
K 
\(h\) 
\([70000;90000\)] 
\(850000\) 
\(W \cdot m^{2} \cdot K^{1}\) 
In the linear case, we first solve for \(V\) and then for \(T\) using \(V\) to compute the Joule effect that generates heat inside \(\Omega\).
Using Docker, you can run Feel++ model application and in particular the thermoelectric model using the following command
$ docker run it v $HOME/feel:/feel feelpp/feelpptoolboxes:latest
Then type the following command in docker environment to run the model
$ cd Testcases/models/thermoelectric/test
$ mpirun np 4 /usr/local/bin/feelpp_toolbox_thermoelectric_3d configfile model.cfg
:leveloffset:+1 = Generic Partial Differential Equations
:leveloffset:+1
We are interested in this section in the conforming finite element approximation of the following problem:
\(\partial \Omega_D\), \(\partial \Omega_N\) and \(\partial \Omega_R\) can be empty sets. In the case \(\partial \Omega_D =\partial \Omega_R = \emptyset\), then the solution is known up to a constant. 
In the implementation presented later, \(\partial \Omega_D =\partial \Omega_N = \partial \Omega_R = \emptyset\), then we set Dirichlet boundary conditions all over the boundary. The problem then reads like a standard laplacian with inhomogeneous Dirichlet boundary conditions: 
We assume that \(f, h, l \in L^2(\Omega)\). The weak formulation of the problem then reads:
We now turn to the finite element approximation using Lagrange finite element. We assume \(\Omega\) to be a segment in 1D, a polygon in 2D or a polyhedron in 3D. We denote \(V_\delta \subset H^1(\Omega)\) an approximation space such that \(V_{g,\delta} \equiv P^k_{c,\delta}\cap H^1_{g,\Gamma_D}(\Omega)\).
The weak formulation reads:
from now on, we omit \(\delta\) to lighten the notations. Be careful that it appears both the geometrical and approximation level. 
In Feel++, \(V_{g,\delta}\) is not built but rather \(P^k_{c,\delta}\).
The Dirichlet boundary conditions can be treated using different techniques and we use from now on the elimination technique. 
We start with the mesh
auto mesh = loadMesh(_mesh=new Mesh<Simplex<FEELPP_DIM,1>>);
the keyword auto enables type inference, for more details see Wikipedia C++11 page.

Next the discretization setting by first defining Vh=Pch<k>(mesh)
\(\equiv P^k_{c,h}\), then elements of Vh
and expressions f
, n
and g
given by command line options or configuration file.
auto Vh = Pch<2>( mesh );
auto u = Vh>element("u");
auto mu = doption(_name="mu");
auto f = expr( soption(_name="functions.f"), "f" );
auto r_1 = expr( soption(_name="functions.a"), "a" ); // Robin left hand side expression
auto r_2 = expr( soption(_name="functions.b"), "b" ); // Robin right hand side expression
auto n = expr( soption(_name="functions.c"), "c" ); // Neumann expression
auto g = expr( soption(_name="functions.g"), "g" );
auto v = Vh>element( g, "g" );
at the following line

the variational formulation is implemented below, we define the
bilinear form a
and linear form l
and we set strongly the
Dirichlet boundary conditions with the keyword on
using
elimination. If we don’t find Dirichlet
, Neumann
or Robin
in the
list of physical markers in the mesh data structure then we impose
Dirichlet boundary conditions all over the boundary.
auto l = form1( _test=Vh );
l = integrate(_range=elements(mesh),
_expr=f*id(v));
l+=integrate(_range=markedfaces(mesh,"Robin"), _expr=r_2*id(v));
l+=integrate(_range=markedfaces(mesh,"Neumann"), _expr=n*id(v));
toc("l");
tic();
auto a = form2( _trial=Vh, _test=Vh);
a = integrate(_range=elements(mesh),
_expr=mu*gradt(u)*trans(grad(v)) );
a+=integrate(_range=markedfaces(mesh,"Robin"), _expr=r_1*idt(u)*id(v));
a+=on(_range=markedfaces(mesh,"Dirichlet"), _rhs=l, _element=u, _expr=g );
//! if no markers Robin Neumann or Dirichlet are present in the mesh then
//! impose Dirichlet boundary conditions over the entire boundary
if ( !mesh>hasAnyMarker({"Robin", "Neumann","Dirichlet"}) )
a+=on(_range=boundaryfaces(mesh), _rhs=l, _element=u, _expr=g );
toc("a");
tic();
//! solve the linear system, find u s.t. a(u,v)=l(v) for all v
if ( !boption( "nosolve" ) )
a.solve(_rhs=l,_solution=u);
toc("a.solve");
cout << "u_hg_L2=" << normL2(_range=elements(mesh), _expr=idv(u)g) << std::endl;
tic();
auto e = exporter( _mesh=mesh );
e>addRegions();
e>add( "u", u );
e>add( "g", v );
e>save();
toc("Exporter");
return 0;
}
We have the following correspondance:

next we solve the algebraic problem
//! solve the linear system, find u s.t. a(u,v)=l(v) for all v
if ( !boption( "nosolve" ) )
a.solve(_rhs=l,_solution=u);
next we compute the \(L^2\) norm of \(u_\deltag\), it could serve as an \(L^2\) error if \(g\) was manufactured to be the exact solution of the Laplacian problem.
cout << "u_hg_L2=" << normL2(_range=elements(mesh), _expr=idv(u)g) << std::endl;
and finally we export the results, by default it is in the ensight gold format and the files can be read with Paraview and Ensight. We save both \(u\) and \(g\).
auto e = exporter( _mesh=mesh );
e>addRegions();
e>add( "u", u );
e>add( "g", v );
e>save();
The Feel++ Implementation comes with testcases in 2D and 3D.
circle
is a 2D testcase where \(\Omega\) is a disk whose boundary
has been split such that \(\partial \Omega=\partial \Omega_D \cup
\partial \Omega_N \cup \partial \Omega_R\).
Here are some results we can observe after use the following command
cd Testcases/quickstart/circle
mpirun np 4 /usr/local/bin/feelpp_qs_laplacian_2d configfile circle.cfg
This give us some data such as solution of our problem or the mesh used in the application.
Solution \(u_\delta\) 
Mesh 
This testcase solves the Laplacian problem in \(\Omega\) an quadrangle or hexadra containing the letters of Feel++
After running the following command
cd Testcases/quickstart/feelpp2d
mpirun np 4 /usr/local/bin/feelpp_qs_laplacian_2d configfile feelpp2d.cfg
we obtain the result \(u_\delta\) and also the mesh
/images/Laplacian/TestCases/Feelpp2d/meshfeelpp2d.png[] 

Solution \(u_\delta\) 
Mesh 
We can launch this application with the current line
cd Testcases/quickstart/feelpp3d
mpirun np 4 /usr/local/bin/feelpp_qs_laplacian_3d configfile feelpp3d.cfg
When it’s finish, we can extract some informations
Solution \(u_\delta\) 
Mesh 
Having the possibility to determine where two regions meeting can be really useful in some scientific domains. That’s why the levelset method is born.
By using a scalar function \phi, define on all regions as the null value is obtained when it’s placed on an interface of two domains.
We denote \Omega_1 and \Omega_2 two domains with \Gamma the interface betwen them. Then \phi can be define as
\phi(\boldsymbol{x}) = \left\{ \begin{array}{cccc} \text{dist}(\boldsymbol{x}, \Gamma), & \boldsymbol{x}& \in &\Omega_1 \\ 0, & \boldsymbol{x}& \in &\Gamma\\ \text{dist}(\boldsymbol{x}, \Gamma), & \boldsymbol{x}& \in & \Omega_2 \end{array} \right.
with \text{dist}(\boldsymbol{x}, \Gamma ) = \underset{\boldsymbol{y} \; \in \; \Gamma}{\min}( \boldsymbol{x}  \boldsymbol{y} ).
This function \phi had also the following property \nabla\phi=1.
Moreover, the unit normal vector \boldsymbol{n} outgoing from the interface and the curvature \mathcal{\kappa} can be obtained from the levelset function.
\boldsymbol{n}=\frac{\nabla\phi}{\nabla\phi} \\ \mathcal{\kappa}=\nabla \cdot \boldsymbol{n}= \nabla \cdot \frac{\nabla\phi}{\nabla\phi}
Now we have exposed the levelset function, we need to define how the levelset will evolve and will spread into all the space. To do this, we use the following advection equation :
\partial_t\phi+\boldsymbol{u}\cdot\nabla\phi=0
where \boldsymbol{u} is an incompressible velocity field.
We define also the regularized Heaviside function H_\varepsilon(\phi) = \left\{ \begin{array}{cc} 0, & \phi \leq  \varepsilon,\\ \dfrac{1}{2} \left(1+\dfrac{\phi}{\varepsilon}+\dfrac{\sin\left(\dfrac{\pi \phi}{\varepsilon}\right)}{\pi}\right), & \varepsilon \leq \phi \leq \varepsilon, \\ 1, & \phi \geq \varepsilon \end{array} \right.
and the regularized Dirac function \delta_\varepsilon(\phi) = \left\{ \begin{array}{cc} 0, & \phi \leq  \varepsilon,\\ \displaystyle\dfrac{1}{2 \varepsilon} \left(1+\cos\left(\dfrac{\pi \phi}{\varepsilon}\right)\right), & \varepsilon \leq \phi \leq \varepsilon, \\ 0, & \phi \geq \varepsilon. \end{array} \right.
The first one gives a different value to each side of the interface ( here 0 in and 1 out ). The second one allow us to define quantities, with value different from 0 at the interface. A typical value of \varepsilon in literature is 1.5h where h is the mesh step size.
It should be noted that these functions allow us to determine respectively the volume and the surface of the interface by V^+_{\varepsilon} = \int_{\Omega} H_\varepsilon \\ S^{\Gamma}_{\varepsilon} = \int_{\Omega} \delta_\varepsilon
We describe the benchmark proposed by Zalesak.
Computer codes, used for the acquisition of results, are from Vincent Doyeux.
In order to test our interface propagation method, i.e. the levelset method \phi, we will study the rotation of a slotted disk into a square domain. The geometry can be represented as
We denote \Omega, the square domain [0,1]\times[0,1]. The center of the slotted disk is placed at (0.5,0.75).
To model the rotation, we will apply an angular velocity, centered in (0.5,0.5), as the disk is back to its initial position after t_f=628.
During this test, we observe three different errors to measure the quality of our method. With these values, two kinds of convergence will be studied : the time convergence, with different time step on an imposed grid and the space one, where the space discretization and the time step are linked by a relation. Several stabilization methods are used such as CIP ( Continuous Interior Penalty ) or SUPG ( StreamlineUpwing/PetrovGalerkin ).
We set a Neumann boundary condition on the boundary of the domain.
The velocity is imposed as \boldsymbol{u}=\left( \frac{\pi}{314} (50y),\frac{\pi}{314} (x50) \right)
Here is the velocity look in the square domain
The following table displays the various fixed and variables parameters of this testcase.
Name 
Description 
Nominal Value 
Units 
r 
disk radius 
0.15 
m 
l 
slot base 
0.05 
m 
h 
slot height 
0.25 
m 
t_f 
slotted disk rotation period 
628 
s 
We observe during this benchmark three different errors.
First at all, the mass error, define by
e_{\text{m}} = \frac{ \left m_{\phi_f}  m_{\phi_0}\right }{m_{\phi_0}} = \frac{ \left \displaystyle \int_{\Omega} \chi( \phi_f < 0 )  \displaystyle \int_{\Omega} \chi( \phi_0 < 0 ) \right }{ \displaystyle \int_{\Omega} \chi( \phi_0 < 0 )}
where \chi is the characteristic function. \chi( f( \phi ) ) = \left\{ \begin{array}{rcl} 1 & \text{ if } & f( \phi ) \neq 0 \\ 0 & \text{ if } & f( \phi ) = 0 \end{array} \right.
However, mass is gain and loose at different emplacements on the mesh, and at the same time, with the level set method.
Secondly, the sign change error e_{\text{sc}} = \sqrt{ \int_\Omega \left( (1H_0)  (1H_f) \right)^2 }
with H_0=H_\epsilon(\phi_0) and H_f=H_\epsilon(\phi_f), H_\epsilon the smoothed Heaviside function of thickness 2ε.
This error is better to define the interface displacement. In fact, we can determine where \phi_0\phi_f<0, in other words where the interface has moved.
Finally, we define the classical L^2 error at the interface, as e_{L^2} = \sqrt{ \frac{1}{\displaystyle \int_\Omega \chi( \delta(\phi_0) > 0 ) } \int_\Omega (\phi_0  \phi_f)^2 \chi( \delta(\phi_0) > 0 ) }.
For this case, we set a fixed grid with mesh step size h=0.04, and so 72314 degree of freedom on a \mathbb{P}^1.
Then, after the disk made one round, we measure the errors obtained from two different discretizations ( BDF2 and Euler ) and compared them.
We repeat this with several time step dt\in \{2.14, 1, 0.5, 0.25, 0.20\}.
Only one stabilization method is used : SUPG
We define the following relation, between time step and mesh step size : dt=C\frac{h}{U_{max}}
where C<1 constant and U_{max} the maximum velocity of \Omega.
From the definition of our velocity, U_{max} is reached at the farthest point from the center of \Omega. In this case, we have U_{max}=0.007, and we set C=0.8.
We use the BDF2 method for time discretization. As in time convergence, we wait one round of the disk to measure the errors and we repeat this test for these values of h: 0.32, 0.16, 0.08, 0.04.
We compare the results from different stabilization methods : CIP, SUPG, GLS ( GalerkinLeastSquares ) and SGS ( SubGrid Scale ).
dt 
e_{L^2} 
e_{sc} 
e_m 
2.14 
0.0348851 
0.202025 
0.202025 
1.00 
0.0187567 
0.147635 
0.147635 
0.5 
0.0098661 
0.10847 
0.10847 
0.25 
0.008791 
0.0782569 
0.0782569 
0.20 
0.00803373 
0.0670677 
0.0670677 
dt 
e_{L^2} 
e_{sc} 
e_m 
2.14 
0.0118025 
0.0906617 
0.0492775 
1.00 
0.00436957 
0.0445275 
0.0163494 
0.5 
0.00173637 
0.0216359 
0.0100621 
0.25 
0.001003 
0.0125971 
0.00354644 
0.20 
0.000949343 
0.0117449 
0.00317368 
stab 
h 
e_{L^2} 
e_{sc} 
e_m 
CIP 
0.32 
0.0074 
0.072 
0.00029 
0.16 
0.0046 
0.055 
0.00202 

0.08 
0.0025 
0.033 
0.00049 

0.04 
0.0023 
0.020 
0.00110 

SUPG 
0.32 
0.012 
0.065 
0.01632 
0.16 
0.008 
0.049 
0.07052 

0.08 
0.004 
0.030 
0.00073 

0.04 
0.001 
0.018 
0.00831 

GLS 
0.32 
0.013 
0.066 
0.02499 
0.16 
0.008 
0.051 
0.05180 

0.08 
0.004 
0.031 
0.00805 

0.04 
0.001 
0.019 
0.00672 

SGS 
0.32 
0.012 
0.065 
0.01103 
0.16 
0.008 
0.050 
0.07570 

0.08 
0.004 
0.030 
0.00084 

0.04 
0.001 
0.018 
0.00850 
Let’s begin with time convergence results. Tables shows us that sign change error is better to define the quality of the chosen scheme than the mass error. In fact, the loss of mass somewhere can be nullify by a gain of mass elsewhere. Sign change error shows half an order gain from Euler scheme to BDF2 one, as L^2 errors show us a gain of one order. For the slotted disk shape, BDF2 uses the two previous iterations to obtain the current result, while Euler only need the previous iteration. This explain why we can see an asymmetrical tendency in the first one.
As for space convergence, the different stabilization methods we used give us the same convergence rate equals to 0.6, with close error values, for the sign change error. For the L^2 error case, it’s not as evident as the previous one. Aside the CIP stabilization method with a 0.6 convergence rate, the others show us a convergence rate of 0.9.
[Zalesak] Steven T. Zalesak, Fully multidimensional fluxcorrected transport algorithms for fluids, Journal of Computational Physics, 1979.
[Doyeux] Vincent Doyeux, Modelisation et simulation de systemes multifluides. Application aux ecoulements sanguins., Physique Numérique [physics.compph], Université de Grenoble, 2014
:leveloffset:1
We implement the benchmark proposed by Turek and Hron, on the behavior of drag and lift forces of a flow around an object composed by a pole and a bar, see Figure Geometry of the reduce model.
The software and the numerical results were initially obtained from Vincent Chabannes.
This benchmark is linked to the Turek Hron CSM and Turek Hron FSI benchmarks. 
We consider a 2D model representative of a laminar incompressible flow around an obstacle. The flow domain, named \(\Omega_f\), is contained into the rectangle \( \lbrack 0,2.5 \rbrack \times \lbrack 0,0.41 \rbrack \). It is characterised, in particular, by its dynamic viscosity \(\mu_f\) and by its density \(\rho_f\). In this case, the fluid material we used is glycerine.
In order to describe the flow, the incompressible NavierStokes model is chosen for this case, define by the conservation of momentum equation and the conservation of mass equation. At them, we add the material constitutive equation, that help us to define \(\boldsymbol{\sigma}_f\)
The goal of this benchmark is to study the behavior of lift forces \(F_L\) and drag forces \(F_D\), with three different fluid dynamics applied on the obstacle, i.e on \(\Gamma_{obst}\), we made rigid by setting specific structure parameters. To simulate these cases, different mean inflow velocities, and thus different Reynolds numbers, will be used.
We set
on \(\Gamma_{in}\), an inflow Dirichlet condition : \( \boldsymbol{u}_f=(v_{in},0) \)
on \(\Gamma_{wall}\) and \(\Gamma_{obst}\), a homogeneous Dirichlet condition : \( \boldsymbol{u}_f=\boldsymbol{0} \)
on \(\Gamma_{out}\), a Neumann condition : \( \boldsymbol{\sigma}_f\boldsymbol{ n }_f=\boldsymbol{0} \)
We use a parabolic velocity profile, in order to describe the flow inlet by \( \Gamma_{in} \), which can be express by
v_{cst} = 1.5 \bar{U} \frac{4}{0.1681} y \left(0.41y\right)
where \(\bar{U}\) is the mean inflow velocity.
However, we want to impose a progressive increase of this velocity profile. That’s why we define
v_{in} = \left\{ \begin{aligned} & v_{cst} \frac{1\cos\left( \frac{\pi}{2} t \right) }{2} \quad & \text{ if } t < 2 \\ & v_{cst} \quad & \text{ otherwise } \end{aligned} \right.
With t the time.
Moreover, in this case, there is no source term, so \(f_f\equiv 0\).
The following table displays the various fixed and variables parameters of this testcase.
Name  Description  Nominal Value  Units  

\(l\) 
elastic structure length 
\(0.35\) 
\(m\) 

\(h\) 
elastic structure height 
\(0.02\) 
\(m\) 

\(r\) 
cylinder radius 
\(0.05\) 
\(m\) 

\(C\) 
cylinder center coordinates 
\((0.2,0.2)\) 
\(m\) 

\(\nu_f\) 
kinematic viscosity 
\(1\times 10^{3}\) 
\(m^2/s\) 

\(\mu_f\) 
dynamic viscosity 
\(1\) 
\(kg/(m \times s)\) 

\(\rho_f\) 
density 
\(1000\) 
\(kg/m^3\) 

\(f_f\) 
source term 
0 
\(kg/(m^3 \times s)\) 

\(\bar{U}\) 
characteristic inflow velocity 

\(m/s\) 
As defined above, the goal of this benchmark is to measure the drag and lift forces, \(F_D\) and \(F_L\), to control the fluid solver behavior. They can be obtain from
(F_D,F_L)=\int_{\Gamma_{obst}}\boldsymbol{\sigma}_f \boldsymbol{ n }_f
where \(\boldsymbol{n}_f\) the outer unit normal vector from \(\partial \Omega_f\).
To realize these tests, we made the choice to used \(P_N\)\(P_{N1}\) TaylorHood finite elements, described by Chabannes, to discretize space. With the time discretization, we use BDF, for Backward Differentation Formulation, schemes at different orders \(q\).
Here are the different solvers ( linear and nonlinear ) used during results acquisition.
type 
gmres 
relative tolerance 
1e13 
max iteration 
1000 
reuse preconditioner 
false 
relative tolerance 
1e8 
steps tolerance 
1e8 
max iteration 
CFD1/CFD2 : 100  CFD3 : 50 
max iteration with reuse 
CFD1/CFD2 : 100  CFD3 : 50 
reuse jacobian 
false 
reuse jacobian rebuild at first Newton step 
true 
relative tolerance 
1e5 
max iteration 
1000 
max iteration with reuse 
CFD1/CFD2 : 100  CFD3 : 1000 
reuse preconditioner 
false 
reuse preconditioner rebuild at first Newton step 
false 
type 
lu 
package 
mumps 
The configuration files are in toolboxes/fluid/TurekHron
. The different cases are implemented in the corresponding .cfg
files e.g. cfd1.cfg
, cfd2.cfg
and cfd3.cfg
.
The command line in feelpptoolboxes docker reads
$ mpirun np 4 /usr/local/bin/feelpp_toolbox_fluid_2d configfile cfd1.cfg
The result files are then stored by default in
feel/applications/models/fluid/TurekHron/"case_name"/"velocity_space""pression_space""Geometric_order"/"processor_used"
For example, for CFD2 case executed on \(12\) processors, with a \(P_2\) velocity approximation space, a \(P_1\) pressure approximation space and a geometric order of \(1\), the path is
feel/toolboxes/fluid/TurekHron/cfd2/P2P1G1/np_12
Here are results from the different cases studied in this benchmark.
\(\mathbf{N_{geo}}\)  \(\mathbf{N_{elt}}\)  \(\mathbf{N_{dof}}\)  Drag  Lift 

Reference Turek and Hron 
14.29 
1.119 

1 
9874 
45533 (\(P_2/P_1\)) 
14.217 
1.116 
1 
38094 
173608 (\(P_2/P_1\)) 
14.253 
1.120 
1 
59586 
270867 (\(P_2/P_1\)) 
14.262 
1.119 
2 
7026 
78758 (\(P_3/P_2\)) 
14.263 
1.121 
2 
59650 
660518 (\(P_3/P_2\)) 
14.278 
1.119 
3 
7026 
146057 (\(P_4/P_3\)) 
14.270 
1.120 
3 
59650 
1228831 (\(P_4/P_3\)) 
14.280 
1.119 
All the files used for this case can be found in this rep [geo file, config file, json file]
\(\mathbf{N_{geo}}\)  \(\mathbf{N_{elt}}\)  \(\mathbf{N_{dof}}\)  Drag  Lift 

Reference Turek and Hron 
136.7 
10.53 

1 
7020 
32510 (\(P_2/P_1\)) 
135.33 
10.364 
1 
38094 
173608 (\(P_2/P_1\)) 
136.39 
10.537 
1 
59586 
270867 (\(P_2/P_1\)) 
136.49 
10.531 
2 
7026 
78758 (\(P_3/P_2\)) 
136.67 
10.548 
2 
59650 
660518 (\(P_3/P_2\)) 
136.66 
10.532 
3 
7026 
146057 (\(P_4/P_3\)) 
136.65 
10.539 
3 
59650 
1228831 (\(P_4/P_3\)) 
136.66 
10.533 
All the files used for this case can be found in this rep [geo file, config file, json file]
As CFD3 is timedependent ( from BDF use ), results will be expressed as
mean ± amplitude [frequency]
where
mean is the average of the min and max values at the last period of oscillations.
mean=\frac{1}{2}(max+min)
amplitude is the difference of the max and the min at the last oscillation.
amplitude=\frac{1}{2}(maxmin)
frequency can be obtain by Fourier analysis on periodic data and retrieve the lowest frequency or by the following formula, if we know the period time T.
frequency=\frac{1}{T}
\(\mathbf{\Delta t}\)  \(\mathbf{N_{geo}}\)  \(\mathbf{N_{elt}}\)  \(\mathbf{N_{dof}}\)  \(\mathbf{N_{bdf}}\)  Drag  Lift 

0.005 
Reference Turek and Hron 
439.45 ± 5.6183[4.3956] 
−11.893 ± 437.81[4.3956] 
0.01 
1 
8042 
37514 (\(P_2/P_1\)) 
2 
437.47 ± 5.3750[4.3457] 
9.786 ± 437.54[4.3457] 
2 
2334 
26706 (\(P_3/P_2\)) 
2 
439.27 ± 5.1620[4.3457] 
8.887 ± 429.06[4.3457] 

2 
7970 
89790 (\(P_2/P_2\)) 
2 
439.56 ± 5.2335[4.3457] 
11.719 ± 425.81[4.3457] 
0.005 
1 
3509 
39843\((P_3/P_2)\) 
2 
438.24 ± 5.5375[4.3945] 
11.024 ± 433.90[4.3945] 
1 
8042 
90582 (\(P_3/P_2\)) 
2 
439.25 ± 5.6130[4.3945] 
10.988 ± 437.70[4.3945] 

2 
2334 
26706 (\(P_3/P_2\)) 
2 
439.49 ± 5.5985[4.3945] 
10.534 ± 441.02[4.3945] 

2 
7970 
89790 (\(P_3/P_2\)) 
2 
439.71 ± 5.6410[4.3945] 
11.375 ± 438.37[4.3945] 

3 
3499 
73440 (\(P_4/P_3\)) 
3 
439.93 ± 5.8072[4.3945] 
14.511 ± 440.96[4.3945] 

4 
2314 
78168 (\(P_5/P_4\)) 
2 
439.66 ± 5.6412[4.3945] 
11.329 ± 438.93[4.3945] 
0.002 
2 
7942 
89482 (\(P_3/P_2)\) 
2 
439.81 ± 5.7370[4.3945] 
13.730 ± 439.30[4.3945] 
3 
2340 
49389 (\(P_4/P_3\)) 
2 
440.03 ± 5.7321[4.3945] 
13.250 ± 439.64[4.3945] 

3 
2334 
49266 (\(P_4/P_3\)) 
3 
440.06 ± 5.7773[4.3945] 
14.092 ± 440.07[4.3945] 
All the files used for this case can be found in this rep [geo file, config file, json file].
Add a section on geometrical order. 
The reference results, Turek and Hron, have been obtained with a time step \(\Delta t=0.05\). When we compare our results, with the same step and \(\mathrm{BDF}_2\), we observe that they are in accordance with the reference results.
With a larger \(\Delta t\), a discrepancy is observed, in particular for the drag force. It can also be seen at the same time step, with a higher order \(\mathrm{BDF}_n\) ( e.g. \(\mathrm{BDF}_3\) ). This suggests that the couple \(\Delta t=0.05\) and \(\mathrm{BDF}_2\) isn’t enough accurate.
[TurekHron] S. Turek and J. Hron, Proposal for numerical benchmarking of fluidstructure interaction between an elastic object and laminar incompressible flow, Lecture Notes in Computational Science and Engineering, 2006.
[Chabannes] Vincent Chabannes, Vers la simulation numérique des écoulements sanguins, Équations aux dérivées partielles [math.AP], Universitée de Grenoble, 2013.
Unresolved directive in /var/lib/buildkiteagent/builds/sd876601/feelpp/wwwdotfeelppdotorg/pages/man/04learning/CFD/README.adoc  include::MultiFluid/README.adoc[]
This benchmark has been proposed and realised by Hysing. It allows us to verify our level set code, our NavierStokes solver and how they couple together.
Computer codes, used for the acquisition of results, are from Vincent Doyeux, with the use of Chabannes's NavierStokes code.
We want to simulate the rising of a 2D bubble in a Newtonian fluid. The bubble, made of a specific fluid, is placed into a second one, with a higher density. Like this, the bubble, due to its lowest density and by the action of gravity, rises.
The equations used to define fluid bubble rising in an other are the NavierStokes for the fluid and the advection one for the level set method. As for the bubble rising, two forces are defined :
The gravity force : \(\boldsymbol{f}_g=\rho_\phi\boldsymbol{g}\)
The surface tension force : \(\boldsymbol{f}_{st}=\int_\Gamma\sigma\kappa\boldsymbol{ n } \)
We denote \( \Omega\times\rbrack0,3\rbrack \) the interest domain with \( \Omega=(0,1)\times(0,2) \). \(\Omega\) can be decompose into \(\Omega_1\), the domain outside the bubble and \(\Omega_2\) the domain inside the bubble and \(\Gamma\) the interface between these two.
Durig this benchmark, we will study two different cases : the first one with a ellipsoidal bubble and the second one with a squirted bubble.
On the lateral walls, we imposed slip conditions
On the horizontal walls, no slip conditions are imposed : \(\boldsymbol{u}=0 \)
In order to let the bubble rise, its density must be inferior to the density of the exterior fluid, so \(\rho_1>\rho_2\)
The following table displays the various fixed and variables parameters of this testcase.
Name  Description  Nominal Value  Units 

\(\boldsymbol{g}\) 
gravity acceleration 
\((0,0.98)\) 
\(m/s^2\) 
\(l\) 
length domain 
\(1\) 
\(m\) 
\(h\) 
height domain 
\(2\) 
\(m\) 
\(r\) 
bubble radius 
\(0.25\) 
\(m\) 
\(B_c\) 
bubble center 
\((0.5,0.5)\) 
\(m\) 
In the first place, the quantities we want to measure are \(X_c\) the position of the center of the mass of the bubble, the velocity of the center of the mass \(U_c\) and the circularity \(c\), define as the ratio between the perimeter of a circle and the perimeter of the bubble. They can be expressed by
After that, we interest us to quantitative points for comparison as \(c_{min}\), the minimum of the circularity and \(t_{c_{min}}\), the time needed to obtain this minimum, \(u_{c_{max}}\) and \(t_{u_{c_{max}}}\) the maximum velocity and the time to attain it, or \(y_c(t=3)\) the position of the bubble at the final time step. We add a second maximum velocity \(u_{max}\) and \(u_{c_{max_2}}\) and its time \(t_{u_{c_{max_2}}}\) for the second test on the squirted bubble.
This is the parameters associate to the two cases, which interest us here.
Case 
\(\rho_1\) 
\(\rho_2\) 
\(\mu_1\) 
\(\mu_2\) 
\(\sigma\) 
Re 
\(E_0\) 
ellipsoidal bubble (1) 
1000 
100 
10 
1 
24.5 
35 
10 
squirted bubble (2) 
1000 
1 
10 
0.1 
1.96 
35 
125 
We describe the different quantitative results for the two studied cases.
h 
\(c_{min}\) 
\(t_{c_{min}}\) 
\(u_{c_{max}}\) 
\(t_{u_{c_{max}}}\) 
\(y_c(t=3)\) 
lower bound 
0.9011 
1.8750 
0.2417 
0.9213 
1.0799 
upper bound 
0.9013 
1.9041 
0.2421 
0.9313 
1.0817 
0.02 
0.8981 
1.925 
0.2400 
0.9280 
1.0787 
0.01 
0.8999 
1.9 
0.2410 
0.9252 
1.0812 
0.00875 
0.89998 
1.9 
0.2410 
0.9259 
1.0814 
0.0075 
0.9001 
1.9 
0.2412 
0.9251 
1.0812 
0.00625 
0.8981 
1.9 
0.2412 
0.9248 
1.0815 
h 
\(c_{min}\) 
\(t_{c_{min}}\) 
\(u_{c_{max_1}}\) 
\(t_{u_{c_{max_1}}}\) 
\(u_{c_{max_2}}\) 
\(t_{u_{c_{max_2}}}\) 
\(y_c(t=3)\) 
lower bound 
0.4647 
2.4004 
0.2502 
0.7281 
0.2393 
1.9844 
1.1249 
upper bound 
0.5869 
3.0000 
0.2524 
0.7332 
0.2440 
2.0705 
1.1380 
0.02 
0.4744 
2.995 
0.2464 
0.7529 
0.2207 
1.8319 
1.0810 
0.01 
0.4642 
2.995 
0.2493 
0.7559 
0.2315 
1.8522 
1.1012 
0.00875 
0.4629 
2.995 
0.2494 
0.7565 
0.2324 
1.8622 
1.1047 
0.0075 
0.4646 
2.995 
0.2495 
0.7574 
0.2333 
1.8739 
1.1111 
0.00625 
0.4616 
2.995 
0.2496 
0.7574 
0.2341 
1.8828 
1.1186 
[Hysing] S. Hysing, S. Turek, D. Kuzmin, N. Parolini, E. Burman, S. Ganesan, and L. Tobiska, Quantitative benchmark computations of twodimensional bubble dynamics, International Journal for Numerical Methods in Fluids, 2009.
[Chabannes] V. Chabannes, Vers la simulation numérique des écoulements sanguins, Équations aux dérivées partielles. PhD thesis, Université de Grenoble, 2013.
[Doyeux] V. Doyeux, Modélisation et simulation de systèmes multifluides, Application aux écoulements sanguins, PhD thesis, Université de Grenoble, 2014.
The previous section described the strategy we used to track the interface. We couple it now to the Navier Stokes equation solver described in \cite{chabannes11:_high}. In the current section, we present a 3D extension of the 2D benchmark introduced in \cite{Hysing2009} and realised using Feel++ in \cite{Doyeux2012}.
The benchmark objective is to simulate the rise of a 3D bubble in a Newtonian fluid. The equations solved are the incompressible Navier Stokes equations for the fluid and the advection for the level set:
where \(\rho\) is the density of the fluid, \(\nu\) its viscosity, and \(\mathbf{g} \approx (0, 0.98)^T\) is the gravity acceleration.
The computational domain is \(\Omega \times \rbrack0, T\rbrack \) where \(\Omega\) is a cylinder which has a radius \(R\) and a heigth \(H\) so that \(R=0.5\) and \(H=2\) and \(T=3\). We denote \(\Omega_1\) the domain outside the bubble \( \Omega_1= \{\mathbf{x}  \phi(\mathbf{x})>0 \} \), \(\Omega_2\) the domain inside the bubble \( \Omega_2 = \{\mathbf{x}  \phi(\mathbf{x})<0 \} stem:[ and stem:[\Gamma\) the interface \( \Gamma = \{\mathbf{x}  \phi(\mathbf{x})=0 \} \). On the lateral walls and on the bottom walls, noslip boundary conditions are imposed, i.e. \(\mathbf{u} = 0\) and \(\mathbf{t} \cdot (\nabla \mathbf{u} + (\nabla \mathbf{u})^T) \cdot \mathbf{n}=0\) where \(\mathbf{n}\) is the unit normal to the interface and \(\mathbf{t}\) the unit tangent. Neumann condition is imposed on the top wall i.e. \(\dfrac{\partial \mathbf{u}}{\partial \mathbf{n}}=\mathbf{0}\). The initial bubble is circular with a radius \(r_0 = 0.25\) and centered on the point \((0.5, 0.5, 0.)\). A surface tension force \(\mathbf{f}_{st}\) is applied on \(\Gamma\), it reads : \(\mathbf{f}_{st} = \int_{\Gamma} \sigma \kappa \mathbf{n} \simeq \int_{\Omega} \sigma \kappa \mathbf{n} \delta_{\varepsilon}(\phi)\) where \(\sigma\) stands for the surface tension between the twofluids and \(\kappa = \nabla \cdot (\frac{\nabla \mathbf{\phi}}{\nabla \phi})\) is the curvature of the interface. Note that the normal vector \(\mathbf{n}\) is defined here as \(\mathbf{n}=\frac{\nabla \phi}{\nabla \phi}\).
We denote with indices \(1\) and \(2\) the quantities relative to the fluid in respectively in \(\Omega_1\) and \(\Omega_2\). The parameters of the benchmark are \(\rho_1\), \(\rho_2\), \(\nu_1\), \(\nu_2\) and \(\sigma\) and we define two dimensionless numbers: first, the Reynolds number which is the ratio between inertial and viscous terms and is defined as : \(Re = \dfrac{\rho_1 \sqrt{\mathbf{g} (2r_0)^3}}{\nu_1}\); second, the E\"otv\"os number which represents the ratio between the gravity force and the surface tension \(E_0 = \dfrac{4 \rho_1 \mathbf{g} r_0^2}{\sigma}\). The table below reports the values of the parameters used for two different test cases proposed in~\cite{Hysing2009}.
Tests 
\(\rho_1\) 
\(\rho_2\) 
\(\nu_1\) 
\(\nu_2\) 
\(\sigma\) 
Re 
\(E_0\) 
Test 1 (ellipsoidal bubble) 
1000 
100 
10 
1 
24.5 
35 
10 
Test 2 (skirted bubble) 
1000 
1 
10 
0.1 
1.96 
35 
125 
The quantities measured in \cite{Hysing2009} are \(\mathbf{X_c}\) the center of mass of the bubble, \(\mathbf{U_c}\) its velocity and the circularity. For the 3D case we extend the circularity to the sphericity defined as the ratio between the surface of a sphere which has the same volume and the surface of the bubble which reads \(\Psi(t) = \dfrac{4\pi\left(\dfrac{3}{4\pi} \int_{\Omega_2} 1 \right)^{\frac{2}{3}}}{\int_{\Gamma} 1}\).
The simulations have been performed on the supercomputer SUPERMUC using 160 or 320 processors. The number of processors was chosen depending on the memory needed for the simulations. The table Numerical parameters used for the test 1 simulations: Mesh size, Number of processors, Time step, Average time per iteration, Total time of the simulation. summarize for the test 1 the different simulation properties and the table Mesh caracteristics: mesh size given, number of Tetrahedra, number of points, number of order 1 degrees of freedom, number of order 2 degrees of freedom give the carachteristics of each mesh.
h 
Number of processors 
\(\Delta t\) 
Time per iteration (s) 
Total Time (h) 
0.025 
360 
0.0125 
18.7 
1.25 
0.02 
360 
0.01 
36.1 
3.0 
0.0175 
180 
0.00875 
93.5 
8.9 
0.015 
180 
0.0075 
163.1 
18.4 
0.0125 
180 
0.00625 
339.7 
45.3 
h 
Tetrahedra 
Points 
Order 1 
Order 2 
0.025 
73010 
14846 
67770 
1522578 
0.02 
121919 
23291 
128969 
2928813 
0.0175 
154646 
30338 
187526 
4468382 
0.015 
217344 
41353 
292548 
6714918 
0.0125 
333527 
59597 
494484 
11416557 
The NavierStokes equations are linearized using the Newton’s method and we used a KSP method to solve the linear system. We use an Additive Schwarz Method for the preconditioning (GASM) and a LU method as a sub preconditionner. We run the simulations looking for solutions in finite element spaces spanned by Lagrange polynomials of order \((2,1,1)\) for respectively the velocity, the pressure and the level set.
Accordind to the 2D results we expect that the drop would became ellipsoid. The figure~\ref{subfig:elli_sh} shows the shape of the drop at the final time step. The contour is quite similar to the one we obtained in the two dimensions simulations. The shapes are similar and seems to converge when the mesh size is decreasing. The drop reaches a stationary circularity and its topology does not change. The velocity increases until it attains a constant value. Figure~\ref{subfig:elli_uc} shows the results we obtained with different mesh sizes.
Computational solid mechanics ( or CSM ) is a part of mechanics that studies solid deformations or motions under applied forces or other parameters.
The second Newton’s law allows us to define the fundamental equation of the solid mechanic, as follows
It’s define here into a Lagrangian frame.
Notation 
Quantity 
Unit 
\(\rho_s^*\) 
strucure density 
\(kg/m^3\) 
\(\boldsymbol{\eta}_s\) 
displacement 
\(m\) 
\(\boldsymbol{F}_s\) 
deformation gradient 

\(\boldsymbol{\Sigma}_s\) 
second PiolaKirchhoff tensor 
\(N/m^2\) 
\(f_s^t\) 
body force 
\(N/m^2\) 
The Lamé coefficients are deducing from the Young’s modulus \(E_s\) and the Poisson’s ratio \(\nu_s\) of the material we work on and can be express
We interest us here to a 1D reduced model, named generalized string.
The axisymmetric form, which will interest us here, is a tube of length \(L\) and radius \(R_0\). It is oriented following the axis \(z\) and \(r\) represent the radial axis. The reduced domain, named \(\Omega_s^*\) is represented by the dotted line. So the domain, where radial displacement \(\eta_s\) is calculated, is \(\Omega_s^*=\lbrack0,L\rbrack\).
We introduce then \(\Omega_s^{'*}\), where we also need to estimate a radial displacement as before. The unique variance is this displacement direction.
The mathematical problem associated to this reduce model can be describe as
where \(\eta_s\), the radial displacement that satisfy this equation, \(k\) is the Timoshenko’s correction factor, and \(\gamma_v\) is a viscoelasticity parameter. The material is defined by its density \(\rho_s^*\), its Young’s modulus \(E_s\), its Poisson’s ratio \(\nu_s\) and its shear modulus \(G_s\)
At the end, we take \( \eta_s=0\text{ on }\partial\Omega_s^*\) as a boundary condition, which will fixed the wall to its extremities.
inlude::FSI/README.adoc[]
ISO 10211:2007 sets out the specifications for a threedimensional and a twodimensional geometrical model of a thermal bridge for the numerical calculation of:
heat flows, in order to assess the overall heat loss from a building or part of it;
minimum surface temperatures, in order to assess the risk of surface condensation.
These specifications include the geometrical boundaries and subdivisions of the model, the thermal boundary conditions, and the thermal values and relationships to be used.
ISO 10211:2007 is based upon the following assumptions:
all physical properties are independent of temperature;
there are no heat sources within the building element.
ISO 10211:2007 can also be used for the derivation of linear and point thermal transmittances and of surface temperature factors. More information here.
Only the 2D specifications have been implemented.
$ mpirun np 4 /usr/local/bin/feelpp_thermodyn_2d configfile thermo2dCase2.cfg
inlude::HeatFluid/README.adoc[]
This section presents some mathematical optimization problems. The following examples source codes are located in "doc/manual/opt/".
:leveloffset:1
:leveloffset:+1
We are interested in this section in the conforming finite element approximation of the following problem:
\(\partial \Omega_D\), \(\partial \Omega_N\) and \(\partial \Omega_R\) can be empty sets. In the case \(\partial \Omega_D =\partial \Omega_R = \emptyset\), then the solution is known up to a constant. 
In the implementation presented later, \(\partial \Omega_D =\partial \Omega_N = \partial \Omega_R = \emptyset\), then we set Dirichlet boundary conditions all over the boundary. The problem then reads like a standard laplacian with inhomogeneous Dirichlet boundary conditions: 
We assume that \(f, h, l \in L^2(\Omega)\). The weak formulation of the problem then reads:
We now turn to the finite element approximation using Lagrange finite element. We assume \(\Omega\) to be a segment in 1D, a polygon in 2D or a polyhedron in 3D. We denote \(V_\delta \subset H^1(\Omega)\) an approximation space such that \(V_{g,\delta} \equiv P^k_{c,\delta}\cap H^1_{g,\Gamma_D}(\Omega)\).
The weak formulation reads:
from now on, we omit \(\delta\) to lighten the notations. Be careful that it appears both the geometrical and approximation level. 
In Feel++, \(V_{g,\delta}\) is not built but rather \(P^k_{c,\delta}\).
The Dirichlet boundary conditions can be treated using different techniques and we use from now on the elimination technique. 
We start with the mesh
auto mesh = loadMesh(_mesh=new Mesh<Simplex<FEELPP_DIM,1>>);
the keyword auto enables type inference, for more details see Wikipedia C++11 page.

Next the discretization setting by first defining Vh=Pch<k>(mesh)
\(\equiv P^k_{c,h}\), then elements of Vh
and expressions f
, n
and g
given by command line options or configuration file.
auto Vh = Pch<2>( mesh );
auto u = Vh>element("u");
auto mu = doption(_name="mu");
auto f = expr( soption(_name="functions.f"), "f" );
auto r_1 = expr( soption(_name="functions.a"), "a" ); // Robin left hand side expression
auto r_2 = expr( soption(_name="functions.b"), "b" ); // Robin right hand side expression
auto n = expr( soption(_name="functions.c"), "c" ); // Neumann expression
auto g = expr( soption(_name="functions.g"), "g" );
auto v = Vh>element( g, "g" );
at the following line

the variational formulation is implemented below, we define the
bilinear form a
and linear form l
and we set strongly the
Dirichlet boundary conditions with the keyword on
using
elimination. If we don’t find Dirichlet
, Neumann
or Robin
in the
list of physical markers in the mesh data structure then we impose
Dirichlet boundary conditions all over the boundary.
auto l = form1( _test=Vh );
l = integrate(_range=elements(mesh),
_expr=f*id(v));
l+=integrate(_range=markedfaces(mesh,"Robin"), _expr=r_2*id(v));
l+=integrate(_range=markedfaces(mesh,"Neumann"), _expr=n*id(v));
toc("l");
tic();
auto a = form2( _trial=Vh, _test=Vh);
a = integrate(_range=elements(mesh),
_expr=mu*gradt(u)*trans(grad(v)) );
a+=integrate(_range=markedfaces(mesh,"Robin"), _expr=r_1*idt(u)*id(v));
a+=on(_range=markedfaces(mesh,"Dirichlet"), _rhs=l, _element=u, _expr=g );
//! if no markers Robin Neumann or Dirichlet are present in the mesh then
//! impose Dirichlet boundary conditions over the entire boundary
if ( !mesh>hasAnyMarker({"Robin", "Neumann","Dirichlet"}) )
a+=on(_range=boundaryfaces(mesh), _rhs=l, _element=u, _expr=g );
toc("a");
tic();
//! solve the linear system, find u s.t. a(u,v)=l(v) for all v
if ( !boption( "nosolve" ) )
a.solve(_rhs=l,_solution=u);
toc("a.solve");
cout << "u_hg_L2=" << normL2(_range=elements(mesh), _expr=idv(u)g) << std::endl;
tic();
auto e = exporter( _mesh=mesh );
e>addRegions();
e>add( "u", u );
e>add( "g", v );
e>save();
toc("Exporter");
return 0;
}
We have the following correspondance:

next we solve the algebraic problem
//! solve the linear system, find u s.t. a(u,v)=l(v) for all v
if ( !boption( "nosolve" ) )
a.solve(_rhs=l,_solution=u);
next we compute the \(L^2\) norm of \(u_\deltag\), it could serve as an \(L^2\) error if \(g\) was manufactured to be the exact solution of the Laplacian problem.
cout << "u_hg_L2=" << normL2(_range=elements(mesh), _expr=idv(u)g) << std::endl;
and finally we export the results, by default it is in the ensight gold format and the files can be read with Paraview and Ensight. We save both \(u\) and \(g\).
auto e = exporter( _mesh=mesh );
e>addRegions();
e>add( "u", u );
e>add( "g", v );
e>save();
The Feel++ Implementation comes with testcases in 2D and 3D.
circle
is a 2D testcase where \(\Omega\) is a disk whose boundary
has been split such that \(\partial \Omega=\partial \Omega_D \cup
\partial \Omega_N \cup \partial \Omega_R\).
Here are some results we can observe after use the following command
cd Testcases/quickstart/circle
mpirun np 4 /usr/local/bin/feelpp_qs_laplacian_2d configfile circle.cfg
This give us some data such as solution of our problem or the mesh used in the application.
Solution \(u_\delta\) 
Mesh 
This testcase solves the Laplacian problem in \(\Omega\) an quadrangle or hexadra containing the letters of Feel++
After running the following command
cd Testcases/quickstart/feelpp2d
mpirun np 4 /usr/local/bin/feelpp_qs_laplacian_2d configfile feelpp2d.cfg
we obtain the result \(u_\delta\) and also the mesh
/images/Laplacian/TestCases/Feelpp2d/meshfeelpp2d.png[] 

Solution \(u_\delta\) 
Mesh 
We can launch this application with the current line
cd Testcases/quickstart/feelpp3d
mpirun np 4 /usr/local/bin/feelpp_qs_laplacian_3d configfile feelpp3d.cfg
When it’s finish, we can extract some informations
Solution \(u_\delta\) 
Mesh 
Having the possibility to determine where two regions meeting can be really useful in some scientific domains. That’s why the levelset method is born.
By using a scalar function \phi, define on all regions as the null value is obtained when it’s placed on an interface of two domains.
We denote \Omega_1 and \Omega_2 two domains with \Gamma the interface betwen them. Then \phi can be define as
\phi(\boldsymbol{x}) = \left\{ \begin{array}{cccc} \text{dist}(\boldsymbol{x}, \Gamma), & \boldsymbol{x}& \in &\Omega_1 \\ 0, & \boldsymbol{x}& \in &\Gamma\\ \text{dist}(\boldsymbol{x}, \Gamma), & \boldsymbol{x}& \in & \Omega_2 \end{array} \right.
with \text{dist}(\boldsymbol{x}, \Gamma ) = \underset{\boldsymbol{y} \; \in \; \Gamma}{\min}( \boldsymbol{x}  \boldsymbol{y} ).
This function \phi had also the following property \nabla\phi=1.
Moreover, the unit normal vector \boldsymbol{n} outgoing from the interface and the curvature \mathcal{\kappa} can be obtained from the levelset function.
\boldsymbol{n}=\frac{\nabla\phi}{\nabla\phi} \\ \mathcal{\kappa}=\nabla \cdot \boldsymbol{n}= \nabla \cdot \frac{\nabla\phi}{\nabla\phi}
Now we have exposed the levelset function, we need to define how the levelset will evolve and will spread into all the space. To do this, we use the following advection equation :
\partial_t\phi+\boldsymbol{u}\cdot\nabla\phi=0
where \boldsymbol{u} is an incompressible velocity field.
We define also the regularized Heaviside function H_\varepsilon(\phi) = \left\{ \begin{array}{cc} 0, & \phi \leq  \varepsilon,\\ \dfrac{1}{2} \left(1+\dfrac{\phi}{\varepsilon}+\dfrac{\sin\left(\dfrac{\pi \phi}{\varepsilon}\right)}{\pi}\right), & \varepsilon \leq \phi \leq \varepsilon, \\ 1, & \phi \geq \varepsilon \end{array} \right.
and the regularized Dirac function \delta_\varepsilon(\phi) = \left\{ \begin{array}{cc} 0, & \phi \leq  \varepsilon,\\ \displaystyle\dfrac{1}{2 \varepsilon} \left(1+\cos\left(\dfrac{\pi \phi}{\varepsilon}\right)\right), & \varepsilon \leq \phi \leq \varepsilon, \\ 0, & \phi \geq \varepsilon. \end{array} \right.
The first one gives a different value to each side of the interface ( here 0 in and 1 out ). The second one allow us to define quantities, with value different from 0 at the interface. A typical value of \varepsilon in literature is 1.5h where h is the mesh step size.
It should be noted that these functions allow us to determine respectively the volume and the surface of the interface by V^+_{\varepsilon} = \int_{\Omega} H_\varepsilon \\ S^{\Gamma}_{\varepsilon} = \int_{\Omega} \delta_\varepsilon
We describe the benchmark proposed by Zalesak.
Computer codes, used for the acquisition of results, are from Vincent Doyeux.
In order to test our interface propagation method, i.e. the levelset method \phi, we will study the rotation of a slotted disk into a square domain. The geometry can be represented as
We denote \Omega, the square domain [0,1]\times[0,1]. The center of the slotted disk is placed at (0.5,0.75).
To model the rotation, we will apply an angular velocity, centered in (0.5,0.5), as the disk is back to its initial position after t_f=628.
During this test, we observe three different errors to measure the quality of our method. With these values, two kinds of convergence will be studied : the time convergence, with different time step on an imposed grid and the space one, where the space discretization and the time step are linked by a relation. Several stabilization methods are used such as CIP ( Continuous Interior Penalty ) or SUPG ( StreamlineUpwing/PetrovGalerkin ).
We set a Neumann boundary condition on the boundary of the domain.
The velocity is imposed as \boldsymbol{u}=\left( \frac{\pi}{314} (50y),\frac{\pi}{314} (x50) \right)
Here is the velocity look in the square domain
The following table displays the various fixed and variables parameters of this testcase.
Name 
Description 
Nominal Value 
Units 
r 
disk radius 
0.15 
m 
l 
slot base 
0.05 
m 
h 
slot height 
0.25 
m 
t_f 
slotted disk rotation period 
628 
s 
We observe during this benchmark three different errors.
First at all, the mass error, define by
e_{\text{m}} = \frac{ \left m_{\phi_f}  m_{\phi_0}\right }{m_{\phi_0}} = \frac{ \left \displaystyle \int_{\Omega} \chi( \phi_f < 0 )  \displaystyle \int_{\Omega} \chi( \phi_0 < 0 ) \right }{ \displaystyle \int_{\Omega} \chi( \phi_0 < 0 )}
where \chi is the characteristic function. \chi( f( \phi ) ) = \left\{ \begin{array}{rcl} 1 & \text{ if } & f( \phi ) \neq 0 \\ 0 & \text{ if } & f( \phi ) = 0 \end{array} \right.
However, mass is gain and loose at different emplacements on the mesh, and at the same time, with the level set method.
Secondly, the sign change error e_{\text{sc}} = \sqrt{ \int_\Omega \left( (1H_0)  (1H_f) \right)^2 }
with H_0=H_\epsilon(\phi_0) and H_f=H_\epsilon(\phi_f), H_\epsilon the smoothed Heaviside function of thickness 2ε.
This error is better to define the interface displacement. In fact, we can determine where \phi_0\phi_f<0, in other words where the interface has moved.
Finally, we define the classical L^2 error at the interface, as e_{L^2} = \sqrt{ \frac{1}{\displaystyle \int_\Omega \chi( \delta(\phi_0) > 0 ) } \int_\Omega (\phi_0  \phi_f)^2 \chi( \delta(\phi_0) > 0 ) }.
For this case, we set a fixed grid with mesh step size h=0.04, and so 72314 degree of freedom on a \mathbb{P}^1.
Then, after the disk made one round, we measure the errors obtained from two different discretizations ( BDF2 and Euler ) and compared them.
We repeat this with several time step dt\in \{2.14, 1, 0.5, 0.25, 0.20\}.
Only one stabilization method is used : SUPG
We define the following relation, between time step and mesh step size : dt=C\frac{h}{U_{max}}
where C<1 constant and U_{max} the maximum velocity of \Omega.
From the definition of our velocity, U_{max} is reached at the farthest point from the center of \Omega. In this case, we have U_{max}=0.007, and we set C=0.8.
We use the BDF2 method for time discretization. As in time convergence, we wait one round of the disk to measure the errors and we repeat this test for these values of h: 0.32, 0.16, 0.08, 0.04.
We compare the results from different stabilization methods : CIP, SUPG, GLS ( GalerkinLeastSquares ) and SGS ( SubGrid Scale ).
dt 
e_{L^2} 
e_{sc} 
e_m 
2.14 
0.0348851 
0.202025 
0.202025 
1.00 
0.0187567 
0.147635 
0.147635 
0.5 
0.0098661 
0.10847 
0.10847 
0.25 
0.008791 
0.0782569 
0.0782569 
0.20 
0.00803373 
0.0670677 
0.0670677 
dt 
e_{L^2} 
e_{sc} 
e_m 
2.14 
0.0118025 
0.0906617 
0.0492775 
1.00 
0.00436957 
0.0445275 
0.0163494 
0.5 
0.00173637 
0.0216359 
0.0100621 
0.25 
0.001003 
0.0125971 
0.00354644 
0.20 
0.000949343 
0.0117449 
0.00317368 
stab 
h 
e_{L^2} 
e_{sc} 
e_m 
CIP 
0.32 
0.0074 
0.072 
0.00029 
0.16 
0.0046 
0.055 
0.00202 

0.08 
0.0025 
0.033 
0.00049 

0.04 
0.0023 
0.020 
0.00110 

SUPG 
0.32 
0.012 
0.065 
0.01632 
0.16 
0.008 
0.049 
0.07052 

0.08 
0.004 
0.030 
0.00073 

0.04 
0.001 
0.018 
0.00831 

GLS 
0.32 
0.013 
0.066 
0.02499 
0.16 
0.008 
0.051 
0.05180 

0.08 
0.004 
0.031 
0.00805 

0.04 
0.001 
0.019 
0.00672 

SGS 
0.32 
0.012 
0.065 
0.01103 
0.16 
0.008 
0.050 
0.07570 

0.08 
0.004 
0.030 
0.00084 

0.04 
0.001 
0.018 
0.00850 
Let’s begin with time convergence results. Tables shows us that sign change error is better to define the quality of the chosen scheme than the mass error. In fact, the loss of mass somewhere can be nullify by a gain of mass elsewhere. Sign change error shows half an order gain from Euler scheme to BDF2 one, as L^2 errors show us a gain of one order. For the slotted disk shape, BDF2 uses the two previous iterations to obtain the current result, while Euler only need the previous iteration. This explain why we can see an asymmetrical tendency in the first one.
As for space convergence, the different stabilization methods we used give us the same convergence rate equals to 0.6, with close error values, for the sign change error. For the L^2 error case, it’s not as evident as the previous one. Aside the CIP stabilization method with a 0.6 convergence rate, the others show us a convergence rate of 0.9.
[Zalesak] Steven T. Zalesak, Fully multidimensional fluxcorrected transport algorithms for fluids, Journal of Computational Physics, 1979.
[Doyeux] Vincent Doyeux, Modelisation et simulation de systemes multifluides. Application aux ecoulements sanguins., Physique Numérique [physics.compph], Université de Grenoble, 2014
:leveloffset:1
We are interested in this section in the conforming finite element approximation of the following problem:
\(\partial \Omega_D\), \(\partial \Omega_N\) and \(\partial \Omega_R\) can be empty sets. In the case \(\partial \Omega_D =\partial \Omega_R = \emptyset\), then the solution is known up to a constant. 
In the implementation presented later, \(\partial \Omega_D =\partial \Omega_N = \partial \Omega_R = \emptyset\), then we set Dirichlet boundary conditions all over the boundary. The problem then reads like a standard laplacian with inhomogeneous Dirichlet boundary conditions: 
We assume that \(f, h, l \in L^2(\Omega)\). The weak formulation of the problem then reads:
We now turn to the finite element approximation using Lagrange finite element. We assume \(\Omega\) to be a segment in 1D, a polygon in 2D or a polyhedron in 3D. We denote \(V_\delta \subset H^1(\Omega)\) an approximation space such that \(V_{g,\delta} \equiv P^k_{c,\delta}\cap H^1_{g,\Gamma_D}(\Omega)\).
The weak formulation reads:
from now on, we omit \(\delta\) to lighten the notations. Be careful that it appears both the geometrical and approximation level. 
In Feel++, \(V_{g,\delta}\) is not built but rather \(P^k_{c,\delta}\).
The Dirichlet boundary conditions can be treated using different techniques and we use from now on the elimination technique. 
We start with the mesh
auto mesh = loadMesh(_mesh=new Mesh<Simplex<FEELPP_DIM,1>>);
the keyword auto enables type inference, for more details see Wikipedia C++11 page.

Next the discretization setting by first defining Vh=Pch<k>(mesh)
\(\equiv P^k_{c,h}\), then elements of Vh
and expressions f
, n
and g
given by command line options or configuration file.
auto Vh = Pch<2>( mesh );
auto u = Vh>element("u");
auto mu = doption(_name="mu");
auto f = expr( soption(_name="functions.f"), "f" );
auto r_1 = expr( soption(_name="functions.a"), "a" ); // Robin left hand side expression
auto r_2 = expr( soption(_name="functions.b"), "b" ); // Robin right hand side expression
auto n = expr( soption(_name="functions.c"), "c" ); // Neumann expression
auto g = expr( soption(_name="functions.g"), "g" );
auto v = Vh>element( g, "g" );
at the following line

the variational formulation is implemented below, we define the
bilinear form a
and linear form l
and we set strongly the
Dirichlet boundary conditions with the keyword on
using
elimination. If we don’t find Dirichlet
, Neumann
or Robin
in the
list of physical markers in the mesh data structure then we impose
Dirichlet boundary conditions all over the boundary.
auto l = form1( _test=Vh );
l = integrate(_range=elements(mesh),
_expr=f*id(v));
l+=integrate(_range=markedfaces(mesh,"Robin"), _expr=r_2*id(v));
l+=integrate(_range=markedfaces(mesh,"Neumann"), _expr=n*id(v));
toc("l");
tic();
auto a = form2( _trial=Vh, _test=Vh);
a = integrate(_range=elements(mesh),
_expr=mu*gradt(u)*trans(grad(v)) );
a+=integrate(_range=markedfaces(mesh,"Robin"), _expr=r_1*idt(u)*id(v));
a+=on(_range=markedfaces(mesh,"Dirichlet"), _rhs=l, _element=u, _expr=g );
//! if no markers Robin Neumann or Dirichlet are present in the mesh then
//! impose Dirichlet boundary conditions over the entire boundary
if ( !mesh>hasAnyMarker({"Robin", "Neumann","Dirichlet"}) )
a+=on(_range=boundaryfaces(mesh), _rhs=l, _element=u, _expr=g );
toc("a");
tic();
//! solve the linear system, find u s.t. a(u,v)=l(v) for all v
if ( !boption( "nosolve" ) )
a.solve(_rhs=l,_solution=u);
toc("a.solve");
cout << "u_hg_L2=" << normL2(_range=elements(mesh), _expr=idv(u)g) << std::endl;
tic();
auto e = exporter( _mesh=mesh );
e>addRegions();
e>add( "u", u );
e>add( "g", v );
e>save();
toc("Exporter");
return 0;
}
We have the following correspondance:

next we solve the algebraic problem
//! solve the linear system, find u s.t. a(u,v)=l(v) for all v
if ( !boption( "nosolve" ) )
a.solve(_rhs=l,_solution=u);
next we compute the \(L^2\) norm of \(u_\deltag\), it could serve as an \(L^2\) error if \(g\) was manufactured to be the exact solution of the Laplacian problem.
cout << "u_hg_L2=" << normL2(_range=elements(mesh), _expr=idv(u)g) << std::endl;
and finally we export the results, by default it is in the ensight gold format and the files can be read with Paraview and Ensight. We save both \(u\) and \(g\).
auto e = exporter( _mesh=mesh );
e>addRegions();
e>add( "u", u );
e>add( "g", v );
e>save();
The Feel++ Implementation comes with testcases in 2D and 3D.
circle
is a 2D testcase where \(\Omega\) is a disk whose boundary
has been split such that \(\partial \Omega=\partial \Omega_D \cup
\partial \Omega_N \cup \partial \Omega_R\).
Here are some results we can observe after use the following command
cd Testcases/quickstart/circle
mpirun np 4 /usr/local/bin/feelpp_qs_laplacian_2d configfile circle.cfg
This give us some data such as solution of our problem or the mesh used in the application.
Solution \(u_\delta\) 
Mesh 
This testcase solves the Laplacian problem in \(\Omega\) an quadrangle or hexadra containing the letters of Feel++
After running the following command
cd Testcases/quickstart/feelpp2d
mpirun np 4 /usr/local/bin/feelpp_qs_laplacian_2d configfile feelpp2d.cfg
we obtain the result \(u_\delta\) and also the mesh
/images/Laplacian/TestCases/Feelpp2d/meshfeelpp2d.png[] 

Solution \(u_\delta\) 
Mesh 
We can launch this application with the current line
cd Testcases/quickstart/feelpp3d
mpirun np 4 /usr/local/bin/feelpp_qs_laplacian_3d configfile feelpp3d.cfg
When it’s finish, we can extract some informations
Solution \(u_\delta\) 
Mesh 
Having the possibility to determine where two regions meeting can be really useful in some scientific domains. That’s why the levelset method is born.
By using a scalar function \phi, define on all regions as the null value is obtained when it’s placed on an interface of two domains.
We denote \Omega_1 and \Omega_2 two domains with \Gamma the interface betwen them. Then \phi can be define as
\phi(\boldsymbol{x}) = \left\{ \begin{array}{cccc} \text{dist}(\boldsymbol{x}, \Gamma), & \boldsymbol{x}& \in &\Omega_1 \\ 0, & \boldsymbol{x}& \in &\Gamma\\ \text{dist}(\boldsymbol{x}, \Gamma), & \boldsymbol{x}& \in & \Omega_2 \end{array} \right.
with \text{dist}(\boldsymbol{x}, \Gamma ) = \underset{\boldsymbol{y} \; \in \; \Gamma}{\min}( \boldsymbol{x}  \boldsymbol{y} ).
This function \phi had also the following property \nabla\phi=1.
Moreover, the unit normal vector \boldsymbol{n} outgoing from the interface and the curvature \mathcal{\kappa} can be obtained from the levelset function.
\boldsymbol{n}=\frac{\nabla\phi}{\nabla\phi} \\ \mathcal{\kappa}=\nabla \cdot \boldsymbol{n}= \nabla \cdot \frac{\nabla\phi}{\nabla\phi}
Now we have exposed the levelset function, we need to define how the levelset will evolve and will spread into all the space. To do this, we use the following advection equation :
\partial_t\phi+\boldsymbol{u}\cdot\nabla\phi=0
where \boldsymbol{u} is an incompressible velocity field.
We define also the regularized Heaviside function H_\varepsilon(\phi) = \left\{ \begin{array}{cc} 0, & \phi \leq  \varepsilon,\\ \dfrac{1}{2} \left(1+\dfrac{\phi}{\varepsilon}+\dfrac{\sin\left(\dfrac{\pi \phi}{\varepsilon}\right)}{\pi}\right), & \varepsilon \leq \phi \leq \varepsilon, \\ 1, & \phi \geq \varepsilon \end{array} \right.
and the regularized Dirac function \delta_\varepsilon(\phi) = \left\{ \begin{array}{cc} 0, & \phi \leq  \varepsilon,\\ \displaystyle\dfrac{1}{2 \varepsilon} \left(1+\cos\left(\dfrac{\pi \phi}{\varepsilon}\right)\right), & \varepsilon \leq \phi \leq \varepsilon, \\ 0, & \phi \geq \varepsilon. \end{array} \right.
The first one gives a different value to each side of the interface ( here 0 in and 1 out ). The second one allow us to define quantities, with value different from 0 at the interface. A typical value of \varepsilon in literature is 1.5h where h is the mesh step size.
It should be noted that these functions allow us to determine respectively the volume and the surface of the interface by V^+_{\varepsilon} = \int_{\Omega} H_\varepsilon \\ S^{\Gamma}_{\varepsilon} = \int_{\Omega} \delta_\varepsilon
We describe the benchmark proposed by Zalesak.
Computer codes, used for the acquisition of results, are from Vincent Doyeux.
In order to test our interface propagation method, i.e. the levelset method \phi, we will study the rotation of a slotted disk into a square domain. The geometry can be represented as
We denote \Omega, the square domain [0,1]\times[0,1]. The center of the slotted disk is placed at (0.5,0.75).
To model the rotation, we will apply an angular velocity, centered in (0.5,0.5), as the disk is back to its initial position after t_f=628.
During this test, we observe three different errors to measure the quality of our method. With these values, two kinds of convergence will be studied : the time convergence, with different time step on an imposed grid and the space one, where the space discretization and the time step are linked by a relation. Several stabilization methods are used such as CIP ( Continuous Interior Penalty ) or SUPG ( StreamlineUpwing/PetrovGalerkin ).
We set a Neumann boundary condition on the boundary of the domain.
The velocity is imposed as \boldsymbol{u}=\left( \frac{\pi}{314} (50y),\frac{\pi}{314} (x50) \right)
Here is the velocity look in the square domain
The following table displays the various fixed and variables parameters of this testcase.
Name 
Description 
Nominal Value 
Units 
r 
disk radius 
0.15 
m 
l 
slot base 
0.05 
m 
h 
slot height 
0.25 
m 
t_f 
slotted disk rotation period 
628 
s 
We observe during this benchmark three different errors.
First at all, the mass error, define by
e_{\text{m}} = \frac{ \left m_{\phi_f}  m_{\phi_0}\right }{m_{\phi_0}} = \frac{ \left \displaystyle \int_{\Omega} \chi( \phi_f < 0 )  \displaystyle \int_{\Omega} \chi( \phi_0 < 0 ) \right }{ \displaystyle \int_{\Omega} \chi( \phi_0 < 0 )}
where \chi is the characteristic function. \chi( f( \phi ) ) = \left\{ \begin{array}{rcl} 1 & \text{ if } & f( \phi ) \neq 0 \\ 0 & \text{ if } & f( \phi ) = 0 \end{array} \right.
However, mass is gain and loose at different emplacements on the mesh, and at the same time, with the level set method.
Secondly, the sign change error e_{\text{sc}} = \sqrt{ \int_\Omega \left( (1H_0)  (1H_f) \right)^2 }
with H_0=H_\epsilon(\phi_0) and H_f=H_\epsilon(\phi_f), H_\epsilon the smoothed Heaviside function of thickness 2ε.
This error is better to define the interface displacement. In fact, we can determine where \phi_0\phi_f<0, in other words where the interface has moved.
Finally, we define the classical L^2 error at the interface, as e_{L^2} = \sqrt{ \frac{1}{\displaystyle \int_\Omega \chi( \delta(\phi_0) > 0 ) } \int_\Omega (\phi_0  \phi_f)^2 \chi( \delta(\phi_0) > 0 ) }.
For this case, we set a fixed grid with mesh step size h=0.04, and so 72314 degree of freedom on a \mathbb{P}^1.
Then, after the disk made one round, we measure the errors obtained from two different discretizations ( BDF2 and Euler ) and compared them.
We repeat this with several time step dt\in \{2.14, 1, 0.5, 0.25, 0.20\}.
Only one stabilization method is used : SUPG
We define the following relation, between time step and mesh step size : dt=C\frac{h}{U_{max}}
where C<1 constant and U_{max} the maximum velocity of \Omega.
From the definition of our velocity, U_{max} is reached at the farthest point from the center of \Omega. In this case, we have U_{max}=0.007, and we set C=0.8.
We use the BDF2 method for time discretization. As in time convergence, we wait one round of the disk to measure the errors and we repeat this test for these values of h: 0.32, 0.16, 0.08, 0.04.
We compare the results from different stabilization methods : CIP, SUPG, GLS ( GalerkinLeastSquares ) and SGS ( SubGrid Scale ).
dt 
e_{L^2} 
e_{sc} 
e_m 
2.14 
0.0348851 
0.202025 
0.202025 
1.00 
0.0187567 
0.147635 
0.147635 
0.5 
0.0098661 
0.10847 
0.10847 
0.25 
0.008791 
0.0782569 
0.0782569 
0.20 
0.00803373 
0.0670677 
0.0670677 
dt 
e_{L^2} 
e_{sc} 
e_m 
2.14 
0.0118025 
0.0906617 
0.0492775 
1.00 
0.00436957 
0.0445275 
0.0163494 
0.5 
0.00173637 
0.0216359 
0.0100621 
0.25 
0.001003 
0.0125971 
0.00354644 
0.20 
0.000949343 
0.0117449 
0.00317368 
stab 
h 
e_{L^2} 
e_{sc} 
e_m 
CIP 
0.32 
0.0074 
0.072 
0.00029 
0.16 
0.0046 
0.055 
0.00202 

0.08 
0.0025 
0.033 
0.00049 

0.04 
0.0023 
0.020 
0.00110 

SUPG 
0.32 
0.012 
0.065 
0.01632 
0.16 
0.008 
0.049 
0.07052 

0.08 
0.004 
0.030 
0.00073 

0.04 
0.001 
0.018 
0.00831 

GLS 
0.32 
0.013 
0.066 
0.02499 
0.16 
0.008 
0.051 
0.05180 

0.08 
0.004 
0.031 
0.00805 

0.04 
0.001 
0.019 
0.00672 

SGS 
0.32 
0.012 
0.065 
0.01103 
0.16 
0.008 
0.050 
0.07570 

0.08 
0.004 
0.030 
0.00084 

0.04 
0.001 
0.018 
0.00850 
Let’s begin with time convergence results. Tables shows us that sign change error is better to define the quality of the chosen scheme than the mass error. In fact, the loss of mass somewhere can be nullify by a gain of mass elsewhere. Sign change error shows half an order gain from Euler scheme to BDF2 one, as L^2 errors show us a gain of one order. For the slotted disk shape, BDF2 uses the two previous iterations to obtain the current result, while Euler only need the previous iteration. This explain why we can see an asymmetrical tendency in the first one.
As for space convergence, the different stabilization methods we used give us the same convergence rate equals to 0.6, with close error values, for the sign change error. For the L^2 error case, it’s not as evident as the previous one. Aside the CIP stabilization method with a 0.6 convergence rate, the others show us a convergence rate of 0.9.
[Zalesak] Steven T. Zalesak, Fully multidimensional fluxcorrected transport algorithms for fluids, Journal of Computational Physics, 1979.
[Doyeux] Vincent Doyeux, Modelisation et simulation de systemes multifluides. Application aux ecoulements sanguins., Physique Numérique [physics.compph], Université de Grenoble, 2014
We implement the benchmark proposed by Turek and Hron, on the behavior of drag and lift forces of a flow around an object composed by a pole and a bar, see Figure Geometry of the reduce model.
The software and the numerical results were initially obtained from Vincent Chabannes.
This benchmark is linked to the Turek Hron CSM and Turek Hron FSI benchmarks. 
We consider a 2D model representative of a laminar incompressible flow around an obstacle. The flow domain, named \(\Omega_f\), is contained into the rectangle \( \lbrack 0,2.5 \rbrack \times \lbrack 0,0.41 \rbrack \). It is characterised, in particular, by its dynamic viscosity \(\mu_f\) and by its density \(\rho_f\). In this case, the fluid material we used is glycerine.
In order to describe the flow, the incompressible NavierStokes model is chosen for this case, define by the conservation of momentum equation and the conservation of mass equation. At them, we add the material constitutive equation, that help us to define \(\boldsymbol{\sigma}_f\)
The goal of this benchmark is to study the behavior of lift forces \(F_L\) and drag forces \(F_D\), with three different fluid dynamics applied on the obstacle, i.e on \(\Gamma_{obst}\), we made rigid by setting specific structure parameters. To simulate these cases, different mean inflow velocities, and thus different Reynolds numbers, will be used.
We set
on \(\Gamma_{in}\), an inflow Dirichlet condition : \( \boldsymbol{u}_f=(v_{in},0) \)
on \(\Gamma_{wall}\) and \(\Gamma_{obst}\), a homogeneous Dirichlet condition : \( \boldsymbol{u}_f=\boldsymbol{0} \)
on \(\Gamma_{out}\), a Neumann condition : \( \boldsymbol{\sigma}_f\boldsymbol{ n }_f=\boldsymbol{0} \)
We use a parabolic velocity profile, in order to describe the flow inlet by \( \Gamma_{in} \), which can be express by
v_{cst} = 1.5 \bar{U} \frac{4}{0.1681} y \left(0.41y\right)
where \(\bar{U}\) is the mean inflow velocity.
However, we want to impose a progressive increase of this velocity profile. That’s why we define
v_{in} = \left\{ \begin{aligned} & v_{cst} \frac{1\cos\left( \frac{\pi}{2} t \right) }{2} \quad & \text{ if } t < 2 \\ & v_{cst} \quad & \text{ otherwise } \end{aligned} \right.
With t the time.
Moreover, in this case, there is no source term, so \(f_f\equiv 0\).
The following table displays the various fixed and variables parameters of this testcase.
Name  Description  Nominal Value  Units  

\(l\) 
elastic structure length 
\(0.35\) 
\(m\) 

\(h\) 
elastic structure height 
\(0.02\) 
\(m\) 

\(r\) 
cylinder radius 
\(0.05\) 
\(m\) 

\(C\) 
cylinder center coordinates 
\((0.2,0.2)\) 
\(m\) 

\(\nu_f\) 
kinematic viscosity 
\(1\times 10^{3}\) 
\(m^2/s\) 

\(\mu_f\) 
dynamic viscosity 
\(1\) 
\(kg/(m \times s)\) 

\(\rho_f\) 
density 
\(1000\) 
\(kg/m^3\) 

\(f_f\) 
source term 
0 
\(kg/(m^3 \times s)\) 

\(\bar{U}\) 
characteristic inflow velocity 

\(m/s\) 
As defined above, the goal of this benchmark is to measure the drag and lift forces, \(F_D\) and \(F_L\), to control the fluid solver behavior. They can be obtain from
(F_D,F_L)=\int_{\Gamma_{obst}}\boldsymbol{\sigma}_f \boldsymbol{ n }_f
where \(\boldsymbol{n}_f\) the outer unit normal vector from \(\partial \Omega_f\).
To realize these tests, we made the choice to used \(P_N\)\(P_{N1}\) TaylorHood finite elements, described by Chabannes, to discretize space. With the time discretization, we use BDF, for Backward Differentation Formulation, schemes at different orders \(q\).
Here are the different solvers ( linear and nonlinear ) used during results acquisition.
type 
gmres 
relative tolerance 
1e13 
max iteration 
1000 
reuse preconditioner 
false 
relative tolerance 
1e8 
steps tolerance 
1e8 
max iteration 
CFD1/CFD2 : 100  CFD3 : 50 
max iteration with reuse 
CFD1/CFD2 : 100  CFD3 : 50 
reuse jacobian 
false 
reuse jacobian rebuild at first Newton step 
true 
relative tolerance 
1e5 
max iteration 
1000 
max iteration with reuse 
CFD1/CFD2 : 100  CFD3 : 1000 
reuse preconditioner 
false 
reuse preconditioner rebuild at first Newton step 
false 
type 
lu 
package 
mumps 
The configuration files are in toolboxes/fluid/TurekHron
. The different cases are implemented in the corresponding .cfg
files e.g. cfd1.cfg
, cfd2.cfg
and cfd3.cfg
.
The command line in feelpptoolboxes docker reads
$ mpirun np 4 /usr/local/bin/feelpp_toolbox_fluid_2d configfile cfd1.cfg
The result files are then stored by default in
feel/applications/models/fluid/TurekHron/"case_name"/"velocity_space""pression_space""Geometric_order"/"processor_used"
For example, for CFD2 case executed on \(12\) processors, with a \(P_2\) velocity approximation space, a \(P_1\) pressure approximation space and a geometric order of \(1\), the path is
feel/toolboxes/fluid/TurekHron/cfd2/P2P1G1/np_12
Here are results from the different cases studied in this benchmark.
\(\mathbf{N_{geo}}\)  \(\mathbf{N_{elt}}\)  \(\mathbf{N_{dof}}\)  Drag  Lift 

Reference Turek and Hron 
14.29 
1.119 

1 
9874 
45533 (\(P_2/P_1\)) 
14.217 
1.116 
1 
38094 
173608 (\(P_2/P_1\)) 
14.253 
1.120 
1 
59586 
270867 (\(P_2/P_1\)) 
14.262 
1.119 
2 
7026 
78758 (\(P_3/P_2\)) 
14.263 
1.121 
2 
59650 
660518 (\(P_3/P_2\)) 
14.278 
1.119 
3 
7026 
146057 (\(P_4/P_3\)) 
14.270 
1.120 
3 
59650 
1228831 (\(P_4/P_3\)) 
14.280 
1.119 
All the files used for this case can be found in this rep [geo file, config file, json file]
\(\mathbf{N_{geo}}\)  \(\mathbf{N_{elt}}\)  \(\mathbf{N_{dof}}\)  Drag  Lift 

Reference Turek and Hron 
136.7 
10.53 

1 
7020 
32510 (\(P_2/P_1\)) 
135.33 
10.364 
1 
38094 
173608 (\(P_2/P_1\)) 
136.39 
10.537 
1 
59586 
270867 (\(P_2/P_1\)) 
136.49 
10.531 
2 
7026 
78758 (\(P_3/P_2\)) 
136.67 
10.548 
2 
59650 
660518 (\(P_3/P_2\)) 
136.66 
10.532 
3 
7026 
146057 (\(P_4/P_3\)) 
136.65 
10.539 
3 
59650 
1228831 (\(P_4/P_3\)) 
136.66 
10.533 
All the files used for this case can be found in this rep [geo file, config file, json file]
As CFD3 is timedependent ( from BDF use ), results will be expressed as
mean ± amplitude [frequency]
where
mean is the average of the min and max values at the last period of oscillations.
mean=\frac{1}{2}(max+min)
amplitude is the difference of the max and the min at the last oscillation.
amplitude=\frac{1}{2}(maxmin)
frequency can be obtain by Fourier analysis on periodic data and retrieve the lowest frequency or by the following formula, if we know the period time T.
frequency=\frac{1}{T}
\(\mathbf{\Delta t}\)  \(\mathbf{N_{geo}}\)  \(\mathbf{N_{elt}}\)  \(\mathbf{N_{dof}}\)  \(\mathbf{N_{bdf}}\)  Drag  Lift 

0.005 
Reference Turek and Hron 
439.45 ± 5.6183[4.3956] 
−11.893 ± 437.81[4.3956] 
0.01 
1 
8042 
37514 (\(P_2/P_1\)) 
2 
437.47 ± 5.3750[4.3457] 
9.786 ± 437.54[4.3457] 
2 
2334 
26706 (\(P_3/P_2\)) 
2 
439.27 ± 5.1620[4.3457] 
8.887 ± 429.06[4.3457] 

2 
7970 
89790 (\(P_2/P_2\)) 
2 
439.56 ± 5.2335[4.3457] 
11.719 ± 425.81[4.3457] 
0.005 
1 
3509 
39843\((P_3/P_2)\) 
2 
438.24 ± 5.5375[4.3945] 
11.024 ± 433.90[4.3945] 
1 
8042 
90582 (\(P_3/P_2\)) 
2 
439.25 ± 5.6130[4.3945] 
10.988 ± 437.70[4.3945] 

2 
2334 
26706 (\(P_3/P_2\)) 
2 
439.49 ± 5.5985[4.3945] 
10.534 ± 441.02[4.3945] 

2 
7970 
89790 (\(P_3/P_2\)) 
2 
439.71 ± 5.6410[4.3945] 
11.375 ± 438.37[4.3945] 

3 
3499 
73440 (\(P_4/P_3\)) 
3 
439.93 ± 5.8072[4.3945] 
14.511 ± 440.96[4.3945] 

4 
2314 
78168 (\(P_5/P_4\)) 
2 
439.66 ± 5.6412[4.3945] 
11.329 ± 438.93[4.3945] 
0.002 
2 
7942 
89482 (\(P_3/P_2)\) 
2 
439.81 ± 5.7370[4.3945] 
13.730 ± 439.30[4.3945] 
3 
2340 
49389 (\(P_4/P_3\)) 
2 
440.03 ± 5.7321[4.3945] 
13.250 ± 439.64[4.3945] 

3 
2334 
49266 (\(P_4/P_3\)) 
3 
440.06 ± 5.7773[4.3945] 
14.092 ± 440.07[4.3945] 
All the files used for this case can be found in this rep [geo file, config file, json file].
Add a section on geometrical order. 
The reference results, Turek and Hron, have been obtained with a time step \(\Delta t=0.05\). When we compare our results, with the same step and \(\mathrm{BDF}_2\), we observe that they are in accordance with the reference results.
With a larger \(\Delta t\), a discrepancy is observed, in particular for the drag force. It can also be seen at the same time step, with a higher order \(\mathrm{BDF}_n\) ( e.g. \(\mathrm{BDF}_3\) ). This suggests that the couple \(\Delta t=0.05\) and \(\mathrm{BDF}_2\) isn’t enough accurate.
[TurekHron] S. Turek and J. Hron, Proposal for numerical benchmarking of fluidstructure interaction between an elastic object and laminar incompressible flow, Lecture Notes in Computational Science and Engineering, 2006.
[Chabannes] Vincent Chabannes, Vers la simulation numérique des écoulements sanguins, Équations aux dérivées partielles [math.AP], Universitée de Grenoble, 2013.
Unresolved directive in /var/lib/buildkiteagent/builds/sd876601/feelpp/wwwdotfeelppdotorg/pages/man/04learning/CFD/README.adoc  include::MultiFluid/README.adoc[]
This benchmark has been proposed and realised by Hysing. It allows us to verify our level set code, our NavierStokes solver and how they couple together.
Computer codes, used for the acquisition of results, are from Vincent Doyeux, with the use of Chabannes's NavierStokes code.
We want to simulate the rising of a 2D bubble in a Newtonian fluid. The bubble, made of a specific fluid, is placed into a second one, with a higher density. Like this, the bubble, due to its lowest density and by the action of gravity, rises.
The equations used to define fluid bubble rising in an other are the NavierStokes for the fluid and the advection one for the level set method. As for the bubble rising, two forces are defined :
The gravity force : \(\boldsymbol{f}_g=\rho_\phi\boldsymbol{g}\)
The surface tension force : \(\boldsymbol{f}_{st}=\int_\Gamma\sigma\kappa\boldsymbol{ n } \)
We denote \( \Omega\times\rbrack0,3\rbrack \) the interest domain with \( \Omega=(0,1)\times(0,2) \). \(\Omega\) can be decompose into \(\Omega_1\), the domain outside the bubble and \(\Omega_2\) the domain inside the bubble and \(\Gamma\) the interface between these two.
Durig this benchmark, we will study two different cases : the first one with a ellipsoidal bubble and the second one with a squirted bubble.
On the lateral walls, we imposed slip conditions
On the horizontal walls, no slip conditions are imposed : \(\boldsymbol{u}=0 \)
In order to let the bubble rise, its density must be inferior to the density of the exterior fluid, so \(\rho_1>\rho_2\)
The following table displays the various fixed and variables parameters of this testcase.
Name  Description  Nominal Value  Units 

\(\boldsymbol{g}\) 
gravity acceleration 
\((0,0.98)\) 
\(m/s^2\) 
\(l\) 
length domain 
\(1\) 
\(m\) 
\(h\) 
height domain 
\(2\) 
\(m\) 
\(r\) 
bubble radius 
\(0.25\) 
\(m\) 
\(B_c\) 
bubble center 
\((0.5,0.5)\) 
\(m\) 
In the first place, the quantities we want to measure are \(X_c\) the position of the center of the mass of the bubble, the velocity of the center of the mass \(U_c\) and the circularity \(c\), define as the ratio between the perimeter of a circle and the perimeter of the bubble. They can be expressed by
After that, we interest us to quantitative points for comparison as \(c_{min}\), the minimum of the circularity and \(t_{c_{min}}\), the time needed to obtain this minimum, \(u_{c_{max}}\) and \(t_{u_{c_{max}}}\) the maximum velocity and the time to attain it, or \(y_c(t=3)\) the position of the bubble at the final time step. We add a second maximum velocity \(u_{max}\) and \(u_{c_{max_2}}\) and its time \(t_{u_{c_{max_2}}}\) for the second test on the squirted bubble.
This is the parameters associate to the two cases, which interest us here.
Case 
\(\rho_1\) 
\(\rho_2\) 
\(\mu_1\) 
\(\mu_2\) 
\(\sigma\) 
Re 
\(E_0\) 
ellipsoidal bubble (1) 
1000 
100 
10 
1 
24.5 
35 
10 
squirted bubble (2) 
1000 
1 
10 
0.1 
1.96 
35 
125 
We describe the different quantitative results for the two studied cases.
h 
\(c_{min}\) 
\(t_{c_{min}}\) 
\(u_{c_{max}}\) 
\(t_{u_{c_{max}}}\) 
\(y_c(t=3)\) 
lower bound 
0.9011 
1.8750 
0.2417 
0.9213 
1.0799 
upper bound 
0.9013 
1.9041 
0.2421 
0.9313 
1.0817 
0.02 
0.8981 
1.925 
0.2400 
0.9280 
1.0787 
0.01 
0.8999 
1.9 
0.2410 
0.9252 
1.0812 
0.00875 
0.89998 
1.9 
0.2410 
0.9259 
1.0814 
0.0075 
0.9001 
1.9 
0.2412 
0.9251 
1.0812 
0.00625 
0.8981 
1.9 
0.2412 
0.9248 
1.0815 
h 
\(c_{min}\) 
\(t_{c_{min}}\) 
\(u_{c_{max_1}}\) 
\(t_{u_{c_{max_1}}}\) 
\(u_{c_{max_2}}\) 
\(t_{u_{c_{max_2}}}\) 
\(y_c(t=3)\) 
lower bound 
0.4647 
2.4004 
0.2502 
0.7281 
0.2393 
1.9844 
1.1249 
upper bound 
0.5869 
3.0000 
0.2524 
0.7332 
0.2440 
2.0705 
1.1380 
0.02 
0.4744 
2.995 
0.2464 
0.7529 
0.2207 
1.8319 
1.0810 
0.01 
0.4642 
2.995 
0.2493 
0.7559 
0.2315 
1.8522 
1.1012 
0.00875 
0.4629 
2.995 
0.2494 
0.7565 
0.2324 
1.8622 
1.1047 
0.0075 
0.4646 
2.995 
0.2495 
0.7574 
0.2333 
1.8739 
1.1111 
0.00625 
0.4616 
2.995 
0.2496 
0.7574 
0.2341 
1.8828 
1.1186 
[Hysing] S. Hysing, S. Turek, D. Kuzmin, N. Parolini, E. Burman, S. Ganesan, and L. Tobiska, Quantitative benchmark computations of twodimensional bubble dynamics, International Journal for Numerical Methods in Fluids, 2009.
[Chabannes] V. Chabannes, Vers la simulation numérique des écoulements sanguins, Équations aux dérivées partielles. PhD thesis, Université de Grenoble, 2013.
[Doyeux] V. Doyeux, Modélisation et simulation de systèmes multifluides, Application aux écoulements sanguins, PhD thesis, Université de Grenoble, 2014.
The previous section described the strategy we used to track the interface. We couple it now to the Navier Stokes equation solver described in \cite{chabannes11:_high}. In the current section, we present a 3D extension of the 2D benchmark introduced in \cite{Hysing2009} and realised using Feel++ in \cite{Doyeux2012}.
The benchmark objective is to simulate the rise of a 3D bubble in a Newtonian fluid. The equations solved are the incompressible Navier Stokes equations for the fluid and the advection for the level set:
where \(\rho\) is the density of the fluid, \(\nu\) its viscosity, and \(\mathbf{g} \approx (0, 0.98)^T\) is the gravity acceleration.
The computational domain is \(\Omega \times \rbrack0, T\rbrack \) where \(\Omega\) is a cylinder which has a radius \(R\) and a heigth \(H\) so that \(R=0.5\) and \(H=2\) and \(T=3\). We denote \(\Omega_1\) the domain outside the bubble \( \Omega_1= \{\mathbf{x}  \phi(\mathbf{x})>0 \} \), \(\Omega_2\) the domain inside the bubble \( \Omega_2 = \{\mathbf{x}  \phi(\mathbf{x})<0 \} stem:[ and stem:[\Gamma\) the interface \( \Gamma = \{\mathbf{x}  \phi(\mathbf{x})=0 \} \). On the lateral walls and on the bottom walls, noslip boundary conditions are imposed, i.e. \(\mathbf{u} = 0\) and \(\mathbf{t} \cdot (\nabla \mathbf{u} + (\nabla \mathbf{u})^T) \cdot \mathbf{n}=0\) where \(\mathbf{n}\) is the unit normal to the interface and \(\mathbf{t}\) the unit tangent. Neumann condition is imposed on the top wall i.e. \(\dfrac{\partial \mathbf{u}}{\partial \mathbf{n}}=\mathbf{0}\). The initial bubble is circular with a radius \(r_0 = 0.25\) and centered on the point \((0.5, 0.5, 0.)\). A surface tension force \(\mathbf{f}_{st}\) is applied on \(\Gamma\), it reads : \(\mathbf{f}_{st} = \int_{\Gamma} \sigma \kappa \mathbf{n} \simeq \int_{\Omega} \sigma \kappa \mathbf{n} \delta_{\varepsilon}(\phi)\) where \(\sigma\) stands for the surface tension between the twofluids and \(\kappa = \nabla \cdot (\frac{\nabla \mathbf{\phi}}{\nabla \phi})\) is the curvature of the interface. Note that the normal vector \(\mathbf{n}\) is defined here as \(\mathbf{n}=\frac{\nabla \phi}{\nabla \phi}\).
We denote with indices \(1\) and \(2\) the quantities relative to the fluid in respectively in \(\Omega_1\) and \(\Omega_2\). The parameters of the benchmark are \(\rho_1\), \(\rho_2\), \(\nu_1\), \(\nu_2\) and \(\sigma\) and we define two dimensionless numbers: first, the Reynolds number which is the ratio between inertial and viscous terms and is defined as : \(Re = \dfrac{\rho_1 \sqrt{\mathbf{g} (2r_0)^3}}{\nu_1}\); second, the E\"otv\"os number which represents the ratio between the gravity force and the surface tension \(E_0 = \dfrac{4 \rho_1 \mathbf{g} r_0^2}{\sigma}\). The table below reports the values of the parameters used for two different test cases proposed in~\cite{Hysing2009}.
Tests 
\(\rho_1\) 
\(\rho_2\) 
\(\nu_1\) 
\(\nu_2\) 
\(\sigma\) 
Re 
\(E_0\) 
Test 1 (ellipsoidal bubble) 
1000 
100 
10 
1 
24.5 
35 
10 
Test 2 (skirted bubble) 
1000 
1 
10 
0.1 
1.96 
35 
125 
The quantities measured in \cite{Hysing2009} are \(\mathbf{X_c}\) the center of mass of the bubble, \(\mathbf{U_c}\) its velocity and the circularity. For the 3D case we extend the circularity to the sphericity defined as the ratio between the surface of a sphere which has the same volume and the surface of the bubble which reads \(\Psi(t) = \dfrac{4\pi\left(\dfrac{3}{4\pi} \int_{\Omega_2} 1 \right)^{\frac{2}{3}}}{\int_{\Gamma} 1}\).
The simulations have been performed on the supercomputer SUPERMUC using 160 or 320 processors. The number of processors was chosen depending on the memory needed for the simulations. The table Numerical parameters used for the test 1 simulations: Mesh size, Number of processors, Time step, Average time per iteration, Total time of the simulation. summarize for the test 1 the different simulation properties and the table Mesh caracteristics: mesh size given, number of Tetrahedra, number of points, number of order 1 degrees of freedom, number of order 2 degrees of freedom give the carachteristics of each mesh.
h 
Number of processors 
\(\Delta t\) 
Time per iteration (s) 
Total Time (h) 
0.025 
360 
0.0125 
18.7 
1.25 
0.02 
360 
0.01 
36.1 
3.0 
0.0175 
180 
0.00875 
93.5 
8.9 
0.015 
180 
0.0075 
163.1 
18.4 
0.0125 
180 
0.00625 
339.7 
45.3 
h 
Tetrahedra 
Points 
Order 1 
Order 2 
0.025 
73010 
14846 
67770 
1522578 
0.02 
121919 
23291 
128969 
2928813 
0.0175 
154646 
30338 
187526 
4468382 
0.015 
217344 
41353 
292548 
6714918 
0.0125 
333527 
59597 
494484 
11416557 
The NavierStokes equations are linearized using the Newton’s method and we used a KSP method to solve the linear system. We use an Additive Schwarz Method for the preconditioning (GASM) and a LU method as a sub preconditionner. We run the simulations looking for solutions in finite element spaces spanned by Lagrange polynomials of order \((2,1,1)\) for respectively the velocity, the pressure and the level set.
Accordind to the 2D results we expect that the drop would became ellipsoid. The figure~\ref{subfig:elli_sh} shows the shape of the drop at the final time step. The contour is quite similar to the one we obtained in the two dimensions simulations. The shapes are similar and seems to converge when the mesh size is decreasing. The drop reaches a stationary circularity and its topology does not change. The velocity increases until it attains a constant value. Figure~\ref{subfig:elli_uc} shows the results we obtained with different mesh sizes.
We implement the benchmark proposed by Turek and Hron, on the behavior of drag and lift forces of a flow around an object composed by a pole and a bar, see Figure Geometry of the reduce model.
The software and the numerical results were initially obtained from Vincent Chabannes.
This benchmark is linked to the Turek Hron CSM and Turek Hron FSI benchmarks. 
We consider a 2D model representative of a laminar incompressible flow around an obstacle. The flow domain, named \(\Omega_f\), is contained into the rectangle \( \lbrack 0,2.5 \rbrack \times \lbrack 0,0.41 \rbrack \). It is characterised, in particular, by its dynamic viscosity \(\mu_f\) and by its density \(\rho_f\). In this case, the fluid material we used is glycerine.
In order to describe the flow, the incompressible NavierStokes model is chosen for this case, define by the conservation of momentum equation and the conservation of mass equation. At them, we add the material constitutive equation, that help us to define \(\boldsymbol{\sigma}_f\)
The goal of this benchmark is to study the behavior of lift forces \(F_L\) and drag forces \(F_D\), with three different fluid dynamics applied on the obstacle, i.e on \(\Gamma_{obst}\), we made rigid by setting specific structure parameters. To simulate these cases, different mean inflow velocities, and thus different Reynolds numbers, will be used.
We set
on \(\Gamma_{in}\), an inflow Dirichlet condition : \( \boldsymbol{u}_f=(v_{in},0) \)
on \(\Gamma_{wall}\) and \(\Gamma_{obst}\), a homogeneous Dirichlet condition : \( \boldsymbol{u}_f=\boldsymbol{0} \)
on \(\Gamma_{out}\), a Neumann condition : \( \boldsymbol{\sigma}_f\boldsymbol{ n }_f=\boldsymbol{0} \)
We use a parabolic velocity profile, in order to describe the flow inlet by \( \Gamma_{in} \), which can be express by
v_{cst} = 1.5 \bar{U} \frac{4}{0.1681} y \left(0.41y\right)
where \(\bar{U}\) is the mean inflow velocity.
However, we want to impose a progressive increase of this velocity profile. That’s why we define
v_{in} = \left\{ \begin{aligned} & v_{cst} \frac{1\cos\left( \frac{\pi}{2} t \right) }{2} \quad & \text{ if } t < 2 \\ & v_{cst} \quad & \text{ otherwise } \end{aligned} \right.
With t the time.
Moreover, in this case, there is no source term, so \(f_f\equiv 0\).
The following table displays the various fixed and variables parameters of this testcase.
Name  Description  Nominal Value  Units  

\(l\) 
elastic structure length 
\(0.35\) 
\(m\) 

\(h\) 
elastic structure height 
\(0.02\) 
\(m\) 

\(r\) 
cylinder radius 
\(0.05\) 
\(m\) 

\(C\) 
cylinder center coordinates 
\((0.2,0.2)\) 
\(m\) 

\(\nu_f\) 
kinematic viscosity 
\(1\times 10^{3}\) 
\(m^2/s\) 

\(\mu_f\) 
dynamic viscosity 
\(1\) 
\(kg/(m \times s)\) 

\(\rho_f\) 
density 
\(1000\) 
\(kg/m^3\) 

\(f_f\) 
source term 
0 
\(kg/(m^3 \times s)\) 

\(\bar{U}\) 
characteristic inflow velocity 

\(m/s\) 
As defined above, the goal of this benchmark is to measure the drag and lift forces, \(F_D\) and \(F_L\), to control the fluid solver behavior. They can be obtain from
(F_D,F_L)=\int_{\Gamma_{obst}}\boldsymbol{\sigma}_f \boldsymbol{ n }_f
where \(\boldsymbol{n}_f\) the outer unit normal vector from \(\partial \Omega_f\).
To realize these tests, we made the choice to used \(P_N\)\(P_{N1}\) TaylorHood finite elements, described by Chabannes, to discretize space. With the time discretization, we use BDF, for Backward Differentation Formulation, schemes at different orders \(q\).
Here are the different solvers ( linear and nonlinear ) used during results acquisition.
type 
gmres 
relative tolerance 
1e13 
max iteration 
1000 
reuse preconditioner 
false 
relative tolerance 
1e8 
steps tolerance 
1e8 
max iteration 
CFD1/CFD2 : 100  CFD3 : 50 
max iteration with reuse 
CFD1/CFD2 : 100  CFD3 : 50 
reuse jacobian 
false 
reuse jacobian rebuild at first Newton step 
true 
relative tolerance 
1e5 
max iteration 
1000 
max iteration with reuse 
CFD1/CFD2 : 100  CFD3 : 1000 
reuse preconditioner 
false 
reuse preconditioner rebuild at first Newton step 
false 
type 
lu 
package 
mumps 
The configuration files are in toolboxes/fluid/TurekHron
. The different cases are implemented in the corresponding .cfg
files e.g. cfd1.cfg
, cfd2.cfg
and cfd3.cfg
.
The command line in feelpptoolboxes docker reads
$ mpirun np 4 /usr/local/bin/feelpp_toolbox_fluid_2d configfile cfd1.cfg
The result files are then stored by default in
feel/applications/models/fluid/TurekHron/"case_name"/"velocity_space""pression_space""Geometric_order"/"processor_used"
For example, for CFD2 case executed on \(12\) processors, with a \(P_2\) velocity approximation space, a \(P_1\) pressure approximation space and a geometric order of \(1\), the path is
feel/toolboxes/fluid/TurekHron/cfd2/P2P1G1/np_12
Here are results from the different cases studied in this benchmark.
\(\mathbf{N_{geo}}\)  \(\mathbf{N_{elt}}\)  \(\mathbf{N_{dof}}\)  Drag  Lift 

Reference Turek and Hron 
14.29 
1.119 

1 
9874 
45533 (\(P_2/P_1\)) 
14.217 
1.116 
1 
38094 
173608 (\(P_2/P_1\)) 
14.253 
1.120 
1 
59586 
270867 (\(P_2/P_1\)) 
14.262 
1.119 
2 
7026 
78758 (\(P_3/P_2\)) 
14.263 
1.121 
2 
59650 
660518 (\(P_3/P_2\)) 
14.278 
1.119 
3 
7026 
146057 (\(P_4/P_3\)) 
14.270 
1.120 
3 
59650 
1228831 (\(P_4/P_3\)) 
14.280 
1.119 
All the files used for this case can be found in this rep [geo file, config file, json file]
\(\mathbf{N_{geo}}\)  \(\mathbf{N_{elt}}\)  \(\mathbf{N_{dof}}\)  Drag  Lift 

Reference Turek and Hron 
136.7 
10.53 

1 
7020 
32510 (\(P_2/P_1\)) 
135.33 
10.364 
1 
38094 
173608 (\(P_2/P_1\)) 
136.39 
10.537 
1 
59586 
270867 (\(P_2/P_1\)) 
136.49 
10.531 
2 
7026 
78758 (\(P_3/P_2\)) 
136.67 
10.548 
2 
59650 
660518 (\(P_3/P_2\)) 
136.66 
10.532 
3 
7026 
146057 (\(P_4/P_3\)) 
136.65 
10.539 
3 
59650 
1228831 (\(P_4/P_3\)) 
136.66 
10.533 
All the files used for this case can be found in this rep [geo file, config file, json file]
As CFD3 is timedependent ( from BDF use ), results will be expressed as
mean ± amplitude [frequency]
where
mean is the average of the min and max values at the last period of oscillations.
mean=\frac{1}{2}(max+min)
amplitude is the difference of the max and the min at the last oscillation.
amplitude=\frac{1}{2}(maxmin)
frequency can be obtain by Fourier analysis on periodic data and retrieve the lowest frequency or by the following formula, if we know the period time T.
frequency=\frac{1}{T}
\(\mathbf{\Delta t}\)  \(\mathbf{N_{geo}}\)  \(\mathbf{N_{elt}}\)  \(\mathbf{N_{dof}}\)  \(\mathbf{N_{bdf}}\)  Drag  Lift 

0.005 
Reference Turek and Hron 
439.45 ± 5.6183[4.3956] 
−11.893 ± 437.81[4.3956] 
0.01 
1 
8042 
37514 (\(P_2/P_1\)) 
2 
437.47 ± 5.3750[4.3457] 
9.786 ± 437.54[4.3457] 
2 
2334 
26706 (\(P_3/P_2\)) 
2 
439.27 ± 5.1620[4.3457] 
8.887 ± 429.06[4.3457] 

2 
7970 
89790 (\(P_2/P_2\)) 
2 
439.56 ± 5.2335[4.3457] 
11.719 ± 425.81[4.3457] 
0.005 
1 
3509 
39843\((P_3/P_2)\) 
2 
438.24 ± 5.5375[4.3945] 
11.024 ± 433.90[4.3945] 
1 
8042 
90582 (\(P_3/P_2\)) 
2 
439.25 ± 5.6130[4.3945] 
10.988 ± 437.70[4.3945] 

2 
2334 
26706 (\(P_3/P_2\)) 
2 
439.49 ± 5.5985[4.3945] 
10.534 ± 441.02[4.3945] 

2 
7970 
89790 (\(P_3/P_2\)) 
2 
439.71 ± 5.6410[4.3945] 
11.375 ± 438.37[4.3945] 

3 
3499 
73440 (\(P_4/P_3\)) 
3 
439.93 ± 5.8072[4.3945] 
14.511 ± 440.96[4.3945] 

4 
2314 
78168 (\(P_5/P_4\)) 
2 
439.66 ± 5.6412[4.3945] 
11.329 ± 438.93[4.3945] 
0.002 
2 
7942 
89482 (\(P_3/P_2)\) 
2 
439.81 ± 5.7370[4.3945] 
13.730 ± 439.30[4.3945] 
3 
2340 
49389 (\(P_4/P_3\)) 
2 
440.03 ± 5.7321[4.3945] 
13.250 ± 439.64[4.3945] 

3 
2334 
49266 (\(P_4/P_3\)) 
3 
440.06 ± 5.7773[4.3945] 
14.092 ± 440.07[4.3945] 
All the files used for this case can be found in this rep [geo file, config file, json file].
Add a section on geometrical order. 
The reference results, Turek and Hron, have been obtained with a time step \(\Delta t=0.05\). When we compare our results, with the same step and \(\mathrm{BDF}_2\), we observe that they are in accordance with the reference results.
With a larger \(\Delta t\), a discrepancy is observed, in particular for the drag force. It can also be seen at the same time step, with a higher order \(\mathrm{BDF}_n\) ( e.g. \(\mathrm{BDF}_3\) ). This suggests that the couple \(\Delta t=0.05\) and \(\mathrm{BDF}_2\) isn’t enough accurate.
[TurekHron] S. Turek and J. Hron, Proposal for numerical benchmarking of fluidstructure interaction between an elastic object and laminar incompressible flow, Lecture Notes in Computational Science and Engineering, 2006.
[Chabannes] Vincent Chabannes, Vers la simulation numérique des écoulements sanguins, Équations aux dérivées partielles [math.AP], Universitée de Grenoble, 2013.
Unresolved directive in modeling.adoc  include::../man/04learning/CFD/MultiFluid/README.adoc[]
This benchmark has been proposed and realised by Hysing. It allows us to verify our level set code, our NavierStokes solver and how they couple together.
Computer codes, used for the acquisition of results, are from Vincent Doyeux, with the use of Chabannes's NavierStokes code.
We want to simulate the rising of a 2D bubble in a Newtonian fluid. The bubble, made of a specific fluid, is placed into a second one, with a higher density. Like this, the bubble, due to its lowest density and by the action of gravity, rises.
The equations used to define fluid bubble rising in an other are the NavierStokes for the fluid and the advection one for the level set method. As for the bubble rising, two forces are defined :
The gravity force : \(\boldsymbol{f}_g=\rho_\phi\boldsymbol{g}\)
The surface tension force : \(\boldsymbol{f}_{st}=\int_\Gamma\sigma\kappa\boldsymbol{ n } \)
We denote \( \Omega\times\rbrack0,3\rbrack \) the interest domain with \( \Omega=(0,1)\times(0,2) \). \(\Omega\) can be decompose into \(\Omega_1\), the domain outside the bubble and \(\Omega_2\) the domain inside the bubble and \(\Gamma\) the interface between these two.
Durig this benchmark, we will study two different cases : the first one with a ellipsoidal bubble and the second one with a squirted bubble.
On the lateral walls, we imposed slip conditions
On the horizontal walls, no slip conditions are imposed : \(\boldsymbol{u}=0 \)
In order to let the bubble rise, its density must be inferior to the density of the exterior fluid, so \(\rho_1>\rho_2\)
The following table displays the various fixed and variables parameters of this testcase.
Name  Description  Nominal Value  Units 

\(\boldsymbol{g}\) 
gravity acceleration 
\((0,0.98)\) 
\(m/s^2\) 
\(l\) 
length domain 
\(1\) 
\(m\) 
\(h\) 
height domain 
\(2\) 
\(m\) 
\(r\) 
bubble radius 
\(0.25\) 
\(m\) 
\(B_c\) 
bubble center 
\((0.5,0.5)\) 
\(m\) 
In the first place, the quantities we want to measure are \(X_c\) the position of the center of the mass of the bubble, the velocity of the center of the mass \(U_c\) and the circularity \(c\), define as the ratio between the perimeter of a circle and the perimeter of the bubble. They can be expressed by
After that, we interest us to quantitative points for comparison as \(c_{min}\), the minimum of the circularity and \(t_{c_{min}}\), the time needed to obtain this minimum, \(u_{c_{max}}\) and \(t_{u_{c_{max}}}\) the maximum velocity and the time to attain it, or \(y_c(t=3)\) the position of the bubble at the final time step. We add a second maximum velocity \(u_{max}\) and \(u_{c_{max_2}}\) and its time \(t_{u_{c_{max_2}}}\) for the second test on the squirted bubble.
This is the parameters associate to the two cases, which interest us here.
Case 
\(\rho_1\) 
\(\rho_2\) 
\(\mu_1\) 
\(\mu_2\) 
\(\sigma\) 
Re 
\(E_0\) 
ellipsoidal bubble (1) 
1000 
100 
10 
1 
24.5 
35 
10 
squirted bubble (2) 
1000 
1 
10 
0.1 
1.96 
35 
125 
We describe the different quantitative results for the two studied cases.
h 
\(c_{min}\) 
\(t_{c_{min}}\) 
\(u_{c_{max}}\) 
\(t_{u_{c_{max}}}\) 
\(y_c(t=3)\) 
lower bound 
0.9011 
1.8750 
0.2417 
0.9213 
1.0799 
upper bound 
0.9013 
1.9041 
0.2421 
0.9313 
1.0817 
0.02 
0.8981 
1.925 
0.2400 
0.9280 
1.0787 
0.01 
0.8999 
1.9 
0.2410 
0.9252 
1.0812 
0.00875 
0.89998 
1.9 
0.2410 
0.9259 
1.0814 
0.0075 
0.9001 
1.9 
0.2412 
0.9251 
1.0812 
0.00625 
0.8981 
1.9 
0.2412 
0.9248 
1.0815 
h 
\(c_{min}\) 
\(t_{c_{min}}\) 
\(u_{c_{max_1}}\) 
\(t_{u_{c_{max_1}}}\) 
\(u_{c_{max_2}}\) 
\(t_{u_{c_{max_2}}}\) 
\(y_c(t=3)\) 
lower bound 
0.4647 
2.4004 
0.2502 
0.7281 
0.2393 
1.9844 
1.1249 
upper bound 
0.5869 
3.0000 
0.2524 
0.7332 
0.2440 
2.0705 
1.1380 
0.02 
0.4744 
2.995 
0.2464 
0.7529 
0.2207 
1.8319 
1.0810 
0.01 
0.4642 
2.995 
0.2493 
0.7559 
0.2315 
1.8522 
1.1012 
0.00875 
0.4629 
2.995 
0.2494 
0.7565 
0.2324 
1.8622 
1.1047 
0.0075 
0.4646 
2.995 
0.2495 
0.7574 
0.2333 
1.8739 
1.1111 
0.00625 
0.4616 
2.995 
0.2496 
0.7574 
0.2341 
1.8828 
1.1186 
[Hysing] S. Hysing, S. Turek, D. Kuzmin, N. Parolini, E. Burman, S. Ganesan, and L. Tobiska, Quantitative benchmark computations of twodimensional bubble dynamics, International Journal for Numerical Methods in Fluids, 2009.
[Chabannes] V. Chabannes, Vers la simulation numérique des écoulements sanguins, Équations aux dérivées partielles. PhD thesis, Université de Grenoble, 2013.
[Doyeux] V. Doyeux, Modélisation et simulation de systèmes multifluides, Application aux écoulements sanguins, PhD thesis, Université de Grenoble, 2014.
The previous section described the strategy we used to track the interface. We couple it now to the Navier Stokes equation solver described in \cite{chabannes11:_high}. In the current section, we present a 3D extension of the 2D benchmark introduced in \cite{Hysing2009} and realised using Feel++ in \cite{Doyeux2012}.
The benchmark objective is to simulate the rise of a 3D bubble in a Newtonian fluid. The equations solved are the incompressible Navier Stokes equations for the fluid and the advection for the level set:
where \(\rho\) is the density of the fluid, \(\nu\) its viscosity, and \(\mathbf{g} \approx (0, 0.98)^T\) is the gravity acceleration.
The computational domain is \(\Omega \times \rbrack0, T\rbrack \) where \(\Omega\) is a cylinder which has a radius \(R\) and a heigth \(H\) so that \(R=0.5\) and \(H=2\) and \(T=3\). We denote \(\Omega_1\) the domain outside the bubble \( \Omega_1= \{\mathbf{x}  \phi(\mathbf{x})>0 \} \), \(\Omega_2\) the domain inside the bubble \( \Omega_2 = \{\mathbf{x}  \phi(\mathbf{x})<0 \} stem:[ and stem:[\Gamma\) the interface \( \Gamma = \{\mathbf{x}  \phi(\mathbf{x})=0 \} \). On the lateral walls and on the bottom walls, noslip boundary conditions are imposed, i.e. \(\mathbf{u} = 0\) and \(\mathbf{t} \cdot (\nabla \mathbf{u} + (\nabla \mathbf{u})^T) \cdot \mathbf{n}=0\) where \(\mathbf{n}\) is the unit normal to the interface and \(\mathbf{t}\) the unit tangent. Neumann condition is imposed on the top wall i.e. \(\dfrac{\partial \mathbf{u}}{\partial \mathbf{n}}=\mathbf{0}\). The initial bubble is circular with a radius \(r_0 = 0.25\) and centered on the point \((0.5, 0.5, 0.)\). A surface tension force \(\mathbf{f}_{st}\) is applied on \(\Gamma\), it reads : \(\mathbf{f}_{st} = \int_{\Gamma} \sigma \kappa \mathbf{n} \simeq \int_{\Omega} \sigma \kappa \mathbf{n} \delta_{\varepsilon}(\phi)\) where \(\sigma\) stands for the surface tension between the twofluids and \(\kappa = \nabla \cdot (\frac{\nabla \mathbf{\phi}}{\nabla \phi})\) is the curvature of the interface. Note that the normal vector \(\mathbf{n}\) is defined here as \(\mathbf{n}=\frac{\nabla \phi}{\nabla \phi}\).
We denote with indices \(1\) and \(2\) the quantities relative to the fluid in respectively in \(\Omega_1\) and \(\Omega_2\). The parameters of the benchmark are \(\rho_1\), \(\rho_2\), \(\nu_1\), \(\nu_2\) and \(\sigma\) and we define two dimensionless numbers: first, the Reynolds number which is the ratio between inertial and viscous terms and is defined as : \(Re = \dfrac{\rho_1 \sqrt{\mathbf{g} (2r_0)^3}}{\nu_1}\); second, the E\"otv\"os number which represents the ratio between the gravity force and the surface tension \(E_0 = \dfrac{4 \rho_1 \mathbf{g} r_0^2}{\sigma}\). The table below reports the values of the parameters used for two different test cases proposed in~\cite{Hysing2009}.
Tests 
\(\rho_1\) 
\(\rho_2\) 
\(\nu_1\) 
\(\nu_2\) 
\(\sigma\) 
Re 
\(E_0\) 
Test 1 (ellipsoidal bubble) 
1000 
100 
10 
1 
24.5 
35 
10 
Test 2 (skirted bubble) 
1000 
1 
10 
0.1 
1.96 
35 
125 
The quantities measured in \cite{Hysing2009} are \(\mathbf{X_c}\) the center of mass of the bubble, \(\mathbf{U_c}\) its velocity and the circularity. For the 3D case we extend the circularity to the sphericity defined as the ratio between the surface of a sphere which has the same volume and the surface of the bubble which reads \(\Psi(t) = \dfrac{4\pi\left(\dfrac{3}{4\pi} \int_{\Omega_2} 1 \right)^{\frac{2}{3}}}{\int_{\Gamma} 1}\).
The simulations have been performed on the supercomputer SUPERMUC using 160 or 320 processors. The number of processors was chosen depending on the memory needed for the simulations. The table Numerical parameters used for the test 1 simulations: Mesh size, Number of processors, Time step, Average time per iteration, Total time of the simulation. summarize for the test 1 the different simulation properties and the table Mesh caracteristics: mesh size given, number of Tetrahedra, number of points, number of order 1 degrees of freedom, number of order 2 degrees of freedom give the carachteristics of each mesh.
h 
Number of processors 
\(\Delta t\) 
Time per iteration (s) 
Total Time (h) 
0.025 
360 
0.0125 
18.7 
1.25 
0.02 
360 
0.01 
36.1 
3.0 
0.0175 
180 
0.00875 
93.5 
8.9 
0.015 
180 
0.0075 
163.1 
18.4 
0.0125 
180 
0.00625 
339.7 
45.3 
h 
Tetrahedra 
Points 
Order 1 
Order 2 
0.025 
73010 
14846 
67770 
1522578 
0.02 
121919 
23291 
128969 
2928813 
0.0175 
154646 
30338 
187526 
4468382 
0.015 
217344 
41353 
292548 
6714918 
0.0125 
333527 
59597 
494484 
11416557 
The NavierStokes equations are linearized using the Newton’s method and we used a KSP method to solve the linear system. We use an Additive Schwarz Method for the preconditioning (GASM) and a LU method as a sub preconditionner. We run the simulations looking for solutions in finite element spaces spanned by Lagrange polynomials of order \((2,1,1)\) for respectively the velocity, the pressure and the level set.
Accordind to the 2D results we expect that the drop would became ellipsoid. The figure~\ref{subfig:elli_sh} shows the shape of the drop at the final time step. The contour is quite similar to the one we obtained in the two dimensions simulations. The shapes are similar and seems to converge when the mesh size is decreasing. The drop reaches a stationary circularity and its topology does not change. The velocity increases until it attains a constant value. Figure~\ref{subfig:elli_uc} shows the results we obtained with different mesh sizes.
Computational solid mechanics ( or CSM ) is a part of mechanics that studies solid deformations or motions under applied forces or other parameters.
The second Newton’s law allows us to define the fundamental equation of the solid mechanic, as follows
It’s define here into a Lagrangian frame.
Notation 
Quantity 
Unit 
\(\rho_s^*\) 
strucure density 
\(kg/m^3\) 
\(\boldsymbol{\eta}_s\) 
displacement 
\(m\) 
\(\boldsymbol{F}_s\) 
deformation gradient 

\(\boldsymbol{\Sigma}_s\) 
second PiolaKirchhoff tensor 
\(N/m^2\) 
\(f_s^t\) 
body force 
\(N/m^2\) 
The Lamé coefficients are deducing from the Young’s modulus \(E_s\) and the Poisson’s ratio \(\nu_s\) of the material we work on and can be express
We interest us here to a 1D reduced model, named generalized string.
The axisymmetric form, which will interest us here, is a tube of length \(L\) and radius \(R_0\). It is oriented following the axis \(z\) and \(r\) represent the radial axis. The reduced domain, named \(\Omega_s^*\) is represented by the dotted line. So the domain, where radial displacement \(\eta_s\) is calculated, is \(\Omega_s^*=\lbrack0,L\rbrack\).
We introduce then \(\Omega_s^{'*}\), where we also need to estimate a radial displacement as before. The unique variance is this displacement direction.
The mathematical problem associated to this reduce model can be describe as
where \(\eta_s\), the radial displacement that satisfy this equation, \(k\) is the Timoshenko’s correction factor, and \(\gamma_v\) is a viscoelasticity parameter. The material is defined by its density \(\rho_s^*\), its Young’s modulus \(E_s\), its Poisson’s ratio \(\nu_s\) and its shear modulus \(G_s\)
At the end, we take \( \eta_s=0\text{ on }\partial\Omega_s^*\) as a boundary condition, which will fixed the wall to its extremities.
In order to validate our fluidstructure interaction solver, we realize here a benchmark on the deformation of an elastic structure, initially proposed by Turek and Hron.
Computer codes, used for the acquisition of results, are from Vincent Chabannes.
This benchmark is linked to the Turek Hron CFD and Turek Hron FSI benchmarks. 
We consider a solid structure, composed of a hyperelastic bar, bound to one of his extremity \(\Gamma_F^*\) to a rigid stationary circular structure. We denote \(\Gamma_{L}^*=\partial\Omega_s^* \backslash \Gamma_F^*\) the other boundaries. The geometry can be represented as follows
\(\Omega_s^*\) represent the initial domain, before any deformations. We denote \(\Omega^t_s\) the domain obtained during the deformations application, at the time t.
By the Newton’s second law, we can describe the fundamental equation of the solid mechanic in a Lagrangian frame. Furthermore, we will suppose that the hyperelastic material follows a compressible SaintVenantKirchhoff model. The Lamé coefficients, used in this model, are deducing from the Young’s modulus \(E_s\) and the Poisson’s ratio \(\nu_s\) of the material.
We will observe, during this simulation, the displacement of \(A\), on the \(x\) and \(y\) axis, when the elastic structure is subjected to its own weight, and compare our results to the reference ones given Turek and Hron.
In the first two cases, CSM1 and CSM2, we want to determine the steady state condition. To find it, a quasistatic algorithm is used, which increase at each step the gravity parameter.
For the third cases, CSM3, we realise a transient simulation, where we will observe the comportment of \(A\) subjected to its weight during a given time span.
We set
on \(\Gamma_{F}^*\), a condition that imposes this boundary to be fixed : \(\boldsymbol{\eta}_s=0\)
on \(\Gamma_{L}^*\), a condition that lets these boundaries be free from constraints : \((\boldsymbol{F}_s\boldsymbol{\Sigma}_s)\boldsymbol{ n }^*_s=\boldsymbol{0}\)
where \(\boldsymbol{n}_s^*\) is the outer unit normal vector from \(\partial \Omega_s^*\).
The source term \(\boldsymbol{f}_s\), chosen in order to set in motion the elastic structure, is define by
where \(g\) is a gravitational constant.
The reference document ( Turek and Hron ) don’t specify the time interval used to obtain their results. In our case, it’s chosen as \(\lbrack0,10\rbrack\).
The following table displays the various fixed and variables parameters of this testcase.
Name  Description  Nominal Value  Units 

\(g\) 
gravitational constant 
2 
\(m / s^2\) 
\(l\) 
elastic structure length 
\(0.35\) 
\(m\) 
\(h\) 
elastic structure height 
\(0.02\) 
\(m\) 
\(r\) 
cylinder radius 
\(0.05\) 
\(m\) 
\(C\) 
cylinder center coordinates 
\((0.2,0.2)\) 
\(m\) 
\(A\) 
control point coordinates 
\((0.2,0.2)\) 
\(m\) 
\(B\) 
point coordinates 
\((0.15,0.2)\) 
\(m\) 
\(E_s\) 
Young’s modulus 
\(1.4\times 10^6\) 
\(kg / ms^2\) 
\(\nu_s\) 
Poisson’s ratio 
\(0.4\) 
dimensionless 
\(\rho^*_s\) 
density 
\(1000\) 
\(kg/ m^3\) 
As for solvers we used, Newton’s method is chosen for the nonlinear part and a direct method based on LU decomposition is selected for the linear part.
As described before, we have
We search the displacement \(\boldsymbol{\eta}_s\), on \(\Omega_s^*\), which will satisfy this equation.
In particular, the displacement of the point \(A\) is the one that interests us.
To realize these tests, we made the choice to used Finite Elements Method, with Lagrangian elements of order \(N\) to discretize space.
Newmarkbeta method, presented into Chabannes papers, is the one we used for the time discretization. We used this method with \(\gamma=0.5\) and \(\beta=0.25\).
Here are the different solvers ( linear and nonlinear ) used during results acquisition.
type 
gmres 
relative tolerance 
1e13 
max iteration 
1000 
reuse preconditioner 
true 
relative tolerance 
1e8 
steps tolerance 
1e8 
max iteration 
500 
max iteration with reuse 
10 
reuse jacobian 
false 
reuse jacobian rebuild at first Newton step 
true 
relative tolerance 
1e5 
max iteration 
500 
reuse preconditioner 
CSM1/CSM2 : false  CSM3 : true 
reuse preconditioner rebuild at first Newton step 
true 
type 
lu 
package 
mumps 
To realize the acquisition of the benchmark results, code files contained and using the Feel++ library will be used. Here is a quick look to the different location of them.
First at all, the main code can be found in
feelpp/applications/models/solid
The configuration file for the CSM3 case, the only one we work on, is located at
feelpp/applications/models/solid/TurekHron
The result files are then stored by default in
feel/applications/models/solid/TurekHron/csm3/"OrderDisp""Geometric_order"/"processor_used"
Like that, for the CSM3 case executed on 8 processors, with a \(P_1\) displacement approximation space and a geometric order of 1, the path is
feel/applications/models/solid/TurekHron/csm3/P1G1/np_8
At least, to retrieve results that interested us for the benchmark and to generate graphs, we use a Python script located at
feelppbenchmarkingbook/CFD/TurekHron/postprocess_cfd.py
\(N_{elt}\) 
\(N_{dof}\) 
\(x\) displacement \(\lbrack\times 10^{3}\rbrack\) 
\(y\) displacement \(\lbrack\times 10^{3}\rbrack\) 
Reference TurekHron 
7.187 
66.10 

1061 
4620 (\(P_2\)) 
7.039 
65.32 
4199 
17540 (\(P_2\)) 
7.047 
65.37 
16495 
67464 (\(P_2\)) 
7.048 
65.37 
1061 
10112 (\(P_3\)) 
7.046 
65.36 
1906 
17900 (\(P_3\)) 
7.049 
65.37 
1061 
17726 (\(P_4\)) 
7.048 
65.37 
All the files used for this case can be found in this rep [ geo file, config file, json file ]
\(N_{elt}\) 
\(N_{dof}\) 
\(x\) displacement \(\lbrack\times 10^{3}\rbrack\) 
\(y\) displacement \(\lbrack\times 10^{3}\rbrack\) 
Reference TurekHron 
0.4690 
16.97 

1061 
4620 (\(P_2\)) 
0.459 
16.77 
4201 
17548 (\(P_2\)) 
0.459 
16.77 
16495 
67464 (\(P_2\)) 
0.459 
16.78 
1061 
10112 (\(P_3\)) 
0.4594 
16.78 
16475 
150500 (\(P_3\)) 
0.460 
16.78 
1061 
17726 (\(P_4\)) 
0.460 
16.78 
All the files used for this case can be found in this rep [geo file, config file, json file].
The results of the CSM3 benchmark are detailed below.
\(\Delta t\) 
\(N_{elt}\) 
\(N_{dof}\) 
\(x\) displacement \(\lbrack\times 10^{3}\rbrack\) 
\(y\) displacement \(\lbrack\times 10^{3}\rbrack\) 
/ 
Reference TurekHron 
−14.305 ± 14.305 [1.0995] 
−63.607 ± 65.160 [1.0995] 
0.02 
4199 
17536(\(P_2\)) 
14.585 ± 14.590 [1.0953] 
63.981 ± 65.521 [1.0930] 
4199 
38900(\(P_3\)) 
14.589 ± 14.594 [1.0953] 
63.998 ± 65.522 [1.0930] 

1043 
17536(\(P_4\)) 
14.591 ± 14.596 [1.0953] 
64.009 ± 65.521 [1.0930] 

4199 
68662(\(P_4\)) 
14.590 ± 14.595 [1.0953] 
64.003 ± 65.522 [1.0930] 
0.01 
4199 
17536(\(P_2\)) 
14.636 ± 14.640 [1.0969] 
63.937 ± 65.761 [1.0945] 
4199 
38900(\(P_3\)) 
14.642 ± 14.646 [1.0969] 
63.949 ± 65.771 [1.0945] 

1043 
17536(\(P_4\)) 
14.645 ± 14.649 [1.0961] 
63.955 ± 65.778 [1.0945] 

4199 
68662(\(P_4\)) 
14.627 ± 14.629 [1.0947] 
63.916 ± 65.739 [1.0947] 
0.005 
4199 
17536(\(P_2\)) 
14.645 ± 14.645 [1.0966] 
64.083 ± 65.521 [1.0951] 
4199 
38900(\(P_3\)) 
14.649 ± 14.650 [1.0966] 
64.092 ± 65.637 [1.0951] 

1043 
17536(\(P_4\)) 
14.652 ± 14.653 [1.0966] 
64.099 ± 65.645 [1.0951] 

4199 
68662(\(P_4\)) 
14.650 ± 14.651 [1.0966] 
64.095 ± 65.640 [1.0951] 
\text{Figure 2: x and y displacements}
All the files used for this case can be found in this rep [ geo file, config file, json file ]
To obtain these data, we used several different mesh refinements and different polynomial approximations for the displacement on the time interval \(\lbrack 0,10 \rbrack\).
Our results are pretty similar to those from Turek and Hron, despite a small gap. This gap can be caused by the difference between our time interval and the one used for the reference acquisitions.
[TurekHron] S. Turek and J. Hron, Proposal for numerical benchmarking of fluidstructure interaction between an elastic object and laminar incompressible flow, Lecture Notes in Computational Science and Engineering, 2006.
[Chabannes] Vincent Chabannes, Vers la simulation numérique des écoulements sanguins, Équations aux dérivées partielles [math.AP], Université de Grenoble, 2013.
An analytical solution of the elasticity equation exists in an infinitely long solenoid. Such a geometry has the advantage to be axisymetrical, we can first expresse the solution with cylindrical coordinates.
The analytical solution comes from the electromagnetism equations, indeed this case of a soleinoid crossed by an electric current can model the behaviour of a resistive magnet. The volumic forces \(\mathbf{f}\) of the equilibrium equation are consequently dependent on the current density \(\mathbf{J}\) and the induced magnetic field \(\mathbf{B}\), which gives :
We will use the following notations:
We consider here that the current distribution in the soleinoid is uniform. That means that \(J_{\theta}\) is constant, and \(J_r = J_z = 0\). The volumic forces \(\mathbf{J} \times \mathbf{B}\) becomes :
The revwriting of the equilibrium equation in cylindrical coordinates gives :
The axisymetrical properties of this geometries means that the displacement is invariant with respect to \(\theta\).
Furthermore, the soleinoid we consider has the particularity to be infinitely long, so there is no displacement along \(z\) axis.
We can consequently get rid of all derivatives \(\frac{\partial \cdot}{\partial \theta}\) and \(\frac{\partial \cdot}{\partial z}\).
Finally, we shall note that components \(\sigma_{\theta r}\) and \(\sigma_{zr}\) of the stress tensor \(\bar{\bar{\sigma}}\) are expressed from Hooke’s law only from the components \(v\) and \(w\) of the displacement vector \(\mathbf{u}\), which nullify the two last equations.
Thus, the equilibrium equation is reduced to:
We need to express this equation in terms of the displacement \(\mathbf{u}\), This can be done using Hooke’s law which links the stress tensor to the tensor of small deformation by:
where \(\mu\) and \(\lambda\) are the Lamé coefficients, and the tensor of small deformation is given in cylindrical coordinates by:
Then, using the last two definitions and the properties of the solenoid (axisymmetric and infinitely long), we can rewrite the equilibrium equation as:
We want to find an analytical solution of the form :
where \(C_1\) and \(C_2\) are constants, and \(u_p(r)\) a particular solution of the equilibrium equation in cylindrical coordinates.
From Ampére’s theorem and considering that the soleinoid is axisymetrical and infinitely long, we deduce that \(B_r = 0\), and \(B_z\) depends only on \(r\), such that :
with \(r_1\) the internal radius of the soleinoid.
For a uniform distribution of current in the solenoid (\(j_{\theta}\) constant), we deduce that \(B_z\) can be expressed as :
Replacing \(b_z\) with his expression in the equilibrium equation, this gives :
where \(r_2\) is the external radius, \(\alpha = \frac{r_2}{r_1}\) and \(\Delta b_z = B_z(r_1)  B_z(r_2)\).
A particular solution \(u_p(r)\) for this equation is given by:
The constants \(C_1\) and \(C_2\) are set by the boundary conditions, we consider here that there is no surface forces. That gives \(\bar{\bar{\sigma}}\cdot\mathbf{n} = 0\) on internal and external radius, that is \(\sigma_{rr}(r_1)=\sigma_{rr}(r_2)=0\).
Using the definition of \(u_{cyl}\) in
we can solve the system to find the constants:
The final step is to translate this analytical solution \(u_{cyl}(r)\) into cartesian coordinates to obtain the analytical cartesian displacement \(\mathbf{u}_{cart}\):
We use a solenoïd of thickness one with \(r_1=1\) and \(r_2=2\) and with a length sufficiently important (\(l=10\,r_2\)) so that the influence of the top and of the bottom of the geometry, which are supposed not to exist, is close to zero.
The boundary conditions taken into account for the analytical solution have to be reproduced for the simulation. That means null pressure forces on internal and external radius, and displacement set to zero (Dirichlet) on the top and on the bottom to keep only the radial component.
We set:
\(\mathbf{u} = 0\) on \(\Gamma_{top}\cup\Gamma_{bottom}\)
\(\bar{\bar{\sigma}}\cdot \mathbf{n} = 0\) on \(\Gamma_{int}\cup\Gamma_{ext}\)
\(\mathbf{f} = \begin{pmatrix} \frac{x}{\sqrt{x^2+y^2}}5000(10+20(\sqrt{x^2+y^2}1))\\ \frac{y}{\sqrt{x^2+y^2}}5000(10+20(\sqrt{x^2+y^2}1))\\ 0 \end{pmatrix}\) in \(\Omega\)
We use the following parameters:
Name  Value 

\(E\) 
\(2.1e^6\) 
\(\nu\) 
\(0.33\) 
\(\mathbf{f}\) 
\(\begin{pmatrix} \frac{x}{\sqrt{x^2+y^2}}5000(10+20(\sqrt{x^2+y^2}1))\\ \frac{y}{\sqrt{x^2+y^2}}5000(10+20(\sqrt{x^2+y^2}1))\\ 0 \end{pmatrix}\) 
We compare the radial component of the displacement on the segment \(z=l/2\), \(y=0\) and \(x\in \lbrack 1,2\rbrack \).
Here are the analytical and the computed \(x\) component of the displacement. This has been obtain with a characteristic size of \(0.1\) and \(646 233\) dofs.
We can see that the errors grows as we approach the external radius. But the max of the error is \(5e^{4}\) and it converges as the characteristic size decreases.
This benchmark is extract from the Abaqus Benchmarks Manual.
We focus on the LE1 benchmarks in particular.
The geometry is given here by :
We set:
\(u_y = 0\) on DC
\(u_x = 0\) on AB
\(\bar{\bar{\varepsilon}}\cdot\mathbf{n}=1e^7\) on BC.
We have the following parameters:
Name  Value 

\(E\) 
\(210\, GPa\) 
\(\nu\) 
\(0.3\) 
\(\rho\) 
\(7800\, kg/m^2\) 
We want to compare the value of \(\sigma_{yy}\) at the point D. The reference value is \(92.7\, MPa\).
The value of \(\sigma_{yy}\) at the point D is \(94.09\, MPa\) for \(32 000\) dofs, which is \(1.49%\) higher than the target.
One possibility to get a more accurate output is to use a mixed formulation, where the stress tensor would also be an unknown.
This benchmark is extract from the Abaqus Benchmarks Manual.
We focus on the LE10 benchmarks in particular.
The geometry is given here by :
where the thickness is \(0.6\).
In addition, we define the point E which is the midpoint of CC' and E' the midpoint of BB'.
We set:
\(u_y = 0\) on DCD’C'
\(u_x = 0\) on ABA’B'
\(u_x = u_y = 0\) on BCB’C'
\(\bar{\bar{\varepsilon}}\cdot\mathbf{n}=1e^6\) on the top surface.
We have the following parameters:
Name  Value 

\(E\) 
\(210\, GPa\) 
\(\nu\) 
\(0.3\) 
\(\rho\) 
\(7800\, kg/m^2\) 
We want to compare the value of \(\sigma_{yy}\) at the point D. The reference value is \(5.38\, MPa\).
The value of \(\sigma_{yy}\) at the point D is \(5.53\, MPa\) for \(300 000\) dofs, which is \(2.78%\) higher than the target.
One possibility to get a more accurate output is to use a mixed formulation, where the stress tensor would also be an unknown.
ISO 10211:2007 sets out the specifications for a threedimensional and a twodimensional geometrical model of a thermal bridge for the numerical calculation of:
heat flows, in order to assess the overall heat loss from a building or part of it;
minimum surface temperatures, in order to assess the risk of surface condensation.
These specifications include the geometrical boundaries and subdivisions of the model, the thermal boundary conditions, and the thermal values and relationships to be used.
ISO 10211:2007 is based upon the following assumptions:
all physical properties are independent of temperature;
there are no heat sources within the building element.
ISO 10211:2007 can also be used for the derivation of linear and point thermal transmittances and of surface temperature factors. More information here.
Only the 2D specifications have been implemented.
$ mpirun np 4 /usr/local/bin/feelpp_thermodyn_2d configfile thermo2dCase2.cfg
ISO 10211:2007 sets out the specifications for a threedimensional and a twodimensional geometrical model of a thermal bridge for the numerical calculation of:
heat flows, in order to assess the overall heat loss from a building or part of it;
minimum surface temperatures, in order to assess the risk of surface condensation.
These specifications include the geometrical boundaries and subdivisions of the model, the thermal boundary conditions, and the thermal values and relationships to be used.
ISO 10211:2007 is based upon the following assumptions:
all physical properties are independent of temperature;
there are no heat sources within the building element.
ISO 10211:2007 can also be used for the derivation of linear and point thermal transmittances and of surface temperature factors. More information here.
Only the 2D specifications have been implemented.
$ mpirun np 4 /usr/local/bin/feelpp_thermodyn_2d configfile thermo2dCase2.cfg
ISO 10211:2007 sets out the specifications for a threedimensional and a twodimensional geometrical model of a thermal bridge for the numerical calculation of:
heat flows, in order to assess the overall heat loss from a building or part of it;
minimum surface temperatures, in order to assess the risk of surface condensation.
These specifications include the geometrical boundaries and subdivisions of the model, the thermal boundary conditions, and the thermal values and relationships to be used.
ISO 10211:2007 is based upon the following assumptions:
all physical properties are independent of temperature;
there are no heat sources within the building element.
ISO 10211:2007 can also be used for the derivation of linear and point thermal transmittances and of surface temperature factors. More information here.
Only the 2D specifications have been implemented.
$ mpirun np 4 /usr/local/bin/feelpp_thermodyn_2d configfile thermo2dCase2.cfg
In the toolbox we couple fluid and heat transfer. We model both force and natural (or free) convection.
link:NaturalConvection/README.adoc
The examples in this directory deal with processes due solely to natural convection.
This is a standard benchmark with many data available.
The goal of this project is to simulate the fluid flow under natural convection: the heated fluid circulates towards the low temperature under the action of density and gravity differences. The phenomenon is important, in the sense it models evacuation of heat, generated by friction forces for example, with a cooling fluid.
We shall put in place a simple convection problem in order to study the phenomenon without having to handle the difficulties of more complex domaines. We describe then some necessary transformations to the equations, then we define quantities of interest to be able to compare the simulations with different parameter values.
To study the convection, we use a model problem: it consists in a rectangular tank of height 1 and width W, in which the fluid is enclosed, see figure Geometry of natural convection benchmark.. We wish to know the fluid velocity \mathbf{u}, the fluid pressure p and fluid temperature \theta.
We introduce the adimensionalized NavierStokes and heat equations parametrized by the Grashof and Prandtl numbers. These parameters allow to describe the various regimes of the fluid flow and heat transfer in the tank when varying them.
The adimensionalized steady incompressible NavierStokes equations reads:
\begin{split} \mathbf{u}\cdot\nabla \mathbf{u} + \nabla p  \frac{1}{\sqrt{\text{Gr}}} \Delta \mathbf{u} &= \theta \mathbf{e}_2 \\ \nabla \cdot \mathbf{u} &= 0\ \text{sur}\ \Omega\\ \mathbf{u} &= \mathbf{0}\ \text{sur}\ \partial \Omega \end{split}
where \mathrm{Gr} is the Grashof number, \mathbf{u} the adimensionalized velocity and p adimensionalized pressure and \theta the adimensionalized temperature. The temperature is in fact the difference between the temperature in the tank and the temperature T_0 on boundary \Gamma_1.
The heat equation reads:
\begin{split} \mathbf{u} \cdot \nabla \theta \frac{1}{\sqrt{\text{Gr}}{\mathrm{Pr}}} \Delta \theta &= 0\\ \theta &= 0\ \text{sur}\ \Gamma_1\\ \frac{\partial \theta}{\partial n} &= 0\ \text{sur}\ \Gamma_{2,4}\\ \frac{\partial \theta}{\partial n} &= 1\ \text{sur}\ \Gamma_3 \end{split}
where \mathrm{Pr} is the Prandtl number.
what are the effects of the Grashof and Prandtl numbers ? We remark that both terms with these parameters appear in front of the \Delta parameter, they thus act on the diffusive terms. If we increase the Grashof number or the Prandtl number the coefficients multiplying the diffusive terms decrease, and this the convection, that is to say the transport of the heat via the fluid, becomes dominant. This leads also to a more difficult and complex flows to simulate, see figure [fig:heatns:2]. The influence of the Grashof and Prandtl numbers are different but they generate similar difficulties and flow configurations. Thus we look only here at the influence of the Grashof number which shall vary in [1, 1e7].
We would like to compare the results of many simulations with respect to the Grashof defined in the previous section. We introduce two quantities which will allow us to observe the behavior of the flow and heat transfer.
We consider first the mean temperature on boundary \Gamma_3
T_3 = \int_{\Gamma_3} \theta
This quantity should decrease with increasing Grashof because the fluid flows faster and will transport more heat which will cool down the heated boundary \Gamma_3. We observe this behavior on the figure [fig:heatns:3].
Another quantity of interest is the flow rate through the middle of the tank. We define a segment \Gamma_f as being the vertical top semisegment located at W/2 with height 1/2, see figure [fig:heatns:1]. The flow rate, denoted \mathrm{D}_f, reads \mathrm{D}_f = \int_{\Gamma_f} \mathbf{u} \cdot \mathbf{e}_1
where \mathbf{e}_1=(1,0). Note that the flow rate can be negative or positive depending on the direction in which the fluid flows.
As a function of the Grashof, we shall see a increase in the flow rate. This is true for small Grashof, but starting at 1e3 the flow rate decreases. The fluid is contained in a boundary layer which is becoming smaller as the Grashof increases.
image::debit_grashof.png[Behavior of the flow rate with respect to the Grashof number; h = 0.02, \mathbb{P}_3 for the velocity, \mathbb{P}_2 for the pressure and \mathbb{P}_1 for the temperature.]
$ mpirun np 4 /usr/local/bin/feelpp_toolbox_fluid_2d configfile cfd2d.cfg
We will interest now to the different interactions a fluid and a structure can have together with specific conditions.
To describe and solve our fluidstructure interaction problem, we need to define a model, which regroup structure model and fluid model parts.
We have then in one hand the fluid equations, and in the other hand the structure equations.
The solution of this model are \((\mathcal{A}^t, \boldsymbol{u}_f, p_f, \boldsymbol{\eta}_s)\).
Generally, the solid mechanic equations are expressed in a Lagrangian frame, and the fluid part in Eulerian frame. To define and take in account the fluid domain displacement, we use a technique name ALE ( Arbitrary Lagrangian Eulerian ). This allow the flow to follow the fluidstructure interface movements and also permit us to have a different deformation velocity than the fluid one.
Let denote \(\Omega^{t_0}\) the calculation domain, and \(\Omega^t\) the deformed domain at time \(t\). As explain before, we want to conserve the Lagrangian and Eulerian characteristics of each part, and to do this, we introduce \(\mathcal{A}^t\) the ALE map.
This map give us the position of \(x\), a point in the deformed domain at time \(t\) from the position of \(x^*\) in the initial configuration \(\Omega^*\).
\(\mathcal{A}^t\) is a homeomorphism, i.e. a continuous and bijective application we can define as
We denote also \(\forall \mathbf{x}^* \in \Omega^*\), the application :
This ALE map can then be retrieve into the fluidstructure model.
This test case has originally been realised by [Pena], [Nobile] and [GerbeauVidrascu] only with the free outlet condition.
Computer codes, used for the acquisition of results, are from Vincent [Chabannes]
We interest here to the case of bidimensional blood flow modelisation. We want to reproduce and observe pressure wave spread into a canal with a fluidstructure interaction model.
The figure above shows us the initial geometry we will work on. The canal is represent by a rectangle with width and height, respectively equal to 6 and 1 cm. The upper and lower walls are mobile and so, can be moved by flow action.
By using the 1D reduced model, named generalized string and explained by [Chabannes], we didn’t need to define the elastic domain ( for the vascular wall ) here. So the structure domain is \(\Omega_s^*=\Gamma_{fsi}^*\)
During this benchmark, we will compare two different cases : the free outlet condition and the Windkessel model. The first one, as its name said, impose a free condition on the fluid at the end of the domain. The second one is used to model more realistically an flow outlet into our case. The chosen time step is \(\Delta t=0.0001\)
We set :
on \(\Gamma_f^{i,*}\) the pressure wave pulse \[ \boldsymbol{\sigma}_{f} \boldsymbol_f = \left\{ \begin{aligned} & \left(\frac{2 \cdot 10^4}{2} \left( 1  \cos \left( \frac{ \pi t} {2.5 \cdot 10^{3}} \right) \right), 0\right)^T \quad & \text{ if } t < 0.005 \\ & \boldsymbol{0} \quad & \text{ else } \end{aligned} \right. \]
on \(\Gamma_f^{o,*}\)
Case 1 : free outlet : \(\boldsymbol{\sigma}_{f} \boldsymbol{n}_f =0\)
Case 2 : Windkessel model ( \(P_0\) proximal pressure, see [Chabannes] ) : \(\boldsymbol{\sigma}_{f} \boldsymbol{n}_f = P_0\boldsymbol{n}_f\)
on \(\Gamma_f^{i,*} \cup \Gamma_f^{o,*}\) a null displacement : \(\boldsymbol{\eta}_f=0\)
on \(\Gamma^*_{fsi}\) : \(\eta_s=0\)
We add also the specific coupling conditions, obtained from the axisymmetric reduced model, on \(\Gamma^*_{fsi}\)
Name 
Description 
Nominal Value 
Units 
\(E_s\) 
Young’s modulus 
\(0.75\) 
\(dynes.cm^{2}\) 
\(\nu_s\) 
Poisson’s ratio 
\(0.5\) 
dimensionless 
\(h\) 
walls thickness 
0.1 
\(cm\) 
\(\rho_s\) 
structure density 
\(1.1\) 
\(g.cm^{3}\) 
\(R_0\) 
tube radius 
\(0.5\) 
\(cm\) 
\(G_s\) 
shear modulus 
\(10^5\) 
\(Pa\) 
\(k\) 
Timoshenko’s correction factor 
\(2.5\) 
dimensionless 
\(\gamma_v\) 
viscoelasticity parameter 
\(0.01\) 
dimensionless 
\(\mu_f\) 
viscosity 
\(0.003\) 
\(poise\) 
\(\rho_f\) 
density 
\(1\) 
\(g.cm^{3}\) 
\(R_p\) 
proximal resistance 
\(400\) 

\(R_d\) 
distal resistance 
\(6.2 \times 10^3\) 

\(C_d\) 
capacitance 
\(2.72 \times 10^{4}\) 
After solving the fluid struture model, we obtain \((\mathcal{A}^t, \boldsymbol{u}_f, p_f, \boldsymbol{\eta}_s)\)
with \(\mathcal{A}^t\) the ALE map, \(\boldsymbol{u}_f\) the fluid velocity, \(p_f\) the fluid pressure and \(\boldsymbol\eta_s\) the structure displacement
\(\mathcal{F}\) is the set of all mesh faces, we denote \(\mathcal{F}_{stab}\) the face we stabilize
In fact, after a first attempt, numerical instabilities can be observed at the fluid inlet. These instabilities, caused by pressure wave, and especially by the Neumann condition, make our fluidstructure solver diverge.
To correct them, we choose to add a stabilization term, obtain from the stabilized CIP formulation ( see [Chabannes], Chapter 6 ).
As this stabilization bring an important cost with it, by increasing the number of nonnull term into the problem matrix, we only apply it at the fluid entrance, where the instabilities are located.
Now we present the different situations we worked on.
Config 
Fluid 
Structure 

\(N_{elt}\) 
\(N_{geo}\) 
\(N_{dof}\) 
\(N_{elt}\) 
\(N_{geo}\) 
\(N_{dof}\) 

\((1)\) 
\(342\) 
\(3~(P4P3)\) 
\(7377\) 
\(58\) 
\(1\) 
\(176~(P3)\) 

\((2)\) 
\(342\) 
\(4~(P5P4)\) 
\(11751\) 
\(58\) 
\(1\) 
\(234~(P4)\) 
For the fluid time discretization, BDF, at order \(2\), is the method we use.
And Newmarkbeta method is the one we choose for the structure time discretization, with parameters \(\gamma=0.5\) and \(\beta=0.25\).
These methods can be retrieved in [Chabannes] papers.
Here are the different solvers ( linear and nonlinear ) used during results acquisition.
KSP 

case 
fluid 
solid 
type 
gmres 

relative tolerance 
\(1e13\) 

max iteration 
\(30\) 
\(10\) 
reuse preconditioner 
true 
false 
SNES 

case 
fluid 
solid 
relative tolerance 
\(1e8\) 

steps tolerance 
\(1e8\) 

max iteration 
\(50\) 

max iteration with reuse 
\(50\) 

reuse jacobian 
false 

reuse jacobian rebuild at first Newton step 
false 
true 
KSP in SNES 

case 
fluid 
solid 
relative tolerance 
\(1e5\) 

max iteration 
\(1000\) 

max iteration with reuse 
\(1000\) 

reuse preconditioner 
true 
false 
reuse preconditioner rebuild at first Newton step 
false 
PC 

case 
fluid 
solid 
type 
LU 

package 
mumps 
FSI 

solver method 
fix point 
tolerance 
\(1e6\) 
max iterations 
\(1\) 
To realize the acquisition of the benchmark results, code files contained and using the Feel++ library will be used. Here is a quick look to the different location of them.
Let’s start with the main code, that can be retrieve in
feelpp/applications/models/fsi
The configuration file associated to this test is named wavepressure2d.cfg and is located at
feelpp/applications/models/fsi/wavepressure2d
The result files are then stored by default in
applications/models/fsi/wavepressure2d/P2P1G1P1G1/np_1
The two following pictures have their pressure and velocity magnitude amplify by 5.
To draw the next two figures, we define 60 sections \(\{x_i\}_{i=0}^{60}\) with \(x_i=0.1i\).
All the files used for this case can be found in this rep [geo file, config file, fluid json file, solid json file].
Let’s begin with results with the free outlet condition ( see figure 2 ). These pictures show us how the pressure wave progresses into the tube. We can denote an increase of the fluid velocity at the end of the tube. Also, the wave eases at the same place. For the simulation with the Windkessel model, we observe a similar comportment at the beginning ( see figure 3 ). However, the outlet is more realistic than before. In fact, the pressure seems to propagate more naturally with this model. + In the two cases, the velocity field is disturbed at the fluidstructure interface. A mesh refinement around this region increases the quality. However, this is not crucial for the blood flow simulation.
Now we can interest us to the quantitative results.
The inflow and outflow evolution figure ( see figure 4 ) shows us similarities for the two tests at the inlet. At the outlet, in contrast, the flow increases for the free outlet condition. In fact, when the pressure wave arrived at the outlet of the tube, it is reflected to the other way. In the same way, when the reflected wave arrived at the inlet, it is reflected again. The Windkessel model reduce significantly this phenomenon. Some residues stay due to 0D coupling model and structure fixation.
We also have calculate the maximum displacement magnitude for the two model ( see figure 5 ). The same phenomenons explained ahead are retrieve here. We denote that, for the free outlet, the structure undergoes movements during the test time, caused by the wave reflection. The Windkessel model reduces these perturbations thanks to the 0D model.
The average pressure and the fluid flow ( see figure 6 and 7 ) show us the same nonphysiological phenomenons as before. The results we obtain are in accordance with the ones proposed by [Nobile].
To end this benchmark, we will compare the two resolution algorithms used with the fluidstructure model : the implicit and the semiimplicit ones. The second configuration with Windkessel model is used for the measures.
We have then the fluid flow and the displacement magnitude ( figure 8 ) curves, which superimposed on each other. So the accuracy obtained by the semiimplicit method seems good here.
The performances of the two algorithms ( figure 9 ) are expressed from number of iterations and CPU time at each step time. The semiimplicit method is a bit ahead of the implicit one on number of iterations. However, the CPU time is smaller for 2 or 3 time, due to optimization in this method. First an unique ALE map estimation is need. Furthermore, linear terms of the Jacobian matrix, residuals terms and dependent part of the ALE map can be stored and reused at each iteration.
[Pena] G. Pena, Spectral element approximation of the incompressible NavierStokes equations evolving in a moving domain and applications, École Polytechnique Fédérale de Lausanne, November 2009.
[Nobile] F. Nobile, Numerical approximation of fluidstructure interaction problems with application to haemodynamics, École Polytechnique Fédérale de Lausanne, Switzerland, 2001.
[GerbeauVidrascu] J.F. Gerbeau, M. Vidrascu, A quasinewton algorithm based on a reduced model for fluidstructure interaction problems in blood flows, 2003.
[Chabannes] Vincent Chabannes, Vers la simulation numérique des écoulements sanguins, Équations aux dérivées partielles [math.AP], Université de Grenoble, 2013.
Computer codes, used for the acquisition of results, are from Vincent [Chabannes].
As in the 2D case, the blood flow modelisation, by observing a pressure wave progression into a vessel, is the subjet of this benchmark. But this time, instead of a twodimensional model, we use a threedimensional model, with a cylinder
This represents the domains into the initial condition, with \(\Omega_f\) and \(\Omega_s\) respectively the fluid and the solid domain. The cylinder radius equals to \(r+\epsilon\), where \(r\) is the radius of the fluid domain and \(\epsilon\) the part of the solid domain.
\(\Gamma^*_{fsi}\) is the interface between the fluid and solid domains, whereas \(\Gamma^{e,*}_s\) is the interface between the solid domain and the exterior. \(\Gamma_f^{i,*}\) and \(\Gamma_f^{o,*}\) are respectively the inflow and the outflow of the fluid domain. Likewise, \(\Gamma_s^{i,*}\) and \(\Gamma_s^{o,*}\) are the extremities of the solid domain.
During this benchmark, we will study two different cases, named BC1 and BC2, that differ from boundary conditions. BC2 are conditions imposed to be more physiological than the ones from BC1. So we waiting for more realistics based results from BC2.
on \(\Gamma_f^{i,*}\) the pressure wave pulse \[ \boldsymbol{\sigma}_{f} \boldsymbol_f = \left\{ \begin{aligned} & \left(\frac{1.3332 \cdot 10^4}{2} \left( 1  \cos \left( \frac{ \pi t} {1.5 \cdot 10^{3}} \right) \right), 0 \right)^T \quad & \text{ if } t < 0.003 \\ & \boldsymbol{0} \quad & \text{ else } \end{aligned} \right. \]
We add the coupling conditions on \(\Gamma^*_{fsi}\)
Then we have two different cases :
Case BC1
on \(\Gamma_f^{o,*}\) : \(\boldsymbol{\sigma}_{f} \boldsymbol{n}_f =0\)
on \(\Gamma_s^{i,*} \cup \Gamma_s^{o,*}\) a null displacement : \(\boldsymbol{\eta}_s=0\)
on \(\Gamma^{e,*}_{s}\) : \(\boldsymbol{F}_s\boldsymbol{\Sigma}_s\boldsymbol{n}_s^*=0\)
on \(\Gamma_f^{i,*}U \Gamma_f^{o,*}\) : \(\mathcal{A}^t_f=\boldsymbol{\mathrm{x}}^*\)
Case BC2
on \(\Gamma_f^{o,*}\) : \(\boldsymbol{\sigma}_{f} \boldsymbol{n}_f = P_0\boldsymbol{n}_f\)
on \(\Gamma_s^{i,*}\) a null displacement \(\boldsymbol{\eta}_s=0\)
on \(\Gamma^{e,*}_{s}\) : \(\boldsymbol{F}_s\boldsymbol{\Sigma}_s\boldsymbol{n}_s^* + \alpha \boldsymbol{\eta}_s=0\)
on \(\Gamma^{o,*}_{s}\) : \(\boldsymbol{F}_s\boldsymbol{\Sigma}_s\boldsymbol{n}_s^* =0\)
on \(\Gamma_f^{i,*}\) : \(\mathcal{A}^t_f=\boldsymbol{\mathrm{x}}^*\)
on \(\Gamma_f^{o,*}\) : \(\nabla \mathcal{A}^t_f \boldsymbol{n}_f^*=\boldsymbol{n}_f^*\)
The chosen time step is \(\Delta t=0.0001\)
Name  Description  Nominal Value  Units 

\(E_s\) 
Young’s modulus 
\(3 \times 10^6 \) 
\(dynes.cm^{2}\) 
\(\nu_s\) 
Poisson’s ratio 
\(0.3\) 
dimensionless 
\(r\) 
fluid tube radius 
0.5 
\(cm\) 
\(\epsilon\) 
solid tube radius 
0.1 
\(cm\) 
\(L\) 
tube length 
5 
\(cm\) 
\(A\) 
A coordinates 
(0,0,0) 
\(cm\) 
\(B\) 
B coordinates 
(5,0,0) 
\(cm\) 
\(\mu_f\) 
viscosity 
\(0.03\) 
\(poise\) 
\(\rho_f\) 
density 
\(1\) 
\(g.cm^{3}\) 
\(R_p\) 
proximal resistance 
\(400\) 

\(R_d\) 
distal resistance 
\(6.2 \times 10^3\) 

\(C_d\) 
capacitance 
\(2.72 \times 10^{4}\) 
After solving the fluid struture model, we obtain \((\mathcal{A}^t, \boldsymbol{u}_f, p_f, \boldsymbol{\eta}_s)\)
with \(\mathcal{A}^t\) the ALE map, \(\boldsymbol{u}_f\) the fluid velocity, \(p_f\) the fluid pressure and \(\boldsymbol\eta_s\) the structure displacement.
Here are the different configurations we worked on. The parameter Incomp define if we use the incompressible constraint or not.
Config 
Fluid 
Structure 

\(N_{elt}\) 
\(N_{geo}\) 
\(N_{dof}\) 
\(N_{elt}\) 
\(N_{geo}\) 
\(N_{dof}\) 
Incomp 

\((1)\) 
\(13625\) 
\(1~(P2P1)\) 
\(69836\) 
\(12961\) 
\(1\) 
\(12876~(P1)\) 
No 

\((2)\) 
\(13625\) 
\(1~(P2P1)\) 
\(69836\) 
\(12961\) 
\(1\) 
\(81536~(P1)\) 
Yes 

\((3)\) 
\(1609\) 
\(2~(P3P2)\) 
\(30744\) 
\(3361\) 
\(2\) 
\(19878~(P2)\) 
No 
For the structure time discretization, we will use Newmarkbeta method, with parameters \(\gamma=0.5\) and \(\beta=0.25\).
And for the fluid time discretization, BDF, at order \(2\), is the method we choose.
These two methods can be found in [Chabannes] papers.
To realize the acquisition of the benchmark results, code files contained and using the Feel++ library will be used. Here is a quick look to the different location of them.
Let’s start with the main code, that can be retrieve in
feelpp/applications/models/fsi
The configuration file associated to this test is named wavepressure3d.cfg and is located at
feelpp/applications/models/fsi/wavepressure3d
The result files are then stored by default in
applications/models/fsi/wavepressure3d/P2P1G1P1G1/np_1
All the files used for this case can be found in this rep [geo file, config file, fluid json file, solid json file].
In order to validate our fluidstructure interaction solver, a benchmark, initially proposed by [TurekHron], is realized.
Computer codes, used for the acquisition of results, are from Vincent [Chabannes].
Note This benchmark is linked to the Turek Hron CFD and Turek Hron CSM benchmarks.
In this case, we want to study the flow of a laminar incrompressible flow around an elastic obstacle, fixed to a rigid cylinder, we combine here the study realized on Turek Hron CFD benchmark and Turek Hron CSM benchmark. So a 2D model, representative of this state, is considered.
We denote \(\Omega_f^*\) the fluid domain, represented by a rectangle of dimension \( [0,2.5] \times [0,0.41] \). This domain is characterized by its density \(\rho_f\) and its dynamic viscosity \(\mu_f\). In this case, the fluid material we used is glycerin.
Furthermore, the model chosen to describe the flow is the incompressible NavierStockes model. It is defined by the conservation of momentum equation and the conservation of mass equation. We also have the material constitutive equation to take in account in this domain, as well as the harmonic extension operator for the fluid movement.
On the other side, the structure domain, named \(\Omega_s^*\), represent the hyperelastic bar, bound to the stationary cylinder. As we want to work in a Lagrangian frame, and by Newton’s second law, the fundamental equation of the solid mechanic will be used. For the model, that our hyperelastic material follows, we use the SaintVenantKirchhoff one, define with Lamé coefficients. These coefficients are obtained from the the Young’s modulus \(E_s\) and the Poisson’s ratio \(\nu_s\) of the material.
All of these are then gather into the fluidstructure coupling system.
We set
on \(\Gamma_{in}^*\), an inflow Dirichlet condition : \( \boldsymbol{u}_f=(v_{in},0);\)
on \(\Gamma_{wall}^* \cup \Gamma_{circ}^*\), a homogeneous Dirichlet condition : \(\boldsymbol{u}_f=\boldsymbol{0};\)
on \(\Gamma_{out}^*\), a Neumann condition : \(\boldsymbol{\sigma}_f\boldsymbol{n}_f=\boldsymbol{0};\)
on \(\Gamma_{fixe}^*\), a condition that imposes this boundary to be fixed : \(\boldsymbol{\eta}_s=0;\)
on \(\Gamma_{fsi}^*\) :
where \(\boldsymbol{n}_f\) is the outer unit normal vector from \(\partial \Omega_f^*\).
In order to describe the flow inlet by \(\Gamma_{in}\), a parabolic velocity profile is used. It can be expressed by
where \(\bar{U}\) is the mean inflow velocity.
However, to impose a progressive increase of this velocity profile, we define
\[ v_{in} = \left\{ \begin{aligned} & v_{cst} \frac{1\cos\left( \frac{\pi}{2} t \right) }{2} \quad & \text{ if } t < 2 \\ & v_{cst} \quad & \text{ otherwise } \end{aligned} \right. \]
With t the time.
Finally, we don’t want a source term, so \(f_f\equiv 0\).
The following table displays the various fixed and variables parameters of this testcase.
Name  Description  Nominal Value  Units 

\(l\) 
elastic structure length 
\(0.35\) 
\(m\) 
\(h\) 
elastic structure height 
\(0.02\) 
\(m\) 
\(r\) 
cylinder radius 
\(0.05\) 
\(m\) 
\(C\) 
cylinder center coordinates 
\((0.2,0.2)\) 
\(m\) 
\(A\) 
control point coordinates 
\((0.2,0.2)\) 
\(m\) 
\(B\) 
point coordinates 
\((0.15,0.2)\) 
\(m\) 
\(E_s\) 
Young’s modulus 
\(5.6 \times 10^6\) 
\(kg.m^{1}s^{2}\) 
\(\nu_s\) 
Poisson’s ratio 
\(0.4\) 
dimensionless 
\(\rho_s\) 
structure density 
\(1000\) 
\(kg.m^{3}\) 
\(\nu_f\) 
kinematic viscosity 
\(1\times 10^{3}\) 
\(m^2.s^{1}\) 
\(\mu_f\) 
dynamic viscosity 
\(1\) 
\(kg.m^{1}.s^{1}\) 
\(\rho_f\) 
density 
\(1000\) 
\(kg.m^{3}\) 
\(f_f\) 
source term 
0 

\(\bar{U}\) 
mean inflow velocity 
2 
\(m.s^{1}\) 
As for solvers we used, Newton’s method is chosen for the nonlinear part and a direct method based on LU decomposition is selected for the linear part.
The quantities we observe during this benchmark are on one hand the lift and drag forces ( respectively \(F_L\) and \(F_D\) ), as well as the displacement, on \(x\) and \(y\) axis, of the point A is the second value that interest us here.
They are the solution of the link::../README.adoc[fluidstructure system].
This system also give us the ALE map \(\mathcal{A}_f^t\).
To realize these tests, we made the choice to used \(P_N~~P_{N1}\) TaylorHood finite elements to discretize the space.
For the fluid time discretization, BDF, at order \(q\), is the method we have chosen.
And finally Newmarkbeta method is the one we used for the structure time discretization, with parameters \(\gamma=0.5\) and \(\beta=0.25\).
These methods can be retrieved in [Chabannes] papers.
Here are the different solvers ( linear and nonlinear ) used during results acquisition.
KSP 

case 
fluid 
solid 
type 
gmres 

relative tolerance 
\(1e13\) 

max iteration 
\(1000\) 

reuse preconditioner 
true 
SNES 

case 
fluid 
solid 
relative tolerance 
\(1e8\) 

steps tolerance 
\(1e8\) 

max iteration 
\(50\) 

max iteration with reuse 
\(50\) 
\(10\) 
reuse jacobian 
true 
false 
reuse jacobian rebuild at first Newton step 
false 
true 
SNES 

case 
fluid 
solid 
relative tolerance 
\(1e5\) 

max iteration 
\(1000\) 

max iteration with reuse 
\(1000\) 
\(10\) 
reuse preconditioner 
true 

reuse preconditioner rebuild at first Newton step 
true 
PC 

case 
fluid 
solid 
type 
LU 

package 
mumps 
FSI 

solver method 
fix point with Aitken relaxation 
tolerance 
\(1e6\) 
max iterations 
\(1000\) 
initial \(\theta\) 
\(0.98\) 
minimum \(\theta\) 
\(1e12\) 
To realize the acquisition of the benchmark results, code files contained and using the Feel++ library will be used. Here is a quick look to the different location of them.
Let’s start with the main code, that can be retrieve in
feelpp/applications/models/fsi
The FSI3 configuration file is located at
feelpp/applications/models/fsi/TurekHron
The result files are then stored by default in
feel/applications/models/fsi/TurekHron/fsi3/ <velocity_space><pression_space><Geometric_order><OrderDisp><Geometric_order>/np_<processor_used>
For example, for the FSI3 case executed on \(4\) processors, with a \(P_2\) velocity approximation space, a \(P_1\) pressure approximation space, a geometric order of \(1\) for fluid part and a \(P_1\) displacement approximation space and geometric order equals to \(1\) for solid part, the path is
feel/applications/models/fsi/TurekHron/fsi3/P2P1G1P1G1/np_4
First at all, we will discretize the simulation parameters for the different cases studied.
\(N_{elt}\) 
\(N_{dof}\) 
\( [P^N_c(\Omega_{f,\delta}]^2 \times P^{N1}_c(\Omega_{f,\delta}) \times V^{N1}_{s,\delta}\) 
\(\Delta t\) 

15872 
304128 
0.00025 

(1) 
1284 
27400 
\( [P^4_c(\Omega_{f,(h,3)}]^2 \times P^3_c(\Omega_{f,(h,3)}) \times V^3_{s,(h,3)}\) 
0.005 
(2) 
2117 
44834 
\( [P^4_c(\Omega_{f,(h,3)}]^2 \times P^3_c(\Omega_{f,(h,3)}) \times V^3_{s,(h,3)}\) 
0.005 
(3) 
4549 
95427 
\( [P^4_c(\Omega_{f,(h,3)}]^2 \times P^3_c(\Omega_{f,(h,3)}) \times V^3_{s,(h,3)}\) 
0.005 
(4) 
17702 
81654 
\( [P^2_c(\Omega_{f,(h,1)}]^2 \times P^1_c(\Omega_{f,(h,1)}) \times V^1_{s,(h,1)}\) 
0.0005 
Then the FSI3 benchmark results are detailed below.
\(x\) displacement \( [\times 10^{3}] \) 
\(y\) displacement \( [\times 10^{3}] \) 
Drag 
Lift 

2.69 ± 2.53 [10.9] 
1.48 ± 34.38 [5.3] 
457.3 ± 22.66 [10.9] 
2.22 ± 149.78 [5.3] 

464.5 ± 40.50 
6.00 ± 166.00 [5.5] 

2.88 ± 2.72 [10.9] 
1.47 ± 34.99 [5.5] 
460.5 ± 27.74 [10.9] 
2.50 ± 153.91 [5.5] 

4.54 ± 4.34 [10.1] 
1.50 ± 42.50 [5.1] 
467.5 ± 39.50 [10.1] 
16.2 ± 188.70 [5.1] 

474.9 ± 28.10 
3.90 ± 165.90 [5.5] 

2.83 ± 2.78 [10.8] 
1.35 ± 34.75 [5.4] 
458.5 ± 24.00 [10.8] 
2.50 ± 147.50 [5.4] 

(1) 
2.86 ± 2.74 [10.9] 
1.31 ± 34.71 [5.4] 
459.7 ± 29.97 [10.9] 
4.46 ± 172.53 [5.4] 
(2) 
2.85 ± 2.72 [10.9] 
1.35 ± 34.62 [5.4] 
459.2 ± 29.62 [10.9] 
3.53 ± 172.73 [5.4] 
(3) 
2.88 ± 2.75 [10.9] 
1.35 ± 34.72 [5.4] 
459.3 ± 29.84 [10.9] 
3.19 ± 171.20 [5.4] 
(4) 
2.90 ± 2.77 [11.0] 
1.33 ± 34.90 [5.5] 
457.9 ± 31.79 [11.0] 
8.93 ± 216.21 [5.5] 
All the files used for this case can be found in this rep [geo file, config file, fluid json file, solid json file].
Our first three results are quite similar to given references values. That show us that high order approximation order for space and time give us accurate values, while allow us to use less degree of freedom.
However, the lift force seems to undergo some disturbances, compared to reference results, and it’s more noticeable in our fourth case. This phenomenon is describe by [Beuer], where they’re explaining these disturbances are caused by Aitken dynamic relaxation, used in fluid structure relation for the fixed point algorithm.
In order to correct them, they propose to lower the fixed point tolerance, but this method also lowers calculation performances. An other method to solve this deviation is to use a fixed relaxation parameter \(\theta\). In this case, the optimal \theta seems to be equal to \(0.5\).
[TurekHron] S. Turek and J. Hron, Proposal for numerical benchmarking of fluidstructure interaction between an elastic object and laminar incompressible flow, Lecture Notes in Computational Science and Engineering, 2006.
[Chabannes] Vincent Chabannes, Vers la simulation numérique des écoulements sanguins, Équations aux dérivées partielles [math.AP], Université de Grenoble, 2013.
[Breuer] M. Breuer, G. De Nayer, M. Münsch, T. Gallinger, and R. Wüchner, Fluid–structure interaction using a partitioned semiimplicit predictor–corrector coupling scheme for the application of clargeeddy simulation, Journal of Fluids and Structures, 2012.
[TurekHron2] S. Turek, J. Hron, M. Madlik, M. Razzaq, H. Wobker, and JF Acker, Numerical simulation and benchmarking of a monolithic multigrid solver for fluidstructure interaction problems with application to hemodynamics, Fluid Structure Interaction II, pages 193–220, 2010.
[MunschBreuer] M. Münsch and M. Breuer, Numerical simulation of fluid–structure interaction using eddy–resolving schemes, Fluid Structure Interaction II, pages 221–253, 2010.
[Gallinger] T.G. Gallinger, Effiziente Algorithmen zur partitionierten Lösung stark gekoppelter Probleme der FluidStrukturWechselwirkung, Shaker, 2010.
[Sandboge] R. Sandboge, Fluidstructure interaction with openfsitm and md nastrantm structural solver, Ann Arbor, 1001 :48105, 2010.
This test case has originally been proposed by [MokWall].
Computer codes, used for the acquisition of results, are from Vincent [Chabannes].
This benchmark has aso been realized by [Gerbeau], [Vàzquez], [Kuttler] and [Kassiotis].
We study here an incompressible fluid flowing into a cavity, where its walls are elastic. We use the following geometry to represent it.
The domain \(\Omega_f^*\) is define by a square \( [0,1]^2 \), \(\Gamma^{i,*}_f\) and \(\Gamma^{o,*}_f\) are respectively the flow entrance and the flow outlet. A constant flow velocity, following the \(x\) axis, will be imposed on \(\Gamma_f^{h,*}\) border, while a null flow velocity will be imposed on \(\Gamma_f^{f,*}\). This last point represent also a nonslip condition for the fluid.
Furthermore, we add a structure domain, at the bottom of the fluid one, named \(\Omega_s^*\). It is fixed by his two vertical sides \(\Gamma_s^{f,*}\), and we denote by \(\Gamma_f^{w,*}\) the border which will interact with \(\Omega_f^*\).
During this test, we will observe the displacement of a point \(A\), positioned at \((0;0.5)\), into the \(y\) direction, and compare our results to ones found in other references.
Before enunciate the boundary conditions, we need to describe a oscillatory velocity, following the x axis and dependent of time.
Then we can set
on \(\Gamma^{h,*}_f\), an inflow Dirichlet condition : \(\boldsymbol{u}_{f} = ( v_{in}, 0 )\)
on \(\Gamma^{i,*}_f\), an inflow Dirichlet condition : \(\boldsymbol{u}_{f} = ( v_{in}(8 y 7) ,0)\)
on \(\Gamma^{f,*}_f\), a homogeneous Dirichlet condition : \(\boldsymbol{u}_{f} = \boldsymbol{0}\)
on \(\Gamma^{o,*}_f\), a Neumann condition : \(\boldsymbol{\sigma}_{f} \boldsymbol{n}_f = \boldsymbol{0}\)
on \(\Gamma^{f,*}_s\), a condition that imposes this boundary to be fixed : \(\boldsymbol{\eta}_{s} = \boldsymbol{0}\)
on \(\Gamma^{e,*}_s\), a condition that lets these boundaries be free from constraints : \(\boldsymbol{F}_{s} \boldsymbol{\Sigma}_s \boldsymbol{n}_s = \boldsymbol{0}\)
To them we also add the fluidstructure coupling conditions on \(\Gamma_{fsi}^*\) :
To realize the simulations, we used a time step \(\Delta t\) equals to \(0.01\) s.
The following table displays the various fixed and variables parameters of this testcase.
Name 
Description 
Nominal Value 
Units 
\(E_s\) 
Young’s modulus 
\(250\) 
\(N.m^{2}\) 
\(\nu_s\) 
Poisson’s ratio 
\(0\) 
dimensionless 
\(\rho_s\) 
structure density 
\(500\) 
\(kg.m^{3}\) 
\(\mu_f\) 
viscosity 
\(1\times 10^{3}\) 
\(m^2.s^{1}\) 
\(\rho_f\) 
density 
\(1\) 
\(kg.m^{3}\) 
\((\boldsymbol{u}_f, p_f, \boldsymbol{\eta}_s, \mathcal{A}_f^t)\), checking the fluidstructure system, are the output of this problem.
To discretize space, we used \(P_N~~P_{N1}\) TaylorHood finite elements.
For the structure time discretization, Newmarkbeta method is the one we used. And for the fluid time discretization, we used BDF, at order \(q\).
All the codes files are into FSI
We begin with a \(P_2~~P_1\) approximation for the fluid with a geometry order equals at \(1\), and a fluidstructure stable interface.
Then we retry with a \(P_3~~P_2\) approximation for the fluid with a geometry order equals at \(2\), and a fluidstructure stable interface.
Finally we launch it with the same conditions as before, but with a deformed interface.
First at all, we can see that the first two tests offer us similar results, despite different orders uses. At contrary, the third result set are better than the others.
The elastic wall thinness, in the stable case, should give an important refinement on the fluid domain, and so a better fluidstructure coupling control. However, the deformed case result are closer to the stable case made measure.
[MokWall] DP Mok and WA Wall, Partitioned analysis schemes for the transient interaction of incompressible flows and nonlinear flexible structures, Trends in computational structural mechanics, Barcelona, 2001.
[Chabannes] Vincent Chabannes, Vers la simulation numérique des écoulements sanguins, Équations aux dérivées partielles [math.AP], Université de Grenoble, 2013.
[Gerbeau] J.F. Gerbeau, M. Vidrascu, et al, A quasinewton algorithm based on a reduced model for fluidstructure interaction problems in blood flows, 2003.
[Vazquez] J.G. Valdés Vazquèz et al, Nonlinear analysis of orthotropic membrane and shell structures including fluidstructure interaction, 2007.
[KuttlerWall] U. Kuttler and W.A. Wall, Fixedpoint fluid–structure interaction solvers with dynamic relaxation, Computational Mechanics, 2008.
[Kassiotis] C. Kassiotis, A. Ibrahimbegovic, R. Niekamp, and H.G. Matthies, Nonlinear fluid–structure interaction problem ,part i : implicit partitioned algorithm, nonlinear stability proof and validation examples, Computational Mechanics, 2011.
This section presents some mathematical optimization problems. The following examples source codes are located in "doc/manual/opt/".
Here we propose to solve the following problem, finding the parameters b,c,d solution of the following homogeneous heat equation
\begin{cases} \begin{aligned} \nabla\cdot(\kappa\nabla u) &=0 \quad \text{on}\;\Omega \\ u &= g \quad \text{on}\;\partial\Omega \end{aligned} \end{cases}
with \kappa\rightarrow\kappa(\kappa_0,\kappa_1,\kappa_2) and where \Omega denotes the whole domain, \partial\Omega denotes the boundary of the domain such that these parameters verify the observation u_\text{obs} .
In other words, the goal is to minimize an objective function J(\kappa_0,\kappa_1,\kappa_2)
\min_{\kappa_0,\kappa_1,\kappa_2\in\mathbb{R}} J = \frac{1}{2}\int_{U} (uu_\text{obs})^2
with U\in\Omega an open subset of all observable measures.
In practice, observations are often boundary measurement taken on a subset of the domain boundary U\subseteq\partial\Omega . Thus arise concerns about existence and uniqueness of solution for the inverse problem, especially if observations does not cover the whole boundary. 
For the following example, we take U=\Omega and we define
\kappa=1+{\kappa_0}_{\vert_{I_0}} + {\kappa_1}_{\vert_{I_1}} + {\kappa_2}_{\vert_{I_2}}
where I_0, I_1, I_2 are different subset (inclusions) of \Omega .
We add a small perturbation to the given parameter b, c, d denoted
\begin{aligned} \kappa_0^\delta = \kappa_0 + \alpha\delta \kappa_0 \\ \kappa_1^\delta = \kappa_1 + \alpha\delta \kappa_1 \\ \kappa_2^\delta = \kappa_2 + \alpha\delta \kappa_2 \end{aligned}
for \alpha\in\mathbb{R} . Then u^\delta=u+\alpha\delta u is the perturbed solution of the equation
\begin{cases} \begin{aligned} \displaystyle \nabla\cdot(\kappa^\delta \nabla u^\delta) &= 0 \quad \text{on}\;\Omega \\ u^\delta &= 0 \quad \text{on}\;\partial\Omega \end{aligned} \end{cases}
where the diffusion coefficient for the perturbation \kappa^\delta \rightarrow \kappa( \kappa_0^\delta, \kappa_1^\delta, \kappa_2^\delta )
Lets note \delta J the shift for the cost function J such that
\begin{aligned} \delta J &=J(\kappa_0^\delta, \kappa_1^\delta, \kappa_2^\delta)  J(\kappa_0,\kappa_1,\kappa_2) \\ &=\frac{1}{2}\int_U (u^\delta  u_\text{obs})^2  (uu_\text{obs})^2 \\ &=\frac{1}{2}\int_U (u^\delta  u)(u^\delta+u2 u_\text{obs}) \\ &=\frac{1}{2}\int_U (u^\delta  u)( (u^\deltau_\text{objs}) + (u  u_\text{obs}) ) \\ \end{aligned} If we divide by \alpha and look when \alpha\rightarrow 0 , then we have
\delta J \approx \int_U \delta u(u  u_\text{obs})
Now we desire a method to compute the gradient. We consider the following linear tangent model deduced from two previous system of equations. We have
\nabla\cdot(\kappa^\delta \nabla u^\delta) = \nabla\cdot(\kappa \nabla u)
We introduce a state variable p (the adjoint) chosen appropriately as we will see further. We multiply the previous model by this variable and integrate on the domain.
\int_\Omega \nabla\cdot(\kappa^\delta \nabla u^\delta) p = \int_\Omega \nabla\cdot(\kappa \nabla u) p
Then writing the weak form we have
\int_\Omega \kappa^\delta \nabla u^\delta \nabla p \int_\Omega\kappa^\delta \frac{\partial u^\delta}{\partial\mathbf n}p = \int_\Omega \kappa\nabla u\nabla p \int_\Omega\kappa\frac{\partial u}{\partial\mathbf n}p
we expand the perturbed diffusion coefficient as \kappa^\delta=\kappa +\alpha\delta\kappa and rearrange terms by u^\delta u ( =\alpha\delta u ). We divide by \alpha as previously and makes \alpha\rightarrow 0 , we have
\int_\Omega \kappa \nabla \delta u \nabla p \int_{\partial\Omega} \kappa \frac{\partial \delta u }{\partial\mathbf n}p \approx \int_\Omega \delta\kappa\nabla u \nabla p +\int_{\partial\Omega} \delta\kappa \frac{\partial u}{\partial\mathbf n}p
We integrate by part a second time
\int_\Omega \delta u \nabla\cdot(\kappa \nabla p) +\int_{\partial\Omega} \left( \kappa \frac{\partial p }{\partial\mathbf n}\delta u  \kappa \frac{\partial \delta u }{\partial\mathbf n}p \right) \approx \int_\Omega u \nabla\cdot(\delta\kappa \nabla p) \int_{\partial\Omega} \left( \delta\kappa \frac{\partial p}{\partial\mathbf n}u +\delta\kappa \frac{\partial u}{\partial\mathbf n}p \right)
we obtain finally for p=0 on the boundary
\int_\Omega \delta u \nabla\cdot(\kappa \nabla p) \approx \int_\Omega u\nabla\cdot(\delta\kappa \nabla p)
Now to compute the gradient, we recall the previous equation for J and we deduce from build from the previous equation the following model (adjoint equation) for the state variable p
\begin{cases} \begin{aligned} \displaystyle \nabla\cdot(\kappa\nabla p) &= (u  u_\text{objs}) \\ u &= 0 \quad \text{on}\;\partial\Omega \end{aligned} \end{cases}
If we multiply this equation by u^\deltau and integrate over the domain, we obtain
\begin{aligned} \int_\Omega \nabla\cdot(\kappa\nabla p)(u^\deltau) &= \int_\Omega (u  u_\text{objs})(u^\delta  u) \\ &\approx \int_\Omega (u  u_\text{objs})\delta u \\ &\approx \delta J \end{aligned}
Now if we write the weak form of this equation, we have
\delta J \approx\int_\Omega \kappa\nabla p\nabla \delta u \int_{\partial\Omega} \kappa\frac{\partial p}{\partial\mathbf n} \delta u
We apply the boundary condition
\begin{aligned} \delta J &=\int_\Omega \kappa\nabla p\nabla\delta u \\ &=\int_\Omega \delta\kappa\nabla p\nabla u \end{aligned}
We recall \kappa chosen as
\kappa=1+{k_0}_{\vert_{I_0}} + {k_1}_{\vert_{I_1}} + {k_2}_{\vert_{I_2}}
Then the we deduce the gradient from the derivatives
\nabla J(\kappa_0,\kappa_1,\kappa_2) = \left( \int_{I_0} \nabla p\nabla u, \int_{I_1} \nabla p\nabla u, \int_{I_2} \nabla p\nabla u \right)
So now we have a method to compute the gradient.
As the title suggest, this section will be dedicate to mesh applications. It is composed by
feelpp_mesh_partitioner
is a simple application which can generate a partitioned mesh and save it in a Feel++ specific json+hdf5
file format. The generated mesh can then be loaded very efficiently in parallel.
feelpp_mesh_partitioner
requires some options.
Name 
Description 
Default value 

dimension of the mesh 
3 

shape of the mesh elements 
Simplex 

number of desired partitions 


name or path to the mesh 


output filename prefix (without extension) 


output directory 
We are now using the feelpp/toolboxes:latest
docker images as described in Getting Started to demonstrate feelpp_mesh_partitioner
usage.
We use the meshes in src/feelpp/data/gmsh/primitives
in the docker image.
feelpp/toolboxes:latest
docker run ti v $HOME/feel:/feel feelpp/toolboxes:latest
We generate a mesh partitioned on 4 cores with the following command
feelpp_mesh_partitioner part 4 ifile src/feelpp/data/gmsh/primitives/torus.geo ofile torus
You should have in the current directory 4 files
ls torus*
torus.geo torus.h5 torus.json torus.msh
Now the file torus.json
can be loaded in a Feel++ application distributed on 4 cores.
Often we are interested in a set of partitioned meshes in order to do a speedup study.
feelpp_mesh_partitioner
is the right tool for that. Let’s consider a set of partitions \(\mathcal{P}=\{2, 4, 8, 16, 32 \}\).
feelpp_mesh_partitioner part 2 4 8 16 32 ifile src/feelpp/data/gmsh/primitives/torus.geo odir torus
You should have in the directory torus
(thanks to the odir
option) 5 partitioned meshes
ls torus*
torus_p16.h5 torus_p2.h5 torus_p32.h5 torus_p4.h5 torus_p8.h5
torus_p16.json torus_p2.json torus_p32.json torus_p4.json torus_p8.json
The mesh filenames contain the partition information. 
When we have partitoned a mesh with feelpp_mesh_partitioner
, we would naturally like to read the output file in order to extract data and work on. That’s the purpose of mesh.cpp
.
From the file given by the option mesh.filename
, the programm can extract the data and load the associated mesh into our execution. With this, we can give a json file, obtained from feelpp_mesh_partitioner
and it will retrieve the parts of the original mesh.