TRACE User Guide  TRACE Version 9.6.1
FSI Simulation with the Modal FSI Module

The modal FSI module allows to carry out coupled fluid-structure simulations in the time domain. The motion of the structure is approximated by the superposition of natural mode shapes. The modes must be computed beforehand in a structural modal analysis (eigenvalue analysis) with a structural FEM analysis tool (e.g. CalculiX). Each mode is modeled with a linear second-order ordinary differential equation (mass-spring-damper system) with the aerodynamics acting as an external force on the right hand side:

\begin{equation} \ddot{x}m + \dot{x}d + xk = f_{\text{aero}}. \end{equation}

The equation of motion for each mode is integrated in time with the Newmark scheme and the coupling between flow and structure is introduced by the subiterations of the pseudo timestepping method.

Real and complex modes are supported. If a complex mode is mapped then the imaginary part of the mode is treated as a second real mode (i.e. a second degree of freedom). If done so the user must take care of the CFD setup and the cyclic symmetry of the mode. Furthermore the supplied modal mass, stiffness and damping are used for both the real and imaginary part without modification. The user must take care of choosing the correct modal quantities: the modal mass/damping/stiffness which refers to the complex mode is double the modal mass which refers to only the real or imaginary part of the mode. The number of flow passages in the simulation must be such that no period boundary conditions with phase-lag are necessary. Otherwise the simulation could lead to unphysical results. For example: consider a cascade with a blade count of 50. A mode with an IBPA of \(72^\circ\) is chosen for analysis. With these prerequisites the TRACE setup must contain exactly 5, 10, 15, ... , 50 flow passages since a multiple of 5 always results in a phase shift of \(360^\circ\, \hat{=}\, 0^\circ\) between the perturbations at the two periodic boundaries.

A coupled modal FSI simulation consists of two steps:

  1. A steady computation to determine the mean modal force of all modes (if desired).
  2. A coupled simulation with the mean modal force as force offset.

The mean modal force needs to be used as force offset since the geometry of a blade usually already contains the deformations resulting from the mean aerodynamic force on the blade.

The following sections will describe the process with all necessary commands. If the mean modal force is not of relevance the section Calculation of the mean modal force can be skipped.

Calculation of the mean modal force

In order to calculate the mean modal force acting on all modes, these need to be mapped onto the CFD mesh before the steady simulation.

Example for the preprocessing:

PREP -cgns TRACE.cgns -rae
PREP --mapping -cgns TRACE.cgns --modename mode_name --panelFamily panelfamily_name -emf modefile_name -ft mode_filetype
PREP --modify -cgns TRACE.cgns --modename mode_name -mm 1.0 -mf 10.0 -ibpa 0.0
PREP --modify -cgns TRACE.cgns --modename mode_name -ems inactive

The first command removes all existing modes from a cgns file. The second command maps the displacements from a mode file onto the CFD mesh. For a steady computation the frequency and modal mass of a mode are meaningless but need to be set nevertheless since POST expects this value. The last command is necessary for the correct postprocessing of the modal forces after the steady simulation.

Notice that if a mode with an IBPA other than 0 is used the mean modal force is zero since then the steady pressure (which naturally has an IBPA of 0) is integrated against a mode with an IBPA unequal to zero which results in an integral modal force value of zero.

The TRACE simulation:

In gmc all preferences for a non-linear steady simulation need to be set. Furthermore the 2D cgns output must be active.

Example for the postprocessing:

With POST the modal forces can be computed from the 2D cgns output and written into a .json file as follows:

POST -i ../ouput/cgns/TRACE_2D.cgns -cae -aea -wae -f ../ouput/ae.json -o TRACE_2D_ae.plt

The option -cae computes the modal force per area for each combination of a mode with a flow solution. The option -aea integrates the resulting data and -wae writes the the data into a .json file (filename specified with -f).

Optionally the computed modal force per area can be written out as a separate file (-o TRACE_2D_ae.plt).

The coupled simulation

The preparation of an FSI simulation could look as follows:

Example for the preprocessing:

PREP -cgns TRACE.cgns -rae
PREP --mapping -cgns TRACE.cgns --modename mode_name --panelFamily panelfamily_name -emf modefile_name -ft mode_filetype
PREP --modify -cgns TRACE.cgns --modename mode_name -mm 1.0 -ms 1.0 -md 1.0 -mf 10.0 -ibpa 0.0 -mfof 0.1

