Professional Documents
Culture Documents
Introduction
In fluid-structure interaction simulations, the fluid equations are solved on a deforming mesh.
An often used method for dealing with deforming meshes is the Arbitrary Lagrangian-Eulerian
(ALE) approach, which allows the fluid dynamics equations to be solved on arbitrarily mov-
ing/deforming control volumes. When using the ALE approach, a Geometric Conservation Law
(GCL) can be identified that ties the mesh deformation to mesh velocities, used in the governing
equations. In this exercise we will investigate the GCL for a range of simple test problems.
Governing equations
A general formulation for the fluid dynamics equations on a domain Ω is
Ωi
∂Ω
d d~x
Z I
UdV + F(U) − U · ~ndS = 0, (1)
dt Ω ∂Ω dt
wherein U the conservative variables (ρ, ρ~u, ρE), F the flux vector containing convective and
diffusive terms, d~
x
dt the mesh velocity, ~
n the outward pointing normal to surface ∂Ω. Suppose we
discretize the domain Ω using a finite number of volumes Ωi , we can write for a single volume
d d~x
Z I
UdV + F(U) − U · ~ndS = 0. (2)
dt Ωi ∂Ωi dt
This will be the starting point for deriving the continuous Geometric Conservation Law, and
the semi-discrete and discrete versions.
Continuous GCL
In the derivation we assume U = U0 to be uniform in the domain Ω and hence one may expect
that F0 = F(U0 ) also uniform. The control volume Ωi has a closed surface ∂Ωi .
Exercise Derive the GCL by substitution of U0 into (2)
Note that up till now, the relation still uses continous functions and the continous GCL is inde-
pendent of the discretization method used for numerically solving the fluid dynamics equations.
1
WB1417-05/2010 Fluid-Structure Interation Discrete Geometric Conservation Law
For certain methods, such as space-time discretizations, the GCL is generally satisfied in a nat-
ural way. For other discretization approaches, such as finite-volume discretizations, this may
not be the case. Since a major part of engineering CFD codes use the finite volume approach,
we continue in a finite-volume framework for obtaining the semi-discrete formulation of the GCL.
Semi-discrete GCL
First the control volume Ωi is discretized to Vi and its boundary ∂Ωi to a sommation of discrete
faces (or edges in 2D), as shown in Fig. 2. The spatial integrals are discretized using
S3
S2
Vi
Ωi S4
S1
∂Ω i
I
d~x X d~x
· ~ndS ≈ · ~nS , (3)
∂Ωi dt dt f ace
f aces
with S the face surface area for each disrete face, so that we obtain the semi-discrete GCL
d X d~x
Vi = · ~nS . (4)
dt dt f ace
f aces
Discrete GCL
In (4) we still have a temporal derivative. To obtain a fully discrete equation a wide variety
of time integration schemes can be chosen to discretize the temporal derivative. Here we will
consider four implicit integration schemes:
• Backward Euler The first order Backward Euler scheme is quite popular due to its
simplicity and stability. The integration of a quantity φ yields
φn+1 − φn
+ R(φn+1 ) = 0, (5)
∆t
wherein R(φn+1 ) is the spatial discretization, evaluated at the implicit time level tn+1 .
• BDF2 The second order Backward Differencing scheme is often used in CFD codes. It
obtains a second order accuracy by using the state of an additional time level tn−1 . The
integration of a quantity φ yields
α1 φn+1 − α2 φn + α3 φn−1
+ R(φn+1 ) = 0, (6)
∆t
wherein α~ = ( 32 , −2, 12 ) for BDF2 and R(φn+1 ) is the spatial discretization, evaluated
at the implicit time level tn+1 . Since the method needs data at time level tn−1 , which is
generally unavailable at tn = t0 , the first time step is generally performed with a Backward
Euler scheme for which α ~ = (1, −1, 0).
2
WB1417-05/2010 Fluid-Structure Interation Discrete Geometric Conservation Law
• ESDIRK The ESDIRK schemes are a class of multi-stage Runge-Kutta schemes. The
general formulation for an s-stage scheme is denoted by
k
φ(k) − φn X
+ akj R(φ(j) ) = 0, (8)
∆t
j=1
s
φn+1 − φn X
+ bj R(φ(j) ) = 0
∆t
j=1
for which the coefficients a and b are generally written as a Butcher-tableau. For example,
a 4-stage ESDIRK scheme has the following Butcher-tableau
c1 0 0 0 0
c2 a21 γ 0 0
c3 a31 a32 γ 0
c4 a41 a42 a43 γ
b1 b2 b3 b4
The abbreviation ESDIRK stands for Explicit first stage (a1 1 = 0), Single diagonal co-
efficent (aii = γ), Diagonally Implicit (ai j = 0, ∀j > i) Runge-Kutta scheme, which is
reflected in the Butcher tableau. The method may also use bi = asi in which case the
solution of the final stage is already the solution at tn+1 (φn+1 = φ(s) ).
As shown in the lecture, the change in volume of the cell is decomposed into volume changes
caused by the motion of each cell face individually:
X
V n+1 − V n = ∆Vfn+1
ace , (9)
f aces
wherein ∆Vfn+1
ace the so-called swept-volume for a face moving from its location at tn to its
location at tn+1 . Therefore, we obtain for the Backward Euler scheme the following Discrete-
GCL (D-GCL)
V n+1 − V n X ∆Vfn+1 ace
X d~x n+1
= = · ~nS , (10)
∆t ∆t dt f ace
f aces f aces
d~x ∆Vfn+1
ace
( · ~n)n+1 = , (12)
dt ∆tS
3
WB1417-05/2010 Fluid-Structure Interation Discrete Geometric Conservation Law
cell center
i−1 i i+1 cell face
i−1/ 2 i+1/ 2
wherein we use a simple avarage to approximate the solution at the cell faces i ± 1/2:
ui + ui+1
ui+1/2 = . (17)
2
When e.g. a Backward Euler time integration is chosen, (16) and (17) result in
4
WB1417-05/2010 Fluid-Structure Interation Discrete Geometric Conservation Law
Backward Euler For the Backward Euler scheme, the swept volumes of the faces reduce to
a change in position of the face coordinate χ and therefore its D-GCL (12) becomes
n+1
χn+1 − χn
dx
= , (21)
dt ∆t
which is implemented into the matlab file dgcl BE.m, along with the options to choose the exact
mesh velocities at tn+1/2 and tn+1 .
Exercise In dgcl BE.m we set N = 20, tend = 10 and for each method=1,2,3 we set the
time step and plot format according to Table 1. When switching from one method to the
other, you can close the figures to start a clean plot. You can verify that satisfying the D-GCL
preserves the constant solution. By judging the amplitude decrease in the solution at tend for
various ∆t one can judge the order of the error with respect to ∆t, e.g. when the amplitude
≈ halves when ∆t is halved, the error reduces with O(∆t). Which orders do you find for
method=1,2?
Exercise Write the D-GCL you derived for the BDF2 scheme in terms of the face locations
χn−1 , χn , χn+1 and the coefficients α
~ . Implement the D-GCL into dgcl BDF2.m. We set N =
20, tend = 10 and for each mesh velocity method method=1,2,3 we set the time step and
plot format according to Table 1. Verify you implemented the D-GCL correctly so that the
constant solution is preserved. Which orders for the convergence of the error do you find for
method=1,2?
Exercise Write the D-GCL you derived for the θ-scheme in terms of the face locations
χn , χn+1 , the coefficient θ and the mesh velocity at tn ( dx n
dt ) . Implement the D-GCL into
dgcl theta.m. We set N = 20, tend = 10, theta = 0.5 and for each mesh velocity method
method=1,2,3 we set the time step and plot format according to Table 1. Verify you imple-
mented the D-GCL correctly so that the constant solution is preserved. Which orders for the
convergence of the error do you find for method=1,2? Redo the computation for method = 1
and this time set tend = 10.2
5
WB1417-05/2010 Fluid-Structure Interation Discrete Geometric Conservation Law
the domain. Again we use (2) as governing equation and assume that the solution is a constant
scalar u so that the flux F (u) drops out of the equation. We therefore obtain
d d~x
Z I
udV − u · ~ndS = 0. (22)
dt Ωi ∂Ωi dt
The boundary integral now becomes a sommation over 4 cell faces (edges):
4
d d~x
Z X
udV − u · ~nS = 0, (23)
dt Ωi dt j
j=1
and again we use a simple average to define the solution u at the internal faces
ucell1 + ucell2
uj = , (24)
2
as all of the internal faces have two neighboring cells. For the boundary faces we just use the
value of the neigboring cell. Discretization in time with a Backward Euler scheme yields
4 n+1
un+1
i Vin+1 − uni Vin X d~x
− u · ~nS = 0, (25)
∆t dt j
j=1
Matlab code
The matlab code that is available to solve this problem can be found in matlab\DGCL-2D\and
consists of the following files:
dgcl BE 2D.m This is the main program; it takes the following steps:
• create connectivity information (for each cell face determine neighbor cells),
6
WB1417-05/2010 Fluid-Structure Interation Discrete Geometric Conservation Law
create mesh.m Creates the cell datastructure (each cell consists of 4 nodes)
compute cellvol.m Computes the volume (in 2D surface) of the cell defined by 4 nodes.
compute faceSN.m Computes the face normal and surface (in 2D this is the outward pointing
normal and edge length).
plotMesh.m Displays the mesh and creates colors depending on skewness of the cells.
nS n
cn cn+1
nS n+1
satisfy
d~x n+1
∆Vfn+1
ace
( · ~n) = n+1
,
dt ∆tS
7
WB1417-05/2010 Fluid-Structure Interation Discrete Geometric Conservation Law
Example Use the following settings: number of time steps per period NdtP = 10 and num-
ber of periods to simulate Np = 2, and run the script dgcl BE 2D.m. From the results you can
observe that the solution does not remain uniform. Using smaller time steps by increasing NdtP
= 20, 40 shows that the error decreases approximately with O(∆t).
Exercise Write the swept volume ∆Vfn+1 nS n+1 , ~nS n ,
ace in terms of the geometric parameters ~
~cn+1 , ~cn and write an expression for ( d~
x n+1
dt ) that satisfies the D-GCL.
The expression derived above can be implemented into compute meshVelocity.m, and you
can verify that the solution remains uniform.
Exercise Modify the Matlab code for integration with the ESDIRK-method. You can do this
by making a loop over the number of ESDIRK stages within the loop P for the time steps. The
time level in a stage k is computed by tk = tn + ck ∆t, where ck = ki=1 aki . The coefficients
(k)
for a 4-stage ESDIRK scheme can be found in App. A. Write the swept volume ∆Vf ace in
terms of the geometric parameters ~nS (k) , ~nS n , ~c(k) , ~cn and write an expression for ( d~
x (k)
dt ) that
satisfies the D-GCL.
8
WB1417-05/2010 Fluid-Structure Interation Mesh deformation
plotMesh.m Displays the mesh and creates colors depending on skewness of the cells.
Mesh interpolation
When we run the program with NdtP=20, Np=0.25, N=M=11, maxAngle=45, you will find that
the center cell rotates, but that all internal nodes do not move. We are going to implement a
mesh motion algorithm, based on a radial basis funtion interpolation. First of all, the function
determines the number of internal and boundary points and splits the vector of all the nodes
into a vector containing only the boundary node coordinates Xb and boundary displacements
Db and a vector containing the internal node coordinates Xi and the yet unknown vector of
internal displacements Di.
9
WB1417-05/2010 Fluid-Structure Interation Mesh deformation
where Nb the number of boundary points, xbj are the centres on the domain boundary in which
the values for the displacement d = (dx dy )T are known, q a polynomial, and φ a given radial
basis function with respect to the Euclidean distance ||x||. The coefficients γj and the polynomial
q are determined by the interpolation conditions
with Db a vector containing the discrete values of the displacement at the mesh boundary, Xb
a vector containing the coordinates of the boundary points and the additional requirements
Nb
X
γj s(Xbj ) = 0. (30)
j=1
The radial basis function that we will use is the Thin-Plate-Spline (TPS) radial basis function
defined as
q(x) = c0 + cx x + cy y. (32)
A separate interpolation function is made for the displacements in x and y direction. The
requirements in (29) and (30) result in a linear system of equations that defines the RBF
interpolation function coefficients γ and c, e.g. for the displacements in x:
Dx Φ L γx
= , (33)
0 LT 0 cx
wherein the matrix Φ contains the evaluation of the radial basis functions Φij = φ(||xi − xj ||),
L is the matrix for the linear polynomial Li = (1 xi yi ). Once the system is solved and the
coefficients γx and cx are obtained, the x displacements of the internal nodes can be computed
by evaluating (28) for all internal mesh point locations Xi . Note that for the dislacements in y,
essentially the same system of equations has to be solved as Φ and L are the same.
The implementation is performed in several steps in moveMesh.m:
1. Setting up the matrix rbfMat for the constraints, such that Db = rbfMat*P, with P a
vector containing the coefficients γ and c0 , cx , cy of the linear polynomial.
Note that the interpolation is broken down into two steps: 1) determine the RBF coefficients
and 2) evaluate the interpolation function at each internal grid point.
Exercise Implement the mesh deformation steps in moveMesh.m for the Thin-Plate-Spline ra-
dial basis function φ = ||x||2 ln ||x||. This time when you run the code with NdtP=20, Np=0.25,
N=M=11, maxAngle=45, you will find that the mesh deforms smoothly. At the end of the sim-
ulation the mesh orthogonality is plotted as is a plot of the mesh orthogonality in time.
Absolute or relative displacements The displacement of the mesh nodes can be com-
puted either from the intitial mesh (absolute displacements) or from the mesh at tn (relative
displacements). Which method is used can be selected by setting absdisp = 1 for absolute
10
WB1417-05/2010 Fluid-Structure Interation Mesh deformation
displacements or absdisp = 0 for relative displacements. Close all figures and use the following
settings: NdtP=20, N=M=11, maxAngle=90. Run computations using the settings from Table 2.
Exercise Discuss which method performs best when comparing cases 1 and 2 are compared.
Explain the differences in results for computations 3 and 4; what would happen when the
simulation time is increased?
Number of steps per period When using the relative interpolation, the number of steps
performed per period is of importance. To investigate, we use the settings: Np=1, N=M=11,
maxAngle=90. Close all figures and run computations using the settings from Table 3.
Table 3: Number of steps per period, displacement mode and format settings.
case NdtP absdisp fmt
1 40 1 ’-b’
2 20 1 ’–b’
3 10 1 ’ob’
4 5 1 ’xb’
5 40 0 ’-r’
6 20 0 ’-g’
7 10 0 ’-c’
8 5 0 ’-m’
Exercise Discuss the results for the mesh quality for the absolute displacement method
and for the relative displacement method with respect to the number of time steps taken per
period.
Exercise What are your overall conclusions comparing the absolute and relative displace-
ment methods?
Exercise So far we only used the TPS RBF for the mesh deformation, you could also use
a compact supported function (like the C 2 function of Wendland). Implement a radial basis
function mesh deformation based on the compact supported radial basis function
wherein r the support-radius. Perform an investigation into the influence of the support radius
on the mesh quality and discuss the results.
Extra So far we always added the linear polynomial to the RBF function so that it should
recover translations and rotations exactly; you can verify this by treating the outer boundary
points as internal points as well (in dgcl BE 2D.m, comment the loop for nodeID=staticIDs
- approximately line 94).
11
WB1417-05/2010 Fluid-Structure Interation
12