You are on page 1of 12

WB1417-05/2010 Fluid-Structure Interation Discrete Geometric Conservation Law

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

∂Ω

Figure 1: Computational domain

 
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.

Geometric Conservation Law


One of the viewpoints on the significance of the GCL is that it ensures uniform flow to remain
uniform on arbitrarily moving meshes. This feature is used to derive first of all the continous
GCL.

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

Figure 2: Discrete domain of a single control volume Vi .

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

Exercise What do the left and right sides of (4) represent?

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

• θ-scheme The θ-scheme is a combination between a Backward Euler (θ = 1) and Forward


Euler (θ = 0) integration scheme. It obtains a second order accuracy when θ = 12 . The
integration of a quantity φ yields
φn+1 − φn
+ θR(φn+1 ) + (1 − θ)R(φn ) = 0, (7)
∆t
wherein R(φn+1 ) is the spatial discretization, evaluated at the implicit time level tn+1 and
R(φn ) is the spatial discretization, evaluated at the explicit time level tn .

• 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

which is enforced for each face individually


∆Vfn+1
 n+1
ace d~x
= · ~nS , (11)
∆t dt f ace

so that the face normal velocity ( d~


x
n)n+1 should be
dt · ~

d~x ∆Vfn+1
ace
( · ~n)n+1 = , (12)
dt ∆tS

3
WB1417-05/2010 Fluid-Structure Interation Discrete Geometric Conservation Law

in order to ensure that the D-GCL is satisfied.


Exercise Derive the D-GCL for the BDF2 scheme
Exercise Derive the D-GCL for the θ-scheme
Exercise Derive the D-GCL for the ESDIRK-scheme

Simulation of uniform flow on a one-dimensional moving mesh


Next we investigate the simulation of uniform flow on a moving mesh and the disturbances
that can be generated when not satisfying the D-GCL. The matlab files necessary are stored in
folder matlab\DGCL-1D\. We start with the example shown in the lectures for a one-dimensional
testcase (Fig. 3) for which an exact mesh motion is known:

cell center
i−1 i i+1 cell face
i−1/ 2 i+1/ 2

Figure 3: One dimensional mesh.

x = x0 + ∆x0 sin(2πx0 ) sin(2πt), (13)


dx
= 2π∆x0 sin(2πx0 ) cos(2πt), (14)
dt
wherein x0 = x(t = 0) and ∆x0 = 1/N , with N the number of finite volume cells to discretize
the domain [0,1]. The model that is discretized in given in (2). We assume a constant scalar
field u, so that F (u) is constant as well and can be eliminated from the equation. As long as u
remains uniform, this is correct. However, for the sake of simplicity, we do not add the influence
of the numerical flux F to the equation when the solution does not remain uniform (when the
D-GCL is violated). The model is therefore
 
d dx
Z I
udV − u · ndS = 0, (15)
dt Ωi ∂Ωi dt
for which the boundary integral reduces to a sommation of a left and right face contribution:
   
d dx dx
(uV )i + u − u = 0, (16)
dt dt i−1/2 dt 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

Vin+1 − uni Vin un+1 n+1 


dx n+1 un+1 + un+1
 n+1
un+1 i−1 + ui

i i i+1 dx
+ − = 0, (18)
∆t 2 dt i−1/2 2 dt i+1/2
or,
" #
∆t dx n+1 ∆t dx n+1
   
Vin+1+ − un+1
2 dt i−1/2 2 dt i+1/2 i
" # "  n+1 #
∆t dx n+1
 
∆t dx
+ un+1
i−1 − un+1 = Vin uni , (19)
2 dt i−1/2 2 dt i+1/2 i+1

4
WB1417-05/2010 Fluid-Structure Interation Discrete Geometric Conservation Law

which results in a system


Lun+1 = Run . (20)
The matlab program dgcl BE.m sets-up this system of equations and solves the system for every
time step. The influence of the DGCL is through the ( dx
dt ) terms in L.

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?

Table 1: Time step and formst settings.


case ∆t fmt
1 0.1 ’-b’
2 0.05 ’-r’
3 0.025 ’-g’

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

Simulation of uniform flow on a moving two-dimensional mesh


In this exercise, the D-GCL is applied to two-dimensional mesh motion. The mesh contains 9
cells (Fig. 4), and the motion that is prescribed is a rotation of the cell that is in the center of

Figure 4: Two dimensional mesh.

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

which means that we need the mesh velocities d~