The –modify options:

  • -mm – modal mass
  • -md – modal damping
  • -ms – modal stiffness
  • -mf – modal frequency (only important for the unsteady time-domain settings e.g. timesteps per period)
  • -ibpa – interblade phase angle (only important for the unsteady time-domain settings e.g. phase-lag at periodic boundaries, but using phase-lag for a flutter simulation is not yet recommended except the frequency of the resulting limit cycle oscillations is very well known a priori)
  • -mfof – mean force offset (this is the force offset which was computed in the previous section, assumed zero if not specified)

The force offset is introduced into the equation of motion as follows:

\begin{equation} \ddot{x}m + \dot{x}d + xk = f_{\text{aero}} - f_{\text{offset}}. \end{equation}

Thus the sign of the previously computed force offset does not need to be inverted. Notice that the modal mass is read from the mode file (specified with -emf modefile_name) if the file type is ".frd" and the modal mass value is available. Then the modal mass (-mm) does not need to be specified after the –mapping task.

The initial conditions can be set with the initialCondition task:

PREP -icon -cgns TRACE.cgns --modename mode_name -mdis 0.0 -mvel 1.0

The -icon options:

  • -mdis – initial modal displacement
  • -mvel – initial modal velocity

The mesh deformation of the FVM mesh for one mode is calculated with

PREP --deformation -cgns TRACE.cgns --modename mode_name -dpb -np 4

The option -dpb (dirichlet boundary condition on periodic boundaries) sets the mesh deformation at periodic boundaries to zero. Note that the (pre-) calculation of 3D mesh deformation is not necessary. If the mesh deformations for eigenmodes are not available and the modes are set to 'active', then TRACE will calculate the deformed mesh during the coupled simulation. This is especially helpful (and more efficient) if a very large amount of eigenmodes is used.

GMC can now be used to set the unsteady simulation preferences. Notice that only the time integration scheme BDF2 is available for the modal FSI functionality until now. Also the output 'write panel' should be active. The modal displacement, velocity, acceleration and force will be written for each mode in a separate file. After the use of GMC all modes need to be activated with PREP because GMC sometimes overwrites the mode status with 'inactive'. Furthermore the mode is set to coupled fluid-structure interaction mode with the PREP modify option '-mmm modalFSI':

PREP --modify -cgns TRACE.cgns --modename mode_name -ems active -mmm modalFSI

Now TRACE can be launched.

Using PREP with an Amplification Factor During the "--mapping" Task

The PREP "--mapping" task provides the possibility to specify an amplitude (scaling) factor (e.g. "-amp 0.01") which scales the deformation of the mode which is to be mapped. If this is the case care must be taken for the modal coefficient and force offset values which are specified in the "--modify" task. The new modal coefficients are computed according to

\begin{equation} m_{\text{scaled}} = a^{2} m_{\text{original}}, \quad d_{\text{scaled}} = a^{2} d_{\text{original}}, \quad k_{\text{scaled}} = a^{2} k_{\text{original}} \end{equation}

with \(a\) the scaling factor specified with "-amp". It is recommended to use the same amplification factor during the calculation of the mean modal force. Otherwise the force offset must be scaled according to \(f_{\text{offset, scaled}} = a f_{\text{offset, original}}\). If the modal mass is read from a mode file during the PREP "--mapping" task with the "--amp" option, the modal mass and stiffness is automatically modified as above. Alternatively the modal stiffness and damping coefficients can be computed from the modal mass, the eigenfrequency and the predefined logarithmic decrement \(\delta\) of the homogeneous system (without external aerodynamic force) according to:

\begin{equation} k = m \omega^2, \quad d = k \frac{\delta}{\pi\omega} \end{equation}

with \(\omega\) the eigenfrequency in rad/s. If the mode was scaled, the scaled modal mass must be used in the above equation.

Visualization of the mesh deformation with POST

The mesh deformation of a coupled simulation can be visualized with POST as follows:

POST -i ../output/movie/picture_%d/TRACE.cgns -amd -rmd -o MOV/pic_%d.plt -sts

