1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
|
/*============================================================================
* Code_Saturne documentation page
*============================================================================*/
/*
This file is part of Code_Saturne, a general-purpose CFD tool.
Copyright (C) 1998-2018 EDF S.A.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*----------------------------------------------------------------------------*/
/*!
\page cs_user_fluid_structure_interaction Fluid Structure Interaction (cs_user_fluid_structure_interaction.f90)
\section cs_user_fluid_structure_interaction_h_intro Introduction
This page provides code blocks of several examples that may be used
to perform fluid structure interaction computations.
\section cs_user_fluid_structure_interaction_h_usstr1 Internal structures and corresponding initial conditions
\subsection cs_user_fluid_structure_interaction_h_usstr1_init Initialization
The \c lstelt array is allocated.
\snippet cs_user_fluid_structure_interaction.f90 usstr1_init
\subsection cs_user_fluid_structure_interaction_h_usstr1_example Example
The following code block provides an example of definition of two internal
structures.
Here one fills array \c idfstr(\ref nfabor). For each boundary face \c ifac,
\c idfstr(ifac) is the number of the structure the face belongs to
(if \c idfstr(ifac) = 0, the face ifac doesn't belong to any structure.
When using internal coupling, structure number necessarily needs to be positive
(as shown in following examples).
The number of "internal" structures is automatically defined with the
maximum value of \ref idfstr table, meaning that internal structure numbers must
be defined sequentially with positive values, beginning with integer value 1.
In the following example, boundary faces with color 4 belong to internal structure 1.
Boundary faces with color 2 belong to internal structure 2.
The total number of internal structures equals 2.
The boundary faces are identified using the \ref getfbr subroutine.
\snippet cs_user_fluid_structure_interaction.f90 usstr1_example_a
For each internal structure one can here define :
- an initial velocity \c vstr0
- an initial displacement \c xstr0 (i.e. \c xstr0 is the value of the
displacement \ref xstr compared to the initial mesh at time t=0)
- a displacement compared to equilibrium \c \ref xstreq. \c \ref xstreq is the
initial displacement of the internal structure compared to its position
at equilibrium; at each time step t and for a displacement \ref xstr(t),
the associated internal structure will be subjected to a force due to the spring:
\f[
-k (xstr(t)+xstreq).
\f]
Note that \c xstr0, \c \ref xstreq and \c vstr0 arrays are initialized at the beginning
of the calculations to the value of 0.
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 \c xstr0, \c vstr0 and
\c \ref xstreq into account. In another case, set the following option
\code{.f90}
italin=1
\endcode
in subroutine \ref usipsu, so that the code can deal with arrays
\c xstr0, \c vstr0 or \c \ref xstreq.
In the following example :
- internal structure 1 has got an initial displacement \c xstr0 of 2 meters in
the y direction and a displacement compared to equilibrium \c \ref xstreq of
1 meter in the y direction.
- Initial velocity \c vstr0 in the z direction of structure 2 equals -0.5 m/s.
\snippet cs_user_fluid_structure_interaction.f90 usstr1_example_b
Here one can modify the values of the prediction coefficients for
displacements anf fluid forces in internal FSI coupled algorithm.
The use of these coefficients is reminded here :
- predicted displacement
\f[
\vect{X_{n+1}} = \vect{X_n} + aexxst \Delta t \vect{X^{\prime}_n} +
bexxst \Delta t (\vect{X^{\prime}_n}-\vect{X^{\prime}_{n-1}})
\f]
with \f$ \vect{X_n} \f$ standing for the displacement at iteration \f$ n \f$,
\f$ \vect{X^{\prime}_n} \f$ and \f$ \vect{X^{\prime}_{n-1}} \f$ representing the internal
structure velocity respectively at iteration \f$ n \f$ and \f$ n-1 \f$.
- fluid force sent to structure internal solver
\f[
\vect{F_{n+1}} = cfopre \vect{F_n} + (1-cfopre) \vect{F_{n-1}}
\f]
\f$ \vect{F_n} \f$ and \f$ \vect{F_{n-1}} \f$ standing for the fluid force acting on the
structure respectively at iteration \f$ n \f$ and \f$ n-1 \f$.
\snippet cs_user_fluid_structure_interaction.f90 usstr1_example_c
Activation of structural history output (i.e. displacement, structural
velocity, structural acceleration and fluid force)
(\c ihistr=0, disabled ; \c ihistr=1, enabled)
The value of structural history output step is the same as the one for
standard variables (\ref nthist).
\snippet cs_user_fluid_structure_interaction.f90 usstr1_example_d
\section cs_user_fluid_structure_interaction_h_usstr2 Structural parameters in case of Fluid Structure internal coupling
Note that the subroutine \ref usstr2 is called at each time step of the calculation.
For each internal structure one defines here :
- its mass \f$ \tens{M} \f$ (\c xmstru)
- its friction coefficient \f$ \tens{C} \f$ (\c xcstru)
- its stiffness \f$ \tens{K} \f$ (\c xkstru)
\c forstr array gives fluid stresses acting on each internal structure.
Moreover it's possible to take external forces (gravity for example) into
account, too.
\c \ref xstr array indicates the displacement of the structure compared to its
position in the initial mesh.
\c xstr0 array gives the displacement of the structures in initial mesh
compared to structural equilibrium.
\c \ref vstr array stands for structural velocity.
\c \ref xstr, \c xstr0, and \c \ref vstr arrays are data tables that can be used to define
arrays mass, friction and stiffness. THOSE ARE NOT TO BE MODIFIED.
The 3D structural equation that is solved is the following one :
\f[
\tens{M} \vect{X^{\prime\prime}} + \tens{C} \vect{X^{\prime}} + \tens{K} (\vect{X}+\vect{X_0}) = \vect{F}
\f]
where \f$\vect{X}\f$ stands for the structural displacement compared to initial mesh
position (\c \ref xstr) and \f$\vect{X_0}\f$ represents the displacement of the structure in initial mesh compared to equilibrium.
Note that \f$\tens{M}\f$, \f$\tens{C}\f$ and \f$\tens{K}\f$ are 3x3 matrices.
This equation is solved using a Newmark HHT algorithm.
Note that the time step used to solve this equation (\c dtstr) can be
different from the one of fluid calculations. user is free to define
\c dtstr array. At the beginning of the calculation \c dtstr is
initialized to the value of \c \ref dt (fluid time step).
\subsection cs_user_fluid_structure_interaction_h_usstr2_init Initialization
The matrices \c xmstru, \c xcstru and \c xkstru are set to zero.
\snippet cs_user_fluid_structure_interaction.f90 usstr2_init
\subsection cs_user_fluid_structure_interaction_h_usstr2_example_1 Example 1
Two examples of definition of the mass, the friction coefficient and the stiffness
of an internal structure are provided hereafter.
\snippet cs_user_fluid_structure_interaction.f90 usstr2_example_1
\subsection cs_user_fluid_structure_interaction_h_usstr2_example_2 Example 2
\snippet cs_user_fluid_structure_interaction.f90 usstr2_example_2
\section cs_user_fluid_structure_interaction_h_usaste Fluid Structure external coupling with Code_Aster
\subsection cs_user_fluid_structure_interaction_h_usaste1_init Initialization
The \c lstelt array is allocated.
\snippet cs_user_fluid_structure_interaction.f90 usaste_init
\subsection cs_user_fluid_structure_interaction_h_usaste_example Example
In the following example, two sets of boundary faces that will be coupled with
Code_Aster are defined as well as the fluid force components which are given
to structural calculations.
Here one fills array \c idfstr(\ref nfabor)
For each boundary face \c ifac, \c idfstr(ifac) is the number of the structure
the face belongs to (if \c idfstr(ifac) = 0, the face \c ifac doesn't
belong to any structure.)
When using external coupling with Code_Aster, structure number necessarily
needs to be negative (as shown in following examples).
The number of "external" structures with Code_Aster is automatically
defined with the maximum absolute value of \c idfstr table, meaning that
external structure numbers must be defined sequentially with negative
values beginning with integer value -1.
In following example, boundary faces with color 2 and which
abscissa \f$ x < 2 \f$ belong to external structure -1.
Boundary faces with color 2 and which abscissa \f$ x > 2 \f$ belong to external
structure -2. The total number of external structures coupled with
Code_Aster equals 2.
\snippet cs_user_fluid_structure_interaction.f90 usaste_example
*/
|