x
dt at the cell faces, which are determined from
the DGCL. The system to be solved in (25) can also be written as

Lun+1 = Run . (26)

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:

• determine node locations,

• create cells by assigning 4 nodes for each cell,

• create connectivity information (for each cell face determine neighbor cells),

6
WB1417-05/2010 Fluid-Structure Interation Discrete Geometric Conservation Law

• intialization of data (solution, mesh velocities, cell volumes),

• for each time step:

1. compute displacements of nodes,


2. move the mesh (update node locations),
3. compute new volumes,
4. compute mesh velocity,
5. construct L, R and solve system to obtain new solution.

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 connectivity.m Determines the neighboring cells for all faces.

compute facecenter.m Computes the center of the face (or edge).

compute faceSN.m Computes the face normal and surface (in 2D this is the outward pointing
normal and edge length).

compute meshVelocity.m Computes the mesh velocity for the faces.

movemesh.m Updates the mesh nodes to the new location.

plotMesh.m Displays the mesh and creates colors depending on skewness of the cells.

plotSolution.m Displays the solution on the given mesh.

Mesh velocity computation


The mesh velocity computation is obtained from the displacement of a cell face from tn to tn+1 ,
see Fig. 5. From (12) we know that the normal velocity component of the mesh velocity should

nS n
cn cn+1
nS n+1

Figure 5: Two dimensional mesh.

satisfy
d~x n+1
∆Vfn+1
ace
( · ~n) = n+1
,
dt ∆tS

7
WB1417-05/2010 Fluid-Structure Interation Discrete Geometric Conservation Law

therefore, a finite difference of the displacement of the face center

d~x n+1 ~cn+1 − ~cn


( ) = , (27)
dt ∆t
does not generally satisfy the D-GCL.

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

Mesh motion for two-dimensional mesh


In this exercise, the Radial Basis Function interpolation is used for mesh deformation. In the
previous exercise for the DGCL, a two-dimensional mesh with 9 cells was used (Fig. 4). This
meant that when the displacement on the outer boundary was set equal to zero and the four
internal points were rotated, all mesh points were on a boundary so that no internal mesh nodes
were present. We will use the same program, but this time with N = M = 11 cells.
Matlab code
The matlab code that is available for this exercise can be found in matlab\MeshDef\. The files
that are important in this exercise are:
dgcl BE 2D.m This is the main program; it takes the following steps:
• determine node locations,
• create cells by assigning 4 nodes for each cell,
• create connectivity information (for each cell face determine neighbor cells),
• intialization of data (solution, mesh velocities, cell volumes),
• for each time step:
1. compute displacements of nodes,
2. move the mesh (update node locations),
3. compute new volumes,
4. compute mesh velocity,
5. construct L, R and solve system to obtain new solution.

moveMesh.m Updates the mesh nodes to the new location.

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.

Radial basis function interpolation


The displacements of the domain boundary Db, located at Xb have to be interpolated to dis-
lacements Di at the internal node locations Xi. For the interpolation, a displacement field is
computed using radial basis functions. The displacement at any location x is approximated by
a sum of basis functions
Nb
X
s(x) = γj φ(||x − xbj ||) + q(x), (28)
j=1

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

s(Xbj ) = Dbj , (29)

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

φ(||x||) = ||x||2 ln ||x||, (31)

and the polynomial is defined by

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.

2. Compute the coefficients P

3. Evaluate the interpolation function for each internal node.

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

Table 2: Simulation time, displacement mode and format settings.


case Np absdisp fmt
1 0.25 1 ’-b’
2 0.25 0 ’-r’
3 2.0 1 ’-g’
4 2.0 0 ’-c’

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

(1 − ||x||/r)4 (4||x||/r + 1) : ||x|| ≤ r



φ(||x||) = , (34)
0 : ||x|| > r

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

A Butcher tableau for 4-stage ESDIRK scheme

Table 4: Third order ESDIRK


c1 0 0 0 0
1767732205903 1767732205903
c2 4055673282236 4055673282236 0 0
2746238789719 640167445237 1767732205903
c3 10658868560708 - 6845629431997 4055673282236 0
1471266399579
c4 7840856788654 - 4482444167858
7529755066697
11266239266428
11593286722821
1767732205903
4055673282236
1471266399579 4482444167858 11266239266428 1767732205903
bi 7840856788654 - 7529755066697 11593286722821 4055673282236

12

You might also like