The option -rmd makes POST use the current displacement from the coupled simulation data.

Using the Modal FSI Module with the Python Interface

Instead of the linear mass-spring-damper system used in the internal modal FSI module it is possible to provide a user function via the python interface which computes the modal dynamics at each time step. This way it is possible e.g. to implement nonlinear structural models or to define arbitrarily prescribed deformations. Multiple modes are allowed.

In order to use this functionality TRACE must be compiled with the python interface (which is activated by default). To mark a mode for the use with the python interface the option '-mmm pythonfunction' must be used in the PREP modify command (instead of -mmm modalFSI):

PREP --modify -cgns TRACE.cgns --modename mode_name -ems active -mmm pythonfunction

Furthermore a python script (e.g. 'userPythonFunctions.py') containing the function 'modalDynamics' must be provided via the TRACE command line:

TRACE -cgns TRACE.cgns -py userPythonFunctions.py

Here is an example of the file 'userPythonFunctions.py':

#!/usr/bin/env python3
import os
from tracesuite.trace import TRACE
trace = None
def initialization():
'''
Since the TRACE handle cannot be setup in the modalDynamics function (which is called from only
one process) it must be called in the initialization function!
'''
global trace
trace = TRACE.initialize()
def modalDynamics():
'''
This function is called when the new modal displacement, velocity and acceleration at the next time step
must be determined. It is called every pseudo time step per physical time step.
When trace.pseudoTimeStep==0 the modal force at the next time step (mode.force) is extrapolated (in TRACE)
from the last two time steps.
This way in the first call the modal dynamics can be predicted based on the extrapolated modal force
and in the remaining calls the calculation can be repeated with a more accurate modal force.
In this example the modal dynamics are calculated at the beginning of a time step (pseudo time step 0)
and this is repeated at pseudo time step 15. (In this example the number of pseudo time steps per
physical time step is 30 (couting from 0 to 29)).
When complex modes are used the quantities like modal displacement, force, ... are complex numbers.
In this case the user must take extra care of the correct CFD setup (using correct number of flow passages,
scaling the modal parameters (modal mass, modal stiffness, ...).
Example: For the real part of an eigenmode the modal mass is half of the mass of to the complex mode.
Using an eigenmode with an IBPA of 72°, 5 sectors/blades must be simulated (5*72=360).
The modal mass for the real or imaginary part in this case is modalMassOfComplexMode / 2 * 5.
'''
#loop over all existing eigenmodes
for mode in trace.eigenmodes:
if trace.pseudoTimeStep in [0,15]:
dt = mode.blockGroup.timeStepSize #get length of time step
m = mode.modalMass #the modal mass
d = mode.modalDamping #the modal damping
k = mode.modalStiffness #the modal stiffness
f = mode.force #the modal force at the next time step
#further useful quantities:
#mode.currentForce: the modal force at the current time step
#mode.forceOffset: static modal force (specified beforehand with PREP)
#mode.ibpa: inter-blade phase angle
#mode.amplificationFactor: The scaling/amplification factor used during the mapping with PREP
dc = mode.currentDisplacement #the modal displacement at the current time step
vc = mode.currentVelocity #the modal velocity at the current time step
ac = mode.currentAcceleration #the modal acceleration at the current time step
#Newmark time integration: compute the displacement, velocity and acceleration at the next timestep
beta = 1 / 6
gamma = 1 / 2
s = m / beta / dt ** 2 + gamma * d / beta / dt + k
f1 = d * gamma / beta / dt + m / beta / dt ** 2
f2 = d * gamma / beta - d + m / beta / dt
f3 = gamma * dt * d / 2 / beta - dt * d + m / 2 / beta - m
d = (dc * f1 + vc * f2 + ac * f3 + f) / s
v = gamma / beta / dt * (d - dc) + (1 - gamma / beta) * vc + (beta - gamma / 2) * dt / beta * ac
a = 1 / beta / dt ** 2 * (d - dc) - 1 / beta / dt * vc - (1 / 2 / beta - 1) * ac
mode.displacement = d #the modal displacement at the next time step
mode.velocity = v #the modal velocity at the next time step
mode.acceleration = a #the modal acceleration at the next time step
#trace.message(trace.pseudoTimeStep,f) #this would print the pseudo time step and the force