This page provides code blocks of several examples that may be used to perform Fluid-Structure Interaction (FSI) computations.
In addition to implicit declarations with boundary conditions in the GUI, internal structures may be declared in the cs_user_model or cs_user_parameters function. For example, to declare 3 coupled structures:
Coupling with code_aster can be declared in a similar manner, using:
Whether coupled structures are defined using the GUI or as above function, their association with boundary zones may be completed or modified in the cs_user_fsi_structure_num function from the cs_user_fluid_structure_interaction.c file.
In the following example, 2 different structures are each associated to a boundary group:
This type of association is not necessary using the GUI in simple cases, but could be used to associate multiple boundary zones to a common structure for example, or conversely, associated different structures to different portions of a given zone (for example, if a single zone contains multiple tubes, so as to simplify fluid BC definitions, separate structures could be associated to each tube using sub-selections).
In the next example, the same face groups are coupled with an external (code_aster) structure.
Note that in this case, only the (negative) sign of the structure number is used, not the actual number, so both groups of faces are coupled to the same code_aster instance.
Various global and individual parameters associated to internal structures can be controlled with functions from cs_user_fluid_structure_interaction.c.
Initial positions and other parameters associated with internal structure coupling may be defined using the cs_user_fsi_structure_define function.
For each internal structure one can here define:
vstr0
xstr0
(i.e. xstr0
is the value of the displacement xstr compared to the initial mesh at time t=0)xstreq
. xstreq
is the initial displacement of the internal structure compared to its position at equilibrium; at each time step t and for a displacement xstr(t)
, the associated internal structure will be subjected to a force due to the spring:
When starting a calculation using ALE, or re-starting a calculation with ALE basing on a first calculation without ALE, an initial iteration 0 is automatically calculated in order to take initial arrays xstr0
, vstr0
and xstreq
into account. In another case, set the following option
in the cs_user_parameters function, so that the code can deal with arrays xstr0
, vstr0
or xstreq
.
Note that xstr0
, xstreq
and vstr0
arrays are initialized at the beginning of the calculations to the value of 0.
In the following example:
xstr0
of 2 meters in the y direction and a displacement compared to equilibrium xstreq
of 1 meter in the y direction.vstr0
in the z direction of structure 1 equals -0.5 m/s.Here one can modify the values of the prediction coefficients for displacements and fluid forces in internal FSI coupled algorithm.
The use of these coefficients is reminded here:
The following code snippet redefines theses advanced coefficients for predicted displacements and predicted force:
The time plotting behavior of internal structures may also be modified in this same function. The following example shows how the default output format and interval may be modified:
The output interval is based on a standard cs_time_control_t logic, so time-based or more advanced user-defined behavior may de used here. It is recommended not to use a too large interval, so that sampling does not miss important signal characteristics.
Note also that the movement of the internal fluid structure is computed using a Newmark method, whose parameters can also be modified by calling the cs_mobile_structures_set_newmark_coefficients function.
Some internal structure parameters, although usually fixed, may be time-varying in complex models, so they may be defined and changed using the cs_user_fsi_structure_values function, which is called at each time step when internal mobile structures are present.
For each internal structure one defines here:
xmstru
)xcstru
)xkstru
)The forstr
array stores fluid stresses acting on each internal structure. Moreover it is possible to take external forces (gravity for example) into account, too.
The xstr
array indicates the displacement of each structure compared to its position in the initial mesh.
The xstr0
array gives the displacement of the structures in initial mesh compared to structure equilibrium.
The vstr
array contains the structure velocities.
The xstr
, xstr0
, and vstr
arrays are data tables that can be used to define arrays mass, friction and stiffness. THOSE ARE NOT TO BE MODIFIED.
The 3D structure equation that is solved is:
where stands for the structural displacement compared to initial mesh position (
xstr
) and represents the displacement of the structure in the initial mesh compared to equilibrium.
Note that ,
and
are 3x3 matrices.
This equation is solved using a Newmark HHT algorithm. Note that the time step used to solve this equation (dtstr
) can be different from the one of fluid calculations. user is free to define dtstr
array. At the beginning of the calculation dtstr
is initialized to the value of dt
(fluid time step).
Two examples of definition of the mass, the friction coefficient and the stiffness of an internal structure are provided hereafter.
For code_aster coupling, it is sufficient to declare a coupling as described in the earlier section and possibly select associated faces.
Currently, multiple structures associated to faces associated with code_aster are handled in a grouped manner,so the structure number has no importance, as long as it is negative. In the future, in case of coupling with multiple instances of code_aster, we could assign different structures to different coupling instances.