Finite Element simulations of blood flow in the Circle of Willis

advertisement
UNIVERSITY OF OSLO
Department of Mathematics
Finite Element
simulations of
blood flow in the
Circle of Willis
Master Thesis
Martin Sandve Alnæs
May 29th 2006
Preface
This thesis was written during the period August 2005 to May 29th 2006. It
is presented as part of the requirements for the master degree in Computational
Science, a specialization of the program Applied Mathematics, Mechanics, and
Numerical Physics at the Department of Mathematics, University of Oslo. My
supervisor has been Kent-André Mardal at Simula Research Laboratory.
First of all I want to thank my supervisor Kent-Andre Mardal for his guidance.
He has always been available for questions and discussions when needed. Simula
readily provided the computer resources necessary for all the heavy simulations,
together with an inspiring working environment. Thanks to all the people at Simula
who have provided the latter.
Another thanks go to Dr. Jørgen Isaksen and Dr. Tor Ingebrigtsen at the University Hospital of North Norway for help with finalizing the geometric model of
the Circle of Willis, and for help in searching the medical literature for articles I
used in validation of the simulations. Thanks to my uncle Svein for the hospitality
in Tromsø during my visit to UNN.
A five year long study now comes to an end, and in that context it is appropriate
to show my gratitude to the people who have been around me during this period. I
particularly wish to thank my fellow student Trygve Karper for all the discussions,
inspiration and great collaboration we have enjoyed throughout the study. He also
wrote the first version of the grid generation tools together with me in July 2005.
The weekly game evenings with Tommy André Nyquist, Johannes Oudenstad, Atle
Einarsson, Thomas Levy and Andreas Marienborg have been a great way to get my
mind off the thesis for a short while. And finally all the other students at B802,
Drivhuset and Realistforeningen have provided a social study environment during
all these years.
Last, but not the least, thanks to mom and dad, and my sisters Åste and Vilde,
for all their love and support through the years.
Martin Sandve Alnæs
May 2006
Contents
Chapter 1.
Introduction
1
Chapter 2. Blood modeling
2.1. Fluid flow equations
2.2. Blood properties
2.3. Initial conditions
2.4. Boundary conditions
2.5. Stresses
2.6. The final model
7
7
9
10
10
11
12
Chapter 3. Analytical solutions
3.1. Womersley flow
3.2. Manufactured polynomial profiles
3.3. General manufactured solutions
3.4. Analytical solutions as essential boundary conditions
13
13
15
17
17
Chapter 4. The Circle of Willis
4.1. Geometric description
4.2. In vivo measurements
4.3. Physical scales and Reynolds number
19
19
21
23
Chapter 5. Numerical methods
5.1. The Navier-Stokes equations
5.2. Weak formulation of the Navier-Stokes equations
5.3. Spacial discretization
5.4. Temporal discretization
5.5. The Preconditioned Richardson Iteration
5.6. Discrete projection method
5.7. Preconditioners
5.8. Nonlinear iteration
5.9. Multigrid
5.10. Calculating derived quantities
25
25
26
27
31
34
34
36
37
37
38
Chapter 6. Grid generation software
6.1. Software requirements
6.2. Parameterization
6.3. Input file description
41
41
42
46
Chapter 7. Simulations
7.1. Manufactured solutions
7.2. Cylinder
7.3. Flattened ICA
49
51
52
53
CONTENTS
7.4.
7.5.
7.6.
7.7.
7.8.
7.9.
Flattened Basilar Artery
Bifurcation
The Circle of Willis
Anterior CoW
Posterior CoW
Posterior CoW variations
Chapter 8.
Conclusions
55
61
62
64
65
69
73
Appendix A. Solver software
1.1. Installing the software
1.2. Using the software
1.3. input.params
1.4. Featflow details
77
77
77
79
81
Appendix B. CD contents
2.1. Casefiles
2.2. Datasets
2.3. Movies
2.4. Software
83
83
83
83
84
Bibliography.
85
List of Figures
1.1
1.2
4.1
4.2
4.3
The Circle of Willis from volume rendering of an angiography
image.
Computational model of the Circle of Willis
2
3
19
20
4.4
The Circle of Willis, picture from MRI scanning.
The Circle of Willis, time-averaged pressure.
Normalized flow rate shape for the Internal Cartoid Artery
re f
re f
(QICA (t)) and Vertebral Artery (QV A (t)).
Flow rate in ml/s for ICA and VA.
6.1
6.2
6.3
Crossection grid with two refinements.
Simple bifurcation grid.
Example input.grid file
42
45
47
7.1
Snapshot of cylinder simulations with different inflow velocity
profiles.
52
7.2
Pressure contours at peak systole on Ωica .
21
22
f lat
53
f lat
Ωica .
53
7.3
Pressure contours under diastole on
7.4
Maximum wall shear stress on Ωica .
7.5
Velocity profiles on entry and exit of Ωica .
55
7.6
f lat
Ωica .
56
7.7
7.8
7.9
7.10
7.11
f lat
54
f lat
Velocity profiles on entry and exit of
Flattened Basilar Artery,
f lat
Ωba
57
f lat
Ωba
with v = v9 (left) and
Velocity field on lower half of
v = vw (right) as inflow conditions.
f lat
Ωba
Average pressure and shear stress on walls of
with
symmetric (left) and asymmetric (right) pressure on outlets.
Velocity field (cut plane z=0) at the BA-PCA bifurcation in
f lat
Ωba just before peak systole.
Velocity field (cut plane z=0) at the BA-PCA bifurcation in
f lat
Ωba at peak systole.
57
58
58
59
f lat
7.12
Flow rates in main vessel and outlets of Ωba with asymmetric
pressure on outlets.
59
7.13
Pressures in the Ωba geometry with asymmetric outflow
pressure conditions.
f lat
60
LIST OF FIGURES
7.14
7.22
Streamlines and pressure from the full CoW grid at peak
systole (t=186).
Flow rates from simulation with the antcowright grid.
(Negative flow in PCoA means from anterior to posterior.)
Flow rates from simulation with the full CoW grid, main
vessels in the anterior/right part.
Pressure and streamlines colored by velocity from the
anterior/right part of the full CoW grid.
Pressure and streamlines colored by velocity from the
antcowright grid.
Pressure, WSS, and streamlines colored by velocity for the
re f
posterior part of Ωcow .
Pressure, WSS, and streamlines colored by velocity from
re f
Ω post .
Time-averaged pressure on posterior geometric variations
ang
Ωrad
post and Ω post (right).
τavg (a) and τmax (b) in geometric variations of Ω post
A.1
Example input.params file
7.15
7.16
7.17
7.18
7.19
7.20
7.21
63
65
66
66
67
67
68
69
70
80
CHAPTER 1
Introduction
The Circle of Willis (CoW) is a circle-like network of blood vessels at the base
of the brain. Four medium arteries (the Internal Cartoid and Vertebral arteries)
are connected by smaller “communicating” vessels which together form a ringlike structure, and six small arteries lead away from the circle. As the center of
the cerebral vascular system, it is critical that the CoW is working well. Failure to
deliver blood to regions of the cerebral system can lead to ischemia and eventual
infarction. A complete Circle of Willis gives alternative flow paths for the blood if
a vessel should be blocked, providing a certain safety mechanism.
However, this vessel network is one of the two major areas where aneurysms
occur 1 . An aneurysm is an area of the vessel wall that grows like a bubble, and
eventually may burst. Aneurysms are a major cause of health problems and death
in developed countries. A better understanding of the cerebral vascular system is
therefore important for improving health care in the future. But scientific techniques based on experiments are difficult to apply to this problem. Non-intrusive
examination of living patients cannot give detailed enough information for all applications, and in vivo experiments on living humans carry too large risk. Vessel
walls have a complicated structure, and dead vessels lose much of the properties
of living tissue, making systematic experiments on vessel wall properties difficult.
It has thus proven difficult for the medical sciences to discover all the detailed
mechanisms behind aneurysm growth.
Mathematical modeling may prove to be a valuable tool to overcome this task.
The scientific field of applying tools from mechanics to biology is called biomechanics. Biological systems are usually very complex, making the use of computational methods a must to perform accurate calculations. Computational Biomechanics is in general a scientific field that seems to be growing rapidly in popularity,
with applications including important medical research topics. The problems also
present many challenges in the field of Computational Science, and the increased
computational power we enjoy today is opening new possibilities.
In this thesis we will attempt to apply techniques of Computational Fluid Dynamics (CFD) to blood flow in the CoW. With this kind of simulations, it may
be possible to obtain more detailed information about the blood flow than images
from non-invasive measurements alone may provide. In particular, the distribution
of stresses on the vessel walls is impossible to measure but is readily available after a CFD simulation. These forces are a key to understanding the formation of
aneurysms, since aneurysms are known to occur in areas where the shear stress is
expected to be large. An important task for the scientific community in the future
is to relate computational results with data from patients to aid in identifying the
risk of aneurysms and other vascular diseases.
1The other is in the aorta, the large artery transporting blood out from the heart.
1
2
1. INTRODUCTION
F 1.1. The Circle of Willis from volume rendering of an angiography image.
Applying CFD techniques to this complex biomechanical system presents many
difficulties. First, we need to construct a mathematical model, a mathematical description of everything that is relevant for the application. This includes describing
the material properties of living blood, making a geometric description of the complex vessel structure, modeling how the blood interacts with the vessel walls, and
defining boundary conditions at the artificial boundaries 2 of the computational
(geometric) domain. Second, the final model consists of equations that are challenging to solve properly. Constructing numerical methods for the Navier-Stokes
equations is a research field that still poses many open questions. To solve these
equations, we need complex solver software that must address issues of stability,
accuracy and efficiency. Even the most efficient software is still computationally
intensive, and we thus will need a lot of computing power. With the grids used
in this thesis we will have linear systems with millions of unknowns to solve, a
process that is repeated thousands of times for each simulation case. And finally,
validation of the mathematical model is difficult for the same reasons that we had
to make the model in the first place – experimental data are difficult to obtain and
of limited accuracy.
The first part of any mathematical modeling task is to identify which properties
of the modeled system that are significant for the results of the simulation. After
the insignificant properties are identified, a simplified model can often be set up,
2The parts of the boundary that are not actual vessel walls.
1. INTRODUCTION
3
F 1.2. Computational model of the Circle of Willis
which may be a lot easier to implement and require less computational resources.
In this thesis, we will make several simplifications. Blood is modeled with the same
general fluid properties that are normally used for air, water, and oil, namely as an
incompressible Newtonian fluid. Vessel walls are assumed to be rigid, and there
is no slip between the blood and the walls. In reality the blood is not an uniform
fluid, since it contains blood cells of different types. Vascular walls are actually
elastic and expand slightly at the beginning of each pulse when the flow increases
quickly. However, these simplifications are not unreasonable since the vessels are
small enough[25] to neglect vessel compliance and large enough to neglect nonNewtonian behavior. Chapter 2 deals with developing the mathematical model and
discussing the simplifications in more detail. The result of these modeling choices
is that we need to solve the standard Navier-Stokes equations for an incompressible
Newtonian fluid on a fixed geometric domain Ω:
(1.1)
1
∂u
+ u · ∇u − ν∆u + ∇p = f,
∂t
ρ
∇·u = 0,
in Ω,
in Ω.
In these equations the principal quantities are the fluid velocity u and the pressure
p. After computing these quantities, the shear stress on the vascular walls can be
computed from u.
An important part of the simplifications we do are in the boundary conditions
we set on the artificial boundaries. These conditions have to be extrapolated from
data with less detail than we need to complete the mathematical equations. Chapter
4 contains a summary of data found about the Circle of Willis in medical literature.
In particular, we will use flow rate curves combined with approximate mean velocities in the inflow vessels obtained from several studies. These data are combined
4
1. INTRODUCTION
with analytical solutions to the fluid flow equations, described in chapter 3, to define sensible boundary conditions in the vessels that supply blood to the circle. In
the vessels that carry blood away from the circle, we set an approximate pressure
with conditions that leave the velocity as free as possible (the natural “do-nothing”
conditions).
To define the geometry, we use a parameterization of the domain. Vessels are
represented by spacial curves, with varying radii, which are connected in a general
graph structure. The parameterization allows us to make geometries with variations
on vessel sizes, positions, and how the vessels are connected. We write specialized
software 3 to generate the computational grid from this geometric description. This
approach is described in chapter 6. To define the parameterization for a geometric
model of an “average” CoW, we used several different sources. With a combination
of looking at a volume rendered 3D image, using average vessel sizes from medical
references, and some guidance from Dr. Jørgen Isaksen4, we finally ended with the
geometric model shown in figure 1.2.
As mentioned above, the nonlinear partial differential equations (1.1) are challenging to solve. Quite sophisticated software is needed to perform our simulations
in a reliable and efficient fashion. For this purpose, we use the open source software Featflow[6] by Stefan Turek et. al. from Heidelberg. This software is based
on an efficient algorithmic approach, but it has limited general grid support. This
is one of the reasons we chose to develop our own gridding software. Featflow is
rather technical to use, since it does not have the polish of a commercial software
package. To fit this software to our needs, we have developed some scripting tools
in Python that generate the necessary Fortran77 callback code for use with Featflow. The code generation is based on the grid parameterization and a parameter
file which is simpler to use and closer to the mathematical model formulation than
the Featflow input files are. These scripts are collected under the name FeatCoW,
and their usage and implementation is briefly described in appendix A. All the
source code is found on the accompanying CD, described in appendix B.
After the mathematical model was established and all the software tools were
ready, we could finally start running simulations. Because of a limited time frame
and long simulation times, the number of simulations had to be limited. First we
tested some different boundary condition choices to see their isolated effect on
simplified geometries. Next we performed realistic blood flow simulations in the
full CoW model, in partial CoW models, and with some geometric variations of
posterior part of the model. Chapter 7 presents the simulations with results and
discussions. An attempt is made to validate the results by comparing with data
from medical studies, but the data are very limited and the variations are large.
Nevertheless, we can claim that our results are within normal physiological ranges.
When analyzing the simulation results, we need to ask some questions. We
will focus on qualitative issues related to the importance of the free parameters in
our simplified model. Is it necessary to perform simulations on the whole circle?
Or can we do just as well by focusing on smaller parts of the geometry? How important is the accuracy of the boundary data we supply? Remember that the data
can’t be obtained completely accurately. The boundary data are complemented
3The source code for the grid generation tools that has been developed is found on the accom-
panying CD (see appendix B).
4From the University Hospital of North Norway
1. INTRODUCTION
5
by some assumptions (choice of spacial velocity profile) which aren’t necessarily physically correct. How far from the artificial boundary is the effect of these
assumptions seen? And how much more information does a transient simulation
give us, compared to a single steady state simulation? Which simulation parameters are most important for the wall shear stress? Although we can’t validate the
quantitative results from the simulations, we try to give qualitative answers to the
questions suggested above as best we can. Some parts of this discussion is given
together with the presented simulation cases and results in chapter 7, and chapter
8 contains a summary of the findings from simulation results. In the end we round
off by mentioning some possible ways to improve the model and methods.
CHAPTER 2
Blood modeling
2.1. Fluid flow equations
To describe the flow of blood we use the principles of continuum mechanics.
The properties of fluid particles averaged over small volumes are described in an
average sense, and assumed to be well described by continuous scalar and vector
fields. The two main principles governing the flow of a fluid are the conservation
of mass and momentum. In addition, we need to make some assumptions on the
behavior of the particular fluid flow phenomena.
Conservation of mass. We look at a small, arbitrary chosen volume V filled
with fluid, with boundary dV. The velocity of the fluid is described by a vector
field u(t, x). The density of the fluid (mass per volume) is ρ. Since mass cannot
appear or disappear spontaneously within V, the total transport of fluid through the
boundary of V must be in equilibrium at all times.
Z
(2.1)
(ρu) · n ds = 0.
dV
Here n is the outward pointing normal vector of the boundary dV. For this application, we assume that the density is constant, ie that the fluid is incompressible. By
partial integration (Greens theorem), we then get that
Z
Z
(2.2)
∇·(ρu) dx =
ρ∇·u dx = 0.
V
V
Since these equations are defined for arbitrary volumes V, they must be valid in
every point. We thus get the continuity equation for an incompressible fluid,
(2.3)
∇·u = 0.
Conservation of momentum. The momentum equation follows from Newtons first law on integral form applied to this small volume V. Newtons first law
states that the total forces F acting
on a body of mass is equal to the time derivaR
tive of the linear momentum V ρu. The total forces F acting on this volume can
be split into volume forces f (like gravity) acting on each mass unit, and contact
forces on the surface of the volume, represented by the stress vector. The stresses
in the fluid are described by the stress tensor σ, and the stress vector s on a surface
with normal vector n is given by σ · n.
Z
Z
Z
∂
ρu dx =
σ · nds +
ρf dx.
(2.4)
∂t V
dV
V
7
8
2. BLOOD MODELING
We first transform the left side by the transport theorem, apply partial integration
and use the continuity equation.
Z
Z
Z
Z
∂
∂u
∂
(2.5)
ρu dx =
(ρu) dx +
(ρu)u · n ds =
ρ
+ ρ∇·(uu) dx,
∂t V
V ∂t
dV
V ∂t
(2.6)
∇·(uu) = u · ∇u + (∇·u)u = u · ∇u.
Again, by partial integration we can rewrite these equations as
Z
Z
∂u
ρ
(2.7)
+ ρu · ∇u dx =
∇·σ + ρf dx,
V ∂t
V
or
1
∂u
(2.8)
+ u · ∇u = ∇·σ + f.
∂t
ρ
What we lack now is a model for the stress tensor. This depends on characteristics of the fluid and can only be approximated. In most simple fluid flows, the
stress tensor can be modeled as a linear function of the velocity derivatives. Flow
phenomena that are well approximated by this model are called Newtonian flow.
(2.9)
(2.10)
σ = −pI + µ(∇u + ∇uT ),
∇·σ = −∇p + µ∆u + µ∇(∇·u).
Here p(t, x) is the pressure (isotropic normal stresses) in the fluid, and µ is the viscosity. We have now obtained the full Navier-Stokes equations for incompressible
Newtonian fluid flow. The domain of interest is denoted by Ω, and ν ≡ µρ is called
the kinematic viscosity. The equations then become
1
∂u
(2.11)
+ u · ∇u = − ∇p + ν∆u + f,
x ∈ Ω,
∂t
ρ
(2.12)
∇·u = 0,
x ∈ Ω.
Scaling. Length and time units suitable for one application may not be suitable
for another. For example, measuring small vessel diameters of less than 1 cm in
meters is not the most intuitive choice. Because of that we will introduce a scaling
of the equations with dimensions characteristic for the problem at hand. This will
bring the unknown quantities closer to order unity, which is also advantageous
from a numerical point of view. In the following U, L and T denote the chosen
dimensions for velocity, length and time, respectively. Quantities with hats are
dimensionless.
t = T tˆ,
x = Lx̂,
1ˆ
∇ = ∇,
L
(2.13)
L
U= ,
T
u = U û,
p = ρU 2 p̂.
We first express the momentum equation in the dimensionless quantities.
(2.14)
U ∂û U 2
ρU 2 ˆ
U
û · ∇ˆ û = −
∇ p̂ + 2 ν∆ˆ û + f.
+
ˆ
T ∂t
L
ρL
L
2.2. BLOOD PROPERTIES
Then we scale the equations with
L
U2
9
to get
ν ˆ
∂û
+ û · ∇ˆ û = −∇ˆ p̂ +
∆û + f.
ˆ
UL
∂t
If we introduce the dimensionless number
UL
(2.16)
Re =
,
ν
called the Reynolds number, we can now rewrite the momentum equations on a
dimensionless form with only one physical parameter.
(2.15)
∂û
1
+ û · ∇ˆ û − ∆ˆ û + ∇ˆ p̂ = f̂.
Re
∂tˆ
In the subsequent we will omit the hats for brevity. After computing the solution
of the scaled equations, the dimensionless results must be interpreted in the characteristic units as defined in (2.13). The stress tensor can also be calculated in
characteristic units and interpreted in a different scale afterwards.
1 ˆ
σ̂ ≡ − p̂I +
(2.18)
(∇û + ∇ˆ ûT ),
Re ν ˆ
(2.19)
σ = −pI + µ(∇u + ∇uT ) = ρU 2 − p̂I +
(∇û + ∇ˆ ûT ) = ρU 2 σ̂.
UL
(2.17)
2.2. Blood properties
Quarteroni et al. [25] summarize the properties of blood and blood flow in
different types of vessels. Blood can be modeled well as an incompressible media.
In large vessels the compliance of the walls, i.e. the elastic properties that allow the
vessels to expand to accommodate an increased flow rate, can have a large impact
on the flow. In small vessels this is not significant, but the large size of the blood
cells compared to the vessel diameters makes the assumption of Newtonian flow
invalid.
According to Quarteroni, compliance is mostly significant for large arteries,
which have with diameters above 1cm. Medium sized arteries with diameters in
the range 0.2mm-1cm, may be considered rigid, but begins to show deviations from
Newtonian flow.
The vessels in the Circle of Willis lie in the category of medium sized arteries,
with diameters from 1mm to 5mm. We can therefore assume rigid walls, and will
neglect the beginning non-Newtonian behavior. Cebral et al.[5] has performed simulations on CoW with Newtonian and Casson stress tensors. Their simulation with
Newtonian stresses exhibit the same qualitative behavior, but has slightly lower
wall shear stresses. Since we only expect qualitative results from these simulations, this assumption seems acceptable.
In addition we need values for the density ρ and viscosity µ to perform realistic
simulations. Quarteroni et al. [25] (page 105) choose these values to be:
• ρ = 1.0 cmg 3
g
• µ = 0.035 poise = 0.0035 Pa · s = 0.035 s·cm
To sum it up, we make the following assumptions on the blood flow behavior:
• Incompressible flow.
• Newtonian stresses.
• Rigid walls.
10
2. BLOOD MODELING
2
• ν = 0.035 cms .
Other important assumptions are discussed in the section about boundary conditions. In chapter 4, properties special to the Circle of Willis is discussed.
2.3. Initial conditions
The Navier-Stokes equations only describe the transient behavior of a fluid.
To use the equation we need to prescribe the velocity and pressure fields for an
initial time t = t0 . Finding a correct initial condition u0 is impossible since it
would require very accurate measurements. The lack of this kind of measurements
is indeed one of the reasons these simulations are performed in the first place. At
least, u0 should be chosen divergence free with a flow rate balance consistent with
the given boundary conditions. A good starting point is to first calculate a steady
state solution of Navier Stokes, i.e. with ∂u
∂t = 0. Then the simulation should be
run for a number of heartbeats, and hopefully we get to a cyclic solution.
2.4. Boundary conditions
The domain Ω consists of a network of cylindrical pipes (vessels). The vessel
walls will be denoted by ∂Ω0 . Since the equations can only be solved on a closed
domain, we must truncate the vessels at strategic points. The truncated boundaries
are circular crossections perpendicular to the pipes. We call these truncated boundaries “artificial boundaries” and refer to them by Γi . When the artificial boundaries
are categorized as inflow or outflow, we are referring to the average flow through
each boundary and not point-wise flow velocity, since recirculation zones are possible.
As discussed in section 2.2 we assume rigid vessel walls. Thus we use the
no-slip condition u = 0 on ∂Ω0 . The boundary conditions on the artificial boundaries will be a mixture of essential conditions on ΓiE and natural conditions on ΓiN
(with {Γi } = {ΓNj } ∪ {ΓkE }). As will be discussed in chapter 4, we can only get
approximations to the data needed for these conditions.
∂Ω = ∂Ω0 ∪ {ΓiE } ∪ {ΓNj },
(2.20)
u = 0,
(2.21)
u = ui (t, x),
(2.22)
Z
(2.23)
x ∈ ∂Ω0 ,
ΓiN
(ν
x ∈ ΓiE ,
∂u
− pn) ds = −Pi (t)n,
∂n
x ∈ ΓiN .
Essential conditions. One of the approximations we will have to do is to
choose the essential conditions from limited data. We can find mean flow rate
variations in time, Q(t), from measurements described in medical literature. We
can not, however, find accurate velocities for each spacial point on the boundaries.
As a simplification, we neglect tangential velocity components and set
(2.24)
ui (t, x) = −vi (t, r)n,
x ∈ ΓiE ,
such that the velocity profile vi fits the flow rate Qi (t), i.e.
Z
(2.25)
vi (t, r) ds = Qi (t).
Γi
2.5. STRESSES
11
In chapter 3, some analytical solutions on pipes are discussed, which can be used
to design a spacial profile v. In chapter 4, data collected from medical literature is
used to find flow rates in the CoW.
Natural conditions. For a fully developed velocity profile, the natural conditions (often called the do-nothing conditions)
Z
∂u
(2.26)
− pn) ds = −Pi (t)n,
x ∈ ΓiN ,
(ν
N
∂n
Γi
are equivalent to specifying an average pressure on the boundary,
Z
(2.27)
p(t, x) ds = Pi (t).
ΓiN
See [14] for a discussion of these conditions. For curved pipes and more complicated domains like we will use, (2.27) is only approximate. We will see in practice
from the simulations in chapter 7 that this is true. Since pressure is only determined up to a constant, the exact values of Pi does not matter. What matters is
the difference between Pi on each boundary, and eventually how these differences
vary in time. This can change the pressure gradients in the fluid, directly leading
to changes in the flow as well.
1D models. To approximate more realistic pressure values without data from
measurements, it is possible to couple the simulator with 1D models of the rest of
the circulation system. The unknowns in such models are typically the mean pressure and mean velocity over a crossection, which is exactly what is needed as input
on the do-nothing boundaries. This is particularly important for fluid structure interaction simulations, because the pressure wave then may ricochet when natural
boundary conditions are used [25]. See [5] for an attempt at using a tree of 1D
models coupled to the downstream boundaries on the CoW. We will not attempt
this here.
2.5. Stresses
When the fluid is moving, there is a contact force acting between it and the
walls. This force is represented by the stress vector, s, which has units of Pascal,
or force per area (Pa = mN2 ). The vector can be described by the stress tensor σ and
the surface normal n. The relation between the stress tensor and the stress vector is
simple, and the tensor is defined by the approximation of Newtonian flow that we
did before.
(2.28)
s = σ · n = −pn + µ(∇u + ∇uT ) · n,
x ∈ ∂Ω0 .
At each point on a wall, the normal component sn of s represents a force that pushes
or pulls the wall to or from the fluid. The pressure p is the part of the stress tensor
that is independent of viscous forces, and it is a main part of the normal stresses.
The rest of the stress forces is represented by the shear stress vector τ, which is the
part of the stress forces acting in the surface tangent plane, or dragging along the
wall.
(2.29)
(2.30)
sn = (s · n)n,
τ = s − sn .
12
2. BLOOD MODELING
It can be easier and more informative to look at some derived quantities of the
stresses. Some quantities easier to visualize and work with is the maximum, minimum or average shear stress over some heartbeats. We then simply integrate the
magnitude of the shear stress at each point on the walls over time, or take the pointwise extremal values over time. Similarly, we can take the max, min and average
of the pressure on the walls when
analyzing the results.
√
With x ∈ ∂Ω and kvk ≡ v · v, we define the quantities
τmax (x) = max kτ(t, x)k,
t0 ≤t≤t1
(2.31)
τmin (x) = min kτ(t, x)k,
t0 ≤t≤t1
Z t1
1
τavg (x) =
kτ(t, x)kdt,
t1 − t0 t0
pmax (x) = max p(t, x),
t0 ≤t≤t1
pmin (x) = min p(t, x),
t0 ≤t≤t1
Z t1
1
p(t, x)dt.
pavg (x) =
t1 − t0 t0
It is still not clear which factors are most important for the development of
aneurysms. Several explanations have been attempted, but no definite answer has
been found so far [4]. One common attempt to explain the problem is that the
shear stress on the vessel walls may exceed a certain threshold, which over time
can alter the wall properties. The shear stress is a friction force acting between
the wall and the fluid. This quantity is likely more affected by our simplifications
of Newtonian stresses and rigid walls than the main flow is. Still, we can hope to
at least get qualitative indications of problematic areas by looking at this quantity.
Other explanations include the pressure, and since no clear and simple connection
have been found it is not unlikely that both are factors. Possibly the shear stress
and pressure play their roles in different parts of the development of aneurysms.
2.6. The final model
To sum it all up, this is the full model for blood flow in a vessel network.
1
∂u
+ u · ∇u −
∆u + ∇p = f,
∈ Ω,
∂t
Re
∇·u = 0,
∈ Ω,
u = 0,
∈ ∂Ω0 ,
(2.32)
u = −vi (t, r)n,
∈ ΓiE ,
1 ∂u
− pn = −Pi (t)n,
∈ ΓiN .
Re ∂n
To define a particular simulation, one needs to complete this with the geometric
domain Ω with boundaries, the physical parameter Re (incorporating the characteristic scales of the problem), as well as boundary data Qi (t) and vi (t, r) for each
ΓiE , and Pi (t) for each ΓiN .
CHAPTER 3
Analytical solutions
Realistic analytical solutions for the Navier-Stokes equations have only been
found on very simple geometries. On a simple pipe (straight cylinder) some solutions exist. We will first describe these. The analytical solutions we find can
also be used to assign natural flow profiles as essential boundary conditions in the
case where we do not know the exact profiles. We can also use these solutions for
verification of the solver software and grid tools.
But we also need test cases for verification of the more complex grids. For
this purpose we will use the method of manufactured solutions. By constructing
an artificial (divergence free) solution and inserting in the equations we can find a
matching right hand side f. When this f is applied in the solver software, it should
reproduce the artificial solution.
3.1. Womersley flow
Consider the case of flow in a straight pipe of infinite length with radius a. We
look at a section of the pipe with length L, denoted by ΩaL , which can be viewed as
a truncation of the pipe. The volume forces are set to 0, and the fluid has pressures
p(t, 0) = p1 (t) and p(t, L) = p2 (t) on the ends of the pipe.
(3.1)
(3.2)
Ω = ΩaL = {0 ≤ x ≤ L,
0 ≤ r ≤ a,
f = 0.
0 ≤ θ < 2π} ,
Assume that the pressure gradient ∇p is constant for all x, but not necessarily over
time. Further assume that the velocity u only has components in the pipe length
direction, and that the solution has radial symmetry.
(3.3)
(3.4)
u = w(t, r)i x ,
p1 − p2
ix .
∇p = −
L
This solution is trivially divergence free, such that the continuum equation is satisfied. In addition, the convective part disappears and the equation of motion then
reduces to
(3.5)
(3.6)
∂u
= −∇p + ν∆u,
∂t
1 ∂w p1 − p2 ∂2 w 1 ∂w
=
+ 2 +
.
ν ∂t
νL
r ∂r
∂r
If the pressure gradient is constant in time as well, this equation has a steady state
solution known as Poiseuille flow. If a fluid is injected into a pipe with a steady flow
rate, the velocity profile some distance into the pipe will look like this quadratic
13
14
3. ANALYTICAL SOLUTIONS
profile.
(3.7)
(3.8)
!
1 ∂ ∂w
p1 − p2
,
r
=−
r ∂r ∂r
νL
p1 − p2 2
w(r) =
(a − r2 ).
4νL
Now assume the pressure gradient is periodic in time and on the form
(3.9)
∂p
= −Aeiωnt ,
∂x
√
i≡
−1,
with n a positive integer and A and ω positive real numbers. This allows a separation of variables in the momentum equation (3.6).
(3.10)
(3.11)
(3.12)
w(t, r) = u(r)eiωnt ,
!
iωn iωnt A iωnt
∂2 u 1 ∂u iωnt
+
ue
= e
+
e ,
ν
ν
∂r2 r ∂r
A
∂2 u 1 ∂u i3 ωn
+
u=− .
+
2
r ∂r
ν
ν
∂r
Equation (3.12) has a known solution given by
!
q


i3 ωn 

J0 r

ν

A 
 ,
1 −
!
(3.13)
u(r) =
q

iωn 
3


J0 a i ωn
ν
where J0 (x) is the first order Bessel function.
This finally leads us to the Womersley [33] solution
r
ωn
r
(3.14)
,
βn ≡ αn i3/2 ,
y≡ ,
αn ≡ a
ν
a
!
A
J0 (βn y) iωnt
w(t, r) =
(3.15)
1−
e ,
n > 0.
iωn
J0 (βn )
If n = 0 we recover the Pouiseille solution (3.8).
To use the Womersley solution (3.15) requires that we know the pressure gradient as a function of time, but with some modifications we can apply a known
flow rate instead. Consider the case where the flow rate Q(t) is a periodic function
of time with period T . Assuming sufficient regularity, a periodic function Q can
always be approximated by N complex Fourier modes {Qn }.
(3.16)
(3.17)
2π
,
T
N−1
X
Q(t) =
Qn eiωnt .
ω≡
n=0
Let us now assume a solution on the form
(3.18)
N−1
X
!
J0 (βn y) iωnt
v(t, y) =
C n Qn 1 −
e ,
J0 (βn )
n=0
3.2. MANUFACTURED POLYNOMIAL PROFILES
15
with a choice of coefficients {Cn } such that the flow rate function is reproduced, i.e.
Z
N−1
X
(3.19)
v ds = Q(t) =
Qn eiωnt .
Γ
n=0
We must then have the identity
Z
N−1
X"
iωnt
2
(3.20)
Qn e Cn 2πa
1
0
n=0
!
# N−1
X
J0 (βn y)
y 1−
dr dθ =
Qn eiωnt ,
J0 (βn )
n=0
and since the complex exponentials are orthogonal in time, we must have for each
n
!
Z 1
2
−1
2
(3.21)
βn yJ0 (βn y) dy .
Cn = πa 1 −
βn J0 (βn ) 0
Using the property of Bessel functions that
Z
(3.22)
xJ0 (x) dx = xJ1 (x),
we get the expression
!
2J1 (βn )
= πa 1 −
(3.23)
.
βn J0 (βn )
This gives us the final solution from the given flow rate function Q(t).
Cn−1
(3.24)
2
X Qn 1 −
N−1
2Q0 2
1
−
y
+
vw (t, y) =
πa2
πa2 1 −
n=1
J0 (βn y)
J0 (βn ) iωnt
e .
2J1 (βn )
βn J0 (βn )
As we shall discuss later, this function probably is the most realistic inflow boundary condition we can apply for the present problem, since if we do not know the
exact velocity profile of the real life flow. Indeed, the data we have available from
medical literature is the flow rate Q(t).
3.2. Manufactured polynomial profiles
The Womersley solution (3.24) is only correct in an infinite pipe with periodic
flow conditions, and the Pouiseille solution (3.8) only when the flow reaches a
steady state. It can be instructive to construct some other (unphysical) solutions on
the same form to compare with.
Polynomial solution. Assume a solution with separated variables on the form
r
(3.25)
u(t, x) = v(t, y)i x = Q(t)u(y)i x ,
y≡ ,
a
where
R Q(t) is the flow rate and u(y) is the spacial velocity profile, normalized such
that Γ u ds = 1. We choose a general polynomial profile with degree γ.
(3.26)
uγ (y) = C 1 − yγ ,
Z
Z 1
γ
γ
2
−1
(3.27)
C =
1 − y ds = 2πa
y(1 − yγ ) dy = πa2
,
γ+2
Γ
0
γ+2
(3.28)
vγ (t, y) = Q(t)uγ (y) = Q(t)
1 − yγ .
2
γπa
To obtain this solution in a simulation, we need to specify a non-zero volume force
f. This force is obtained artificially by inserting our solution into the equation and
16
3. ANALYTICAL SOLUTIONS
solving backwards. We haven’t chosen the pressure yet, so we put it on the same
side as the volume force. The convective part disappears for the assumed solution,
and we assume the pressure on the form ∂p
∂x = −β. From the momentum equation
we then obtain the following relations.
∂
1 ∂
(3.29)
=
,
∂r a ∂y
!
∂vγ (y) 1 ∂vγ Q(t) ∂uγ (y)
γ + 2 γ−1
=
=
= −Q(t)
(3.30)
y .
∂r
a ∂y
a
∂y
πa3
!!
∂Q
ν ∂ ∂vγ
∂Q
u(y)i x − ν∆u =
u(y)i x −
r
ix
(3.31) f − ∇p =
∂t
∂t
r ∂r ∂r
!
!!
1 ∂
∂Q
γ + 2 γ−1
u(y)i x + ν
=
yQ(t)
y
ix
∂t
ay ∂y
πa3
!
!
∂Q
νγ(γ + 2) γ−2
=
u(y)i x + Q(t)
y
ix .
∂t
πa4
If we choose the flow rate and pressure gradient constant, we can select the volume
forces so they disappear for γ = 2, again recovering the common Pouiseille flow.
(3.32)
(3.33)
(3.34)
(3.35)
Q = Q0 ,
∇p = −βi x ,
Qνγ(γ + 2)
,
β=
4
πa
f = β yγ−2 − 1 i x .
Shear stresses. To verify the numerical shear stress calculations, we calculate the stresses on the walls of the cylinder with this analytical solution. These
expressions can be used to validate the shear stress calculation tool.
The stresses s on the pipe walls are calculated by
(3.36)
s = n · σ = pir + µir · ∇u + ∇uT ,
(3.37)
(3.38)
∂vγ
ix ,
∂r
ir · ∇uT = 0,
ir · ∇u =
where
∂vγ γ + 2 −γ ∂ γ
γ(γ + 2) −γ γ−1
γ+2
γ a
a − r = −Q(t)
a a
= −Q(t) 3 .
= Q(t)
2
2
r=a
∂r r=a
∂r
γπa
γπa
πa
The shear stresses are then found by subtracting the normal component
µ(γ + 2)
(3.39)
ir ,
τ = s − (s · ir )ir = −Q(t)
πa3
after which we can easily calculate the magnitude by
µ(γ + 2) (3.40)
τ = kτk = Q(t)
.
πa3 With the manufactured polynomial solution derived above and this shear stress
calculation, we can define experiments for verifying the shear stress calculations
later.
3.4. ANALYTICAL SOLUTIONS AS ESSENTIAL BOUNDARY CONDITIONS
17
3.3. General manufactured solutions
This part is for verifying general grids and corresponding solver convergence.
By first defining a (non-physical) analytical solution for u and p, we can calculate
the f necessary to get this solution, set all boundary conditions as essential, and
use this problem for verifying the solver and the grid before doing a more realistic
simulation.
The manufactured solution should be chosen divergence free. One simple
choice is then


 sin(y)

u =  sin(x) ,
(3.41)
0
(3.42)
∇p = −βi x ,
which gives us the volume force
(3.43)


 sin(x)cos(y) + νsin(y) + β
∂u

+ u · ∇u − ν∆u =  sin(y)cos(x) + νsin(x)  .
f = ∇p +
∂t
0
3.4. Analytical solutions as essential boundary conditions
In our problem we do not know any real velocity profiles. We do, however,
have flow rate functions taken from measurements on real patients. This is found
in medical literature discussed in chapter 4. To set essential boundary conditions
in our simulations, we need to extrapolate boundary data from the known flow
rate functions Qi (t). In other words, we need to choose a spacial velocity profile
and fit it to the wanted flow rate. This is exactly what we have done both for the
Womersley solution and the artificial polynomial profiles.
Let Γ denote a artificial boundary with radius a and essential conditions. Let
Q(t) be a given flow rate function for this boundary which is periodic with period
T. Then we have two ways to construct the boundary data. In both ways the inflow
velocity will only have components in the normal direction, and we use the convention that a positive flow rate means flow into the pipe. n is as usual the outwards
pointing normal on the boundary.
(3.44)
u(t, x) = −v(t, y)n,
x ∈ Γ.
Polynomial. We first choose the degree γ of the polynomial profile. Then the
velocity profile is given by
γ+2
(3.45)
1 − yγ .
v = vγ (t, y) = Q(t)
2
γπa
Womersley. Q(t) is first approximated by a Fourier series with N components.
(3.46)
Q(t) =
N
X
Qn eiωnt ,
n=0
ω=
2π
.
T
Then the velocity profile is given by
(3.47)
X Qn 1 −
N−1
2Q0 2
v = vw (t, y) =
1
−
y
+
πa2
πa2 1 −
n=1
J0 (βn y)
J0 (βn ) iωnt
e .
2J1 (βn )
βn J0 (βn )
CHAPTER 4
The Circle of Willis
So far we have discussed modeling of blood flow in a general setting. This
chapter deals with the special part of the cerebral vascular system that is called the
Circle of Willis (CoW). The CoW is a circle-like network of small arteries supplying blood to the brain. Figure 4.1 shows an image of the CoW from a MRI
scanning. Here we will describe the particular properties relevant for our application that this part of the vascular system exhibits. We first describe the geometry of
these vessels, then continue to summarize relevant data found in medical literature.
Of particular importance and difficulty is the data for boundary conditions.
4.1. Geometric description
The CoW is divided into the posterior part (back of the head), and the anterior
part (front of the head). These parts are connected into a circle by three communicating arteries, between the left and right anterior sections and between these and
the posterior part. These are usually thin compared to the other arteries in the system. Figure 1.2 shows an image of the computer model we have created of this
geometry, and figure 4.2 shows the same model with an angle similar to figure 4.1.
Blood flows from high to low pressure, i.e. from red to blue in this image.
Posterior part. In the posterior part of the CoW, the blood enters through the
two Vertebral Arteries (VA). These two vessels combines to form the larger Basilar
Artery (BA), which splits into the right and left Posterior Cerebral Arteries (PCA).
The Posterior Communicating Arteries (PCoA) are connected to the PCA just after
F 4.1. The Circle of Willis, picture from MRI scanning.
19
20
4. THE CIRCLE OF WILLIS
F 4.2. The Circle of Willis, time-averaged pressure.
the split from the BA. In chapter 7 simulations are performed on the posterior part
alone. See sections 7.8 and 7.9 for figures of this part with geometric variations.
Anterior part. The anterior part of the CoW gets blood through the two large
Internal Cartoid Arteries (ICA). 3/4 of the total flow through the CoW comes from
these two arteries. The ICA then splits into the Middle Cerebral Artery (MCA)
and the Anterior Cerebral Artery (ACA). Before this bifurcation, the PCoA is connected to the ICA. The left and right ACA are connected by the small Anterior
Communicating Artery (ACoA). The segment of ACA before the ACoA is called
the A1 segment, and the part after is called A2 or just ACA. The MCA splits in
two further down the stream. In chapter 7 simulations are performed on the anterior
part alone. See section 7.7.7 for figures of this part.
Variations. Large individual variations occur in the CoW, and the description
above only fits about 40% of the population. For a classification of possible variants, see f.ex. [13]. It is common to have one or more communicating arteries
larger, smaller, doubled, or even missing. Vessel radii and bifurcation angles are
highly varying. Table 4.1 lists some average radii in the various vessels, taken from
[32]. These are used for the reference geometry shown in figure 4.2.
Aneurysms. Sometimes a part of the vessel walls can become weaker and
bulge out to form something like a bubble on the vessel. This is called an aneurysm.
If the aneurysm eventually bursts, the result can be devastating and possibly lethal.
Aneurysms usually forms in the aorta or in the, in bifurcations where the shear
stress has the largest impact [15]. In the CoW, the BA-PCA bifurcation is one of
the places where aneurysms form most frequently, along with the place where the
PCoA and ICA connects. The ACoA-ACA bifurcations and MCA splits are also
4.2. IN VIVO MEASUREMENTS
21
Vessel
Mean diameter* [32] Grid diameter
VA
3.5 mm
BA
4.1 mm
4.3 mm
PCA (P1)
2.6 mm
2.6 mm
PCA (P2)
2.7 mm
.2.7 mm
PCoA
1.3 mm
1.3 mm
ICA
5.0 mm
5.0 mm
3.9 mm
3.8 mm
MCA
ACA (A1)
2.6 mm
2.4 mm
2.0 mm
ACA (A2)
ACoA
1.5 mm
1.5 mm
T 4.1. Typical vessel radii in the CoW.
Taken from figure 7.3 in [32].
F 4.3. Normalized flow rate shape for the Internal Cartoid
re f
re f
Artery (QICA (t)) and Vertebral Artery (QV A (t)).
common places for aneurysms. It is thus of particular interest to examine these
places more carefully.
4.2. In vivo measurements
Pressures. For the boundary conditions on the outflow vessels we need the
pressure Pi (t) for each Γi . In reality the pressures will have transient variations. To
our knowledge this is difficult to measure, so we have to deal with less accurate
data. In [7] the mean pressures for the ACA, MCA and PCA are listed to be
about 40 mm Hg (± 15 (SD)), which corresponds to 30 Pa. It is thus a close
approximation to set the same average pressure on all six outflow boundaries.
22
4. THE CIRCLE OF WILLIS
F 4.4. Flow rate in ml/s for ICA and VA.
Flow rates. A heartbeat pulse consists of two phases. The systolic phase is
the first part of the pulse where the heart muscle contracts and the flow rate grows
rapidly to a peak. The diastolic phase is the second part where the flow rate decays.
In the main arteries right outside the heart the systolic peak of the pulse is very
sharp, but when the flow reaches the cerebral system it has become softer. This is
largely due to the compliance (elasticity) of the large arteries, which means they
can hold blood “reserves” and keep up a more regular flow. In particular, in the
Circle of Willis there is constantly a flow through the system that normally doesn’t
go below about a third of the peak flow rate.
In chapter 3 we discuss some ways to choose essential boundary conditions for
the inflow boundaries without complete data. Assuming a given flow rate function
Qi (t) for each inflow boundary ΓiE , we then find we can choose between a few
functions that match the given flow rate but with different spacial velocity profiles.
Here we discuss how to best choose the flow rate functions Qi (t).
Ford et al has done a study with results that match our needs very closely.
In [8] they describe volumetric flow rate waveforms for both ICA and VA. They
have found that the temporal shape of the flow rate does not depend very much
on the amplitude. As a result of measurements in 17 young human subjects, they
present averaged flow rate waveforms for the ICA and VA (see figure 4.3) which are
normalized with respect to average flow rate in a heartbeat. We only have to scale
these waveforms with the wanted amplitude of the flow through each of the inflow
boundaries. However, since the 17 subjects are healthy young people we do not
know how the waveform changes with age or diseases. The presented waveforms
have a time period of 0.883 s, which corresponds to a normal resting pulse of 69
beats per minute. According to Ford et al, representative waveshapes for a faster
4.3. PHYSICAL SCALES AND REYNOLDS NUMBER
23
Vessel(s) Mean Min Max
Left ICA
4.62 3.25 6.85
Right ICA 4.53 2.78 7.42
Left VA
1.72 0.72 2.85
Right VA
1.32 0.33 3.40
T 4.2. Average flow rates from [8] (in ml/s)
pulse can easily be constructed by appending to or shortening the resting tail of the
normalized waveshapes. Nevertheless, we will stick to this pulse for simplicity.
Average flow rates are also presented in [8]. These are in good agreement with
other articles we’ve found [27][34]. In [1] it is stated that side-side variations are
quite normal, and are on average around 10%. The average and peak flow rates
in [8] show side-side variations of 1-20%. We will stick with the numbers in [8]
and use the other articles to support this choice only. Table 4.2 shows a simplified
summary of flow rates from [8].
To verify the relevance of the simulation, it is also useful with data from other
vessels. From [1] we can find mean systolic, mean diastolic and mean velocities in
MCA. [17] presents velocities in ICA vs MCA. These two can be used to validate
the results by looking at simulated velocities in the MCA. And in [16] we find
average peak flow velocity and flow direction in PCoA. These data are very coarse,
and the real life variations are so large that it is impossible to state the correctness
of the simulations with absolute certainty. But nevertheless, if the simulations and
these data match it will serve as an indicator that we’re on the right track. See
section 7.6 for the comparison of simulation results with these data.
When it comes to choosing the spacial velocity profile, we have found no literature. In [9] it is mentioned (page 254) that a 9th degree profile fits experimental
findings on blood flow. It is not, however, said in which parts of the circular system
this is observed. This discussion is also in the context of one dimensional models,
meaning they only care about average flow properties. We will later perform simulations to examine the impact the choice of spacial profile will have.
4.3. Physical scales and Reynolds number
Since both geometry and flow varies greatly throughout the Circle of Willis,
there are no single characteristic scales for neither time nor space. Consequently,
the Reynolds number for local flows vary significantly. The scales in table 4.3
represent typical (mean) units that give a reasonable Reynolds number and are
easy to handle when interpreting values. The length scale L is the largest diameter
in the system, the velocity scale U is a round number close to mean velocities, and
T = L/U is a reasonable time scale fine enough to resolve the fast systolic pulse.
These scales will be used for all the experiments in this thesis.
L
0.5 cm
U 50 cm/s
T
0.01 s
Re
715
T 4.3. Characteristic scales
CHAPTER 5
Numerical methods
We now have a system of nonlinear partial differential equations, defined on a
very complicated geometric domain. To solve the equations, we need flexible and
efficient simulation tools. The methods we use must give complete flexibility over
the geometry description. The Finite Element Method (FEM) is a good choice to
meet this requirement. Blood flow is highly pulsatile, so we must be able to handle
fast transient changes in the flow. A projection method handles transient flow in
an excellent manner, since it becomes both more accurate and efficient when the
time steps are small. To work with discrete time steps, we use a second order
Fractional Step method (FS) which is more stable than the more common second
order Crank-Nicholson scheme. Because of the better stability, accuracy will be
the main concern when selecting time step size. This is combined with an adaptive
choice of time steps, which let us use smaller steps while the pulse changes rapidly
and larger steps during the calmer part of the heart cycle. After discretizing in time
(FS) and space (FEM) and splitting the equation with the projection method, we
get huge systems of linear and nonlinear algebraic equations which require efficient
solution strategies. To resolve the nonlinearity, a fixed-point method is used, and
with multigrid as solver for the linear systems we get a very efficient overall solver.
This chapter will briefly describe these methods. The goal is to explain the
projection solver PP3D in the Featflow[6] software package. In particular we will
mention the various user specified parameters we need to consider to run the simulations accurately, robustly and efficiently. However, several of the mentioned topics can fill books on their own, so this chapter can only be a very brief overview.
To find more details about all these methods and alternative choices (including the
coupled solver CC3D), see [30] and the references therein.
5.1. The Navier-Stokes equations
We repeat the complete Navier-Stokes equations for incompressible Newtonian flow.
Find u and p such that
(5.1)
(5.2)
1
∂u
+ u · ∇u −
∆u + ∇p = f,
∂t
Re
∇·u = 0,
25
x ∈ Ω,
x ∈ Ω,
26
5. NUMERICAL METHODS
with boundary conditions
(5.3)
(5.4)
u = u0 ,
u = 0,
(5.5)
u = gi (t, x),
(5.6)
t = 0,
x ∈ ∂Ω0 ,
x ∈ ΓiE ,
1 ∂u
− pn = −P j (t)n,
Re ∂n
x ∈ ΓNj .
We wish to find an approximation to this solution by numerical methods.
5.2. Weak formulation of the Navier-Stokes equations
Before we define the Finite Element Method, we need to rewrite the equations
to a different form, called a weak form. This form has proven successful both as
prerequisite for formulating the Finite Element Method, and as a tool for rigorous
mathematical analysis of approximation properties for different equations.
Notation. In the following sections, we need the inner products
Z
(5.7)
(p, q) ≡
p · q dx,
ZΩ
(5.8)
(p, q)∂Ω ≡
p · q ds,
∂Ω
Z
(u, v) ≡
(5.9)
u · v dx,
Ω
where q, p, u and v are scalar or vector fields defined on [0, T ] × Ω. We also need
the standard Lebesgue and Sobolev function spaces
L2 ≡ { f : Rd → R | ( f, f ) < ∞},
Z
2
2
L0 ≡ { f ∈ L |
f dV = 0},
Ω
H ≡ { f : R → R | ( f, f ) + (∇ f, ∇ f ) < ∞},
1
d
H01 ≡ { f ∈ H 1 | f (x) = 0, ∀x ∈ ∂Ω},
and similarly for vector fields
L2 ≡ {f : Rd → Rd | fi ∈ L2 , ∀i},
H1 ≡ {f : Rd → Rd | fi ∈ H 1 , ∀i}.
Weak form. We start by multiplying the equations (5.1) with test functions v
and q and integrate over Ω to get
!
!
Z
Z
Z
1
∂u
(5.10)
+ u · ∇u · vdV +
− ∆u · v + ∇p · vdV =
f · vdV,
Re
Ω ∂t
Ω
Ω
Z
(5.11)
q∇·udV = 0.
Ω
5.3. SPACIAL DISCRETIZATION
27
For several reasons, discussed below, we next perform a partial integration of the
second integral in (5.10) where we use the identities (5.12) and (5.13).
Z
Z
1
1
1
(5.12)
∆u · vdV =
∇· (∇u · v) −
∇u : ∇vdV
Re
Ω Re
Ω Re
Z
Z
1
1
(∇u
=
n·
· v) ds −
∇u : ∇vdV,
Re
Re
Ω
Z
Z∂Ω
(5.13)
∇p · vdV =
∇· (pv) − p∇·vdV
Ω
ZΩ
Z
=
n · (pv) ds −
p∇·vdV.
∂Ω
Ω
After the partial integration we can write
∂u
1
1
( , v) + (u · ∇u, v) +
(∇u, ∇v) − (p, ∇·v) = (f, v) + ( n · ∇u − pn, v)∂Ω ,
∂t
Re
Re
(q, ∇·u) = 0.
The partial integration removes the differential operator from p and lowers the
order of the differential operator on v. This allows us to seek approximations for
v and p with lower regularity, Additionally, it results in a boundary integral that
allows easy implementation of both kinds of boundary conditions that we use. For
the boundaries ΓEj with essential conditions, we let the test functions v disappear
on the boundary by using the test space H10 . For the boundaries ΓiN with natural
conditions, we can insert the known term Pi (t) and move the integral to the right
hand side. Using the shorthand definitions of functionals a, b and c
1
∂u
(∇u, ∇v),
a(u, v) ≡ ( , v) +
∂t
Re
(5.14)
c(u, v, w) ≡ (u · ∇v, w),
b(q, v) ≡ (q, ∇·v),
we can rewrite this problem as
Find u ∈ H10 and p ∈ L02 such that
(5.15)
(5.16)
a(u, v) + c(u, u, v) + b(p, v) = (f, v),
b(q, u) = 0,
∀v ∈ H10 ,
∀q ∈ L02 .
A solution to equation (5.15) is called a weak solution, while the solution to equation (5.1) is called a classical solution. A weak solution only fulfills the original
equations in a weighted average sense. The classical solution is obviously a weak
solution (but the opposite is not necessarily true). We next proceed to search for
discrete approximations to the weak solution in space and time.
5.3. Spacial discretization
Finite spaces. In the weak form (5.15) of the equations (5.1) we test the solution against functions in a test space. Since the test space has infinite dimension,
we would need to test the solution with an infinite number of test functions to
find a solution. In the Finite Element Method, we reduce the test space to a finite
dimensional space and construct a basis that we can test against.
In the Mixed Finite Element Method we first choose finite dimensional subspaces Vh ≈ H10 , Qh ≈ L02 such that the basis functions {vi }, {q j } are easy to test
28
5. NUMERICAL METHODS
with. Then we seek approximations uh ≈ u, ph ≈ p in the same spaces. We get
back to how to choose the discrete spaces and their basis later.
Assume we have defined the spaces Vh and Qh with dimensions NV and NQ
such that
Vh = span{vi | 1 ≤ i ≤ NV },
Qh = span{qi | 1 ≤ i ≤ NQ }.
(5.17)
(5.18)
Assuming linearly independent basis functions, we can then express the best approximations to u and p in these spaces as a linear combination of the basis with
coefficients ui and pi , respectively.
u ≈ uh =
(5.19)
p ≈ ph =
(5.20)
NV
X
i=1
NQ
X
ui vi (x),
pi qi (x).
i=1
Discrete equations. With the definitions above in hand, we can proceed to
construct the discrete equations.
Find uh ∈ Vh , ph ∈ Qh such that
a(uh , vi ) + c(uh , uh , vi ) + b(ph , vi ) = (f, vi ),
b(qi , uh ) = 0,
(5.21)
(5.22)
∀vi ∈ Vh ,
∀qi ∈ Qh .
By the definition of uh (5.19) and ph (5.20), and the linearity of the functionals
a, b and c (5.14) (c is trilinear) we can move the sums over coefficients outside of
the functionals. The problem can then be reformulated as follows.
Find uh ∈ Vh , ph ∈ Qh such that
NQ
NV X
X
(5.23)
a(v j , vi ) + c(uh , v j , vi ) u j +
b(q j , vi )p j = (f, vi ),
j=0
(5.24)
∀vi ∈ Vh ,
j=0
NV
X
b(qi , v j )u j = 0,
∀qi ∈ Qh .
j=0
This can now be written as a system of non-linear algebraic equations. If we
first define
(5.25)
(5.26)
(5.27)
(5.28)
(5.29)
S i j (u) = a(v j , vi ) + c(u, v j , vi ),
i, j = 1, · · · , NV ,
Bi j = b(q j , vi ),
i, j = 1, · · · , NV ,
u = ui ,
p = pi ,
g = gi = (f, vi ),
then the algebraic system can be written on matrix form.
Find u ∈ RNV , p ∈ RNQ such that
"
#" # " #
S (u) B u
g
(5.30)
=
.
0
BT 0 p
Note that the interpretation of the symbol u as the discrete solution vector or the
continuous vector field should always be clear from the context.
5.3. SPACIAL DISCRETIZATION
29
Choosing the test and trial spaces. As previously mentioned, the Finite Element Method is very flexible with respect to the geometric domain. This is because
of the way we choose the test and trial spaces. In general, a continuous geometric
Ne
domain Ω is partitioned into a number of small cells Ωe , with Ω ≈ Ωh = ∪e=1
Ωe .
The partition Ωh is also called the grid. h is a parameter denoting the maximum
width of the cells, such that a small h means a finely grained grid Ωh with many
elements and a large h means a very coarse grid with few elements. A result of this
partitioning is that any domain can be approximated by using enough cells. The
cells typically have simple shapes like (in 3D) tetrahedra or hexahedra. We will
only use the latter.
By E we mean the set of all elements, and by δE we mean the set of all element faces. The grid vertices (corners of the hexahedra) are denoted xi , and the
midpoints of the faces are denoted m j .
After the spacial partitioning, the continuous function space H is approximated
with a finite dimensional space Hh (usually) built from low-degree polynomials
with support on only one or a few elements. The local support of each polynomial
makes it very easy to construct an almost orthogonal basis, which translates to
very sparse matrices in the algebraic equations. The combination of a polygonal
domain Ωe and the local function space defined on this cell is called an element.
In the Mixed Finite Element method, there are two or more unknowns which are
approximated in different function spaces H, and with different finite spaces Hh ,
like the spaces Vh and Qh for velocity and pressure from the previous section.
To construct the basis vi we first express the coefficients ui more abstractly
through nodal functionals νi (u). These functionals also define what the value of
each coefficient ui should be interpreted as.
ulh (x) =
(5.31)
NV
X
νi (ulh )vi (x).
i=1
We wish to make the matrices sparse, and we need to make the basis functions vi
linearly independent. As part of fulfilling these requirements, we can require that
νi (v j ) = δi j ,
(5.32)
∀i, j.
The discrete finite element spaces must be chosen close enough to the continuous spaces, such that a good approximation exists in the discrete spaces. That is,
the spaces must fulfil the approximation properties
(5.33)
(5.34)
inf kv − vh k ≤ chm−1 kvkHm ,
vh ∈Vh
inf kq − qh k ≤ chm−1 kqkH m−1 ,
qh ∈Qh
∀v ∈ H10 ∩ Hm ,
∀q ∈ L2 ∩ H m−1 ,
where c is a constant independent of h. These expressions suggest that the velocity
space should be chosen with one degree higher order than the pressure space, and
this is the case for most mixed elements in use.
The approximation properties are not enough. If the finite element spaces
aren’t chosen properly, the condition number of the algebraic systems may deteriorate as h gets smaller, making it difficult or impossible to solve the algebraic
30
5. NUMERICAL METHODS
equations for a fine enough grid. For the simpler Stokes equations
∂u
− ν∆u + ∇p = f,
∂t
∇·u = 0,
(5.35)
(5.36)
this problem has been solved. To obtain stable algebraic equations for the Stokes
equation, the finite element spaces Vh and Qh should fulfil the Babuška-Brezzi
condition
bh (qh , vh )
(5.37)
inf sup
≥ β > 0,
qh ∈Qh vh ∈Vh kvh k0 kqh k0
with β independent of h.
Stabilization. The properties above guarantees stability for the Stokes equation, but for the full Navier-Stokes equation additional problems may occur. For
convection-dominated flows, a normal discretization of the convective terms may
lead to unstable equations. This could be avoided by having fine enough grids,
but the requirements may be too large for practical applications. The remedy is
to introduce stabilization terms during the discretization procedure. Two common
techniques are called upwinding and streamline diffusion. Turek describes the differences in the approaches chosen for Featflow briefly in [30]. Streamline diffusion
is the most accurate of the two (O(h2 ) vs O(h)), but is very sensitive to problem
specific parameters that are difficult to choose, and may need a finer grid than upwinding to show its strengths. Upwinding on the other hand, is easier to handle
since there is only one parameter to choose. Some quick numerical tests did not
reveal any significant differences for a typical problem. For that reason, we stick
with simple upwinding.
The Q̃1 /Q0 element. The mixed element we use here was introduced by Rannacher and Turek in [26]. The geometric cells are hexahedra. For the pressure we
use a piecewise constant space Q0 , ie the pressure is constant in each cell (and thus
discontinuous over the element edges).
(5.38)
Q0 = span {q(x) = C E ∈ R | x ∈ E
∀E ∈ E} .
This is the simplest space possible in L2 .
For the velocity we first define an element Q1 where each vector component is
in the following space
n
o
(5.39)
Q1 = span 1, x, y, z, x2 − y2 , x2 − z2 .
The Q1 /Q0 element satisfies (5.37) independently of h, but depends on regularly
shaped grid cells. If we modify the function space a bit we can get stability independently of the shape of the cells, both angles and anisotropy.
Looking at a single element E ∈ E, we denote the faces Γi , i = 1, · · · , 6. Let mi
be the midpoint of the corresponding face. Locally on this element we can define
three directions spanned by vectors between opposite midpoints. With origo in
the middle of the element cell, we let the coordinates ξ1 , ξ2 , ξ3 refer to this local
coordinate system, and define the new function space
n
o
(5.40)
Q̃1 = span 1, ξ1 , ξ2 , ξ3 , ξ12 − ξ22 , ξ12 − ξ32 .
5.4. TEMPORAL DISCRETIZATION
31
After defining this function space, we still have a choice of which basis to use. One
possible definition of νi is simple point evaluation in face midpoints:
(5.41)
νi (u) = u(mi ).
Instead we will use the mean value of u over one face:
Z
1
(5.42)
νi (u) =
u ds.
|Γi | Γi
The element Q̃1 /Q0 satisfies (5.37) independently of both h and the shape of
the element, making it suitable for grids with large anisotropies and complicated
boundaries.
5.4. Temporal discretization
We have managed to turn the continuous spacial differential operators into discrete algebraic operators. But we still have the continuous time derivative ∂u
∂t . Next
we will deal with how to handle time in discrete steps.
One-step theta schemes. Given a general differential equation
(5.43)
∂u
+ Lu = f,
∂t
where L is a spacial partial differential operator, a common framework for several
temporal discretization schemes is the theta rule. To advance from a given solution
ul−1 at a given instant tl−1 to a new time tl , we approximate (5.43) by the difference
scheme (5.44).
∆t = tl − tl−1 ,
ul = u(tl , x),
θ ∈ [0, 1],
θ0 = 1 − θ,
(5.44)
ul − ul−1
+ θL(ul ) + θ0 L(ul−1 ) = θf l + θ0 f l−1 ,
∆t
or
(5.45)
[I + θ∆tL]ul = [I − θ0 ∆tL]ul−1 + θ∆tf l + θ0 ∆tf l−1 .
The fully explicit system with θ = 0, usually called Forward Euler, is the most
efficient method. Unfortunately this method is very unstable, possibly leading to a
blowup of errors in the solution, and requires very small time steps which decreases
the efficiency gain. On the other hand we have the fully implicit system with θ = 1,
Backward Euler, which is unconditionally stable, and thus allows us to take larger
time steps. Both these Euler schemes have O(∆t) accuracy, meaning that the error
is reduced proportionally to a reduced time step.
If we choose θ = 0.5 we get the Crank-Nicholson scheme which has O(∆t2 )
accuracy, but is only A-stable. With this scheme we can experience oscillations in
the solution if the time step is too large.
32
5. NUMERICAL METHODS
Fractional Step scheme. With some modifications, we can construct a CNlike scheme with O(∆t2 ) accuracy which is also strongly A-stable. We can reach
this goal by taking several time steps with different choices of carefully chosen θ
parameters.
Let ∆t = tl − tl−1 be a macro time step, and define the parameters
θ ∈ [0, 1],
θ0 = 1 − θ,
α ∈ (0, 1),
β = 1 − 2α.
In the Fractional Step scheme we will take three smaller time steps α∆t, β∆t and
α∆t again. The first and last time steps use the same θ, while the middle step swaps
θ and θ0 .
[I + θα∆tL]ul+α = [I − θ0 α∆tL]ul + α∆tf l ,
(5.46)
[I + θ0 β∆tL]ul+1−α = [I − θβ∆tL]ul+α + β∆tf l+1−α ,
[I + θα∆tL]ul+1 = [I − θ0 α∆tL]ul+1−α + α∆tf l+1 .
If the parameters θ and α are chosen like
√
2
α=1−
(5.47)
,
2
1 − 2α
θ=
(5.48)
,
1−α
the scheme has second order accuracy and the linear part of the matrices are the
same in all substeps.
Adaptive choice of macro time steps. The idea behind any numerical method
we use is to get the most accuracy from as little computational cost as possible, within reasonable complexity in implementation. The reason we use implicit
solvers for the algebraic systems is that the explicit solvers need very small time
steps to retain stability. With implicit solvers we can take larger time steps, but at
a larger cost for each solution step. To balance the costly solving process we need
to avoid taking too many time steps. In the systolic part of the heartbeat there is
fast velocity increase where we probably need a smaller ∆t than the rest of the time
interval. We now try to automatically select a timestep based on error estimates.
For implicit solvers, we know no a priori error estimates, so we have to rely on
rough error indicators instead.
For simplicity, we define v = {u, p}. Let J(v) be a functional that measures a
quantity of we wish to control the error. Next let k| · k| be an appropriate norm to
measure the error in. Then the goal of this error control is to decide the time step
such that
(5.49)
k|J(v) − J(v∆t )k| ∼ ,
where is a user specified tolerance, and v∆t is the approximate solution after a
time step ∆t.
We first assume a second order time scheme, and the relation
(5.50)
J(v) − J(v∆t ) ∼ ∆t2 e(v) + O(∆t4 ),
5.4. TEMPORAL DISCRETIZATION
33
where e(v) is the part of the error that is not time step dependent. With the CrankNicholson scheme, we perform one step with a time step ∆t = 3∆t˜. Then we
perform three steps with the fractional step scheme, with a total time interval of ∆t.
Each substep is then approximately ∆t˜. Let vCN and vFS be the solution after the
one CN step and the three FS steps, respectively. The error indicator we will use is
based on the following heuristic argument.
(5.51)
J(v) − J(vCN ) ∼ (3∆t˜)2 e(v) + O(∆t˜4 ),
(5.52)
J(v) − J(vFS ) ∼ ∆t˜2 e(v) + O(∆t˜4 ),
Jrel = J(vCN ) − J(vFS ) ∼ 8∆t˜2 e(v),
Jrel
(5.54)
.
e(v) ∼
8∆t˜2
From the assumption (5.50) we can then argue that the timestep ∆T we need
to use to get within the error tolerance should satisfy approximately
(5.53)
(5.55)
∼ J(v) − J(v∆T ) ∼ ∆T 2 e(v).
Combining (5.54) and (5.55) finally gives an estimate for the new timestep ∆T
(5.56)
∆T 2 ∼
8∆t˜2 ∼
,
e(v)
Jrel
so we set
(5.57)


∆T = 
1/2

8∆t˜2  .
k|J(vCN ) − J(vFS )k|
The final algorithm becomes
• A macro timestep ∆t is given.
• Solve the algebraic equations once with a Crank-Nicholson time scheme.
• Solve the algebraic equations with a Fractional Step time scheme, meaning three steps with a total timestep of ∆t.
• Calculate the error with some appropriate norm k| · k| and functional J(v).
• Find a new timestep ∆T from (5.57).
– If the new timestep is much smaller than the old, start over.
– If not, advance to the next timestep and set ∆t = ∆T .
With this adaptive approach to choosing time steps, we at least have a working
error control, however crude it is. This allows us to take fewer time steps in total
and small time steps where needed. As an added bonus, we can spend less time in
a manual search for the necessary timestep.
There are several user parameters in this algorithm. We mention them together
with the default values we have chosen here.
• At the first timestep we need a starting ∆t (TSTEP), which we set to 0.1.
• The automatically selected timestep is limited to the range ∆t ∈ [∆tmin , ∆tmax ]
(DTMIN,DTMAX), which we set to [0.005, 0.2].
• When choosing a new timestep it can be up to DTFACT=4 times the old.
• New timesteps may be tried up to IREPIT=9 times.
• The tolerance (EPSADL) is 1.25e − 4.
• The functional J(v) is chosen with IEPSAD=7, which means
(5.58)
J(v) = max{kuk, kpk, kuk∞ , kpk∞ }
34
5. NUMERICAL METHODS
5.5. The Preconditioned Richardson Iteration
Let us step back and look at a general algebraic system
(5.59)
Ax = b.
Assume we have an approximation xn to x. Then the error e satisfies
(5.60)
Aen = A(x − xn ) = b − Axn ≡ rn ,
where rn is the residual of equation (5.59). If we can approximate the operator A−1
with another operator C −1 that is more efficient to evaluate, we can approximate
the solution x by
(5.61)
x = xn + en = xn + A−1 rn ≈ xn + C −1 rn .
If we can show that the error is reduced by this new approximation, we can iterate
towards the solution x by
xn+1 = xn + C −1 b − Axn .
(5.62)
This iteration is called the preconditioned Richardson iteration, and the operator
C −1 is the preconditioner. To find the requirements on the preconditioner we look
at the error.
(5.63)
(5.64)
en+1 = xn+1 − x = xn − C −1 (Axn − b) − x = (I − C −1 A)(xn − x),
ken+1 k ≤ kI − C −1 Akken k.
Thus the error is reduced in each iteration if
(5.65)
ρ = kI − C −1 Ak ≤ δ < 1.
The quantity ρ is called the convergence rate. If the upper bound δ is small, the
number of iterations to reach a certain accuracy will always be low. The iteration
is typically stopped if we reach a predefined accuracy, often measured by a norm
of the residual, or a maximum number of iterations is reached.
5.6. Discrete projection method
The projection method is a splitting approach, where we avoid handling both
the incompressibility constraint and the nonlinearity in the same equation. Instead
we get a few simpler equations to solve, which in turn will be handled in later
sections.
Notation. Assume a particular time stepping scheme with parameters θ1 , θ2
and α has been applied to the Navier-Stokes equation. Further assume a spacial
discretization with the Mixed Finite Element Method has been applied. The result
is a non-linear algebraic system of equations. Let M be the mass matrix, A be
the discrete Laplace operator, and K(u) be the (non-linear) convective operator. B
is the discrete ∇ operator, while −BT becomes the ∇· operator. We will use the
notation
(5.66)
(5.67)
N(u) ≡ θ1 ν∆tA + θ2 ∆tK,
S (u) ≡ αM + θ1 ν∆tA + θ2 ∆tK,
5.6. DISCRETE PROJECTION METHOD
35
to simplify later expressions. The fully discretized system of non-linear algebraic
equations can now be written as
"
# " # " l#
S (ul ) ∆tB ul
g
(5.68)
=
,
0
BT
0 pl
with g including all terms from previous timestep corresponding to the time scheme.
If we multiply the momentum equation by BT S −1 :
(5.69)
∆tBT S −1 Bp = BT S −1 g − BT u,
we get the Pressure Schur Complement equation, where the last term disappears
because of the incompressibility:
∆tBT S −1 Bp = BT S −1 g.
(5.70)
Velocity approximation. We first find the intermediate velocity ûl using the
pressure pl−1 from the previous timestep. Since the pressure is known, we can
move it to the right side and obtain a set of non-linear Burgers equations, ignoring
the continuity equation completely. The problem becomes
Find ûl such that
S (ûl )ûl = gl + Bpl−1 .
(5.71)
The Burgers equations can be interpreted as a model for compressible flow,
and the intermediate velocity will in general not be divergence free. To solve these
equations, we need a way to invert the non-linear operator S (u). We will come
back to that issue later.
Pressure Schur Complement solver. The divergence of the intermediate velocity field takes the form
(5.72)
BT ûl = BT S −1 gl + ∆tBT S −1 Bpl−1 .
This simplifies calculating the right hand side of the Pressure Schur Complement
equation, since
(5.73)
∆tBT S −1 B(pl − pl−1 ) = BT S −1 gl − ∆tBT S −1 Bpl−1 = BT ûl .
If we introduce the pressure update vector p̂l ≡ pl − pl−1 the problem
Find p̂l such that
1
(5.74)
BT S −1 Bp̂l = BT ûl .
∆t
Overall algorithm. After the two main steps of the splitting scheme above,
we need to perform a couple of simple update steps to obtain the final solutions.
The final overall algorithm becomes as follows. Given solutions from previous
timestep ul−1 , pl−1 , and the right hand side gl including all known terms from the
time discretization scheme, perform the following steps.
1 Find ûl such that
S (ûl )ûl = gl + ∆tBpl−1 .
(5.75)
2 Find p̂l such that
(5.76)
BT S −1 Bp̂l =
1 T l
B û .
∆t
36
5. NUMERICAL METHODS
3 Perform the pressure update step
(5.77)
pl = pl−1 + p̂l .
4 Perform the velocity update step
(5.78)
ul = ûl − ∆tMl−1 Bp̂l .
The update steps are cheap, simple vector additions and sparse matrix-vector
products. So are the right hand sides of the equations (5.75) and (5.76). How to
invert the operators S and BT S −1 B efficiently are the themes of the next sections.
5.7. Preconditioners
We wish to perform efficient solutions of the equations (5.75) and (5.76), using iterative methods (multigrid, see section 5.9). To reach this goal, we need
preconditioners for the operator BT S −1 B and S −1 . In this section we describe the
preconditioners used.
The operator S , described in section 5.3, has the structure
(5.79)
S = M + θ1 ∆tνA + θ2 ∆tK(u),
where M is the mass matrix resulting from the zero order term, A is the stiffness
matrix, or discrete Laplace operator, resulting from the (∇u, ∇v) term, and K(u) is
the nonlinear convection operator. Since the preconditioners we construct are to be
used as components when solving linearized equations either inside the nonlinear
iteration for the Burgers equations or for the Pressure Schur complement part of
the projection scheme, we can see the operator K as linear.
We do not have a preconditioner that matches all the components in S . As an
alternative we choose an additive approach, where we construct optimal preconditioners for each term in S and add them together to form a total preconditioner.
(5.80)
−1
−1
BT S −1 B ≈ C −1 = αR A−1
R + αD AD + αC AC .
Here αi are user specified parameters, and A−1
i are optimal preconditioners for each
term. The subscripts refer to the reactive term, diffusive term and convective term.
There is no known optimal preconditioner for the convective term, so AC has been
omitted. For the other two operators to be optimal for each of their parts, we should
have spectral equivalence with the corresponding terms from S .
(5.81)
AR ∼ BT M −1 B,
(5.82)
AD ∼ BT A−1 B.
The preconditioners are chosen as follows.
(5.83)
(5.84)
AR = P = BT Ml−1 B,
AD = M p .
Here M p is the pressure mass matrix, and Ml is a lumped velocity mass matrix.
Mardal and Winther discuss the optimality of these preconditioners in [18]. The
use of AR = Ml leads to the velocity update step 5.78 fulfilling the continuity
equation exactly.
5.9. MULTIGRID
37
5.8. Nonlinear iteration
When solving the Burgers equations, we need to handle the nonlinearity in
some way. This is also done in an iterative fashion, where the previous timestep
is used as an initial guess for iterations which aim to improve the solution step
by step. When combined with a multilevel approach like multigrid (see the next
section), the nonlinear iteration can either be done for each level, or applied as an
outer daemon with the multilevel solver operating on linearized equations. Here
we use the latter approach, which means the nonlinear algorithm is responsible for
the total convergence of the Burgers equations.
The chosen method in Featflow is an adaptive fixed-point iteration. The fixedpoint method has slower convergence than the well known Newtons method, but
each step is more efficient and it is less sensitive to the initial guess. Because of an
adaptive choice of the relaxation parameter, this method is robust without having
to choose parameters experimentally. The only parameters we need to consider is
number of iterations and the stopping criteria. The default values we use for these
are (Featflow parameter name in parenthesis):
• Minimum number of iterations (INLMIN): 2
• Maximum number of iterations (INLMAX): 99
• Limit for U-changes (EPSUR): 1.0e-2
• Limit for U-defects (EPSUD): 1.0e-5
• Limit for U-defect improvement (DMPUD): 1.0e-1
For more details regarding the nonlinear iterations we refer to [30]. Our experience
is that two iterations are sufficient most of the time, for our problems with the
timesteps we have chosen that is.
5.9. Multigrid
After all the steps we have now performed, we’re left with a huge system of
linear algebraic equations to solve in each iteration of the nonlinear solver engine.
The performance of the software is mostly dependent on solving these linear subproblems efficiently. With possibly millions of unknowns and equations, using
direct solvers like Gaussian elimination is out of the question because their complexity grows exponentially like O(nα ) with α > 1. Luckily, our matrices are sparse
giving O(N) complexity for both storage and multiplication with a vector. This
makes simple iterative methods like Jacobi, Gauss-Seidel and ILU (Incomplete
LU-factorization) cheap. However, the simple iterative methods are only efficient
on a range of the error, namely the part of the error that oscillates quickly over the
grid (high frequency error). Thus they are often called smoothers, in particularly
in the multigrid context.
Recall from section 5.5 that if xk is an approximation to x = A−1 b, then the
error ek = x − xk is related to the residual rk by
(5.85)
Aek = rk .
Geometric multigrid works by defining a sequence of grids with different levels of
refinement, and then using simple and efficient smoothers of O(n) complexity to
reduce the high frequency part of the error on each grid level. On the coarsest grid,
the equations are solved with an exact solver, but this time with a significantly
lower number of unknowns. As long as the fine grid solvers dominate the time
usage, then the total algorithm is O(n).
38
5. NUMERICAL METHODS
An important part of the algorithm is the grid transfer operators, which are
responsible for mapping the solution vectors from one grid to another. Transfer
from a fine grid to a coarse grid is called restriction and the other way around
is called interpolation. Here Ωh denotes the fine grid and Ω2h the coarse grid.
Similarly, uh and u2h denotes the solution vectors on the same grids. In Featflow,
the restriction and interpolation operators
(5.86)
Ih2h : Ωh → Ω2h ,
(5.87)
h
I2h
: Ω2h → Ωh ,
(5.88)
u2h = Ih2h uh ,
(5.89)
h
uh = I2h
u2h ,
only support simple refinement where each element from the coarse grid Ωh is refined into eight elements on the finer grid Ω2h . This can in principle be done any
number of times, but since the size of the grid and number of unknowns increases
about eight times for each refinement, memory quickly becomes a limiting factor.
In the simulation cases later, the coarse grids have typically been refined only twice
or trice, giving three or four grid levels. This is because the complexity of the geometry requires a rather complex coarse grid in the first place. Chapter 6 describes
the software used to generate this sequence of grids. For more details about the
multigrid method used in Featflow, see [30]. The following lists the default parameters chosen for our simulations. The parameters include choice of solver and
smoother algorithms as well as smaller details.
For u we use BiCGSTAB with ILU as preconditioner (ISLU=4), and for p
we use CG with ILU as preconditioner (ISLP=4). We enable matrix renumbering
for both with a Cuthill-MacKee method (ISORTU=3, ISORTP=3), which Turek
claims to be a must when using ILU.
As smoothers, we use ILU for both u and p (ISMU=4, ISMP=4). For velocity
we use 2 pre/postsmoothing steps on the fine grid (NSMU=2), multiplied with
a factor 4 for each coarser level (NSMUFA=4, ie 8 for second gridlevel, 32 for
third). For pressure the factor is the same but we use twice as much smoothing
on each level (NSMP=4, NSMPFA=4). Remember that the nonlinear iteration is
“responsible” for the overall convergence of the Burgers equations, so multigrid
for u does not need to work as accurately as for p.
The number of multigrid steps is restricted to the range [2,20] for u (ILMINU=2,
ILMAXU=20) and [5,150] for p (ILMINP=5, ILMAXP=150). The pressure equation iteration is stopped when the residual (EPSP) reaches 1.0e-12.
5.10. Calculating derived quantities
We are interested in viewing the shear stresses and flow rates, but Featflow does
not calculate this. The following describe the algorithms for these calculations.
Numerical flow rate calculation. First let us look at the flow through a single
face Γ j in the grid. The flow rate Q of a fluid with velocity u through a surface Γ is
given by
Z
(5.90)
Q(Γ) =
u · n ds.
Γ
5.10. CALCULATING DERIVED QUANTITIES
39
We denote by u j the three velocity components from the unknown vector (5.27)
that are related to the face Γ j . To find u j from ui (see (5.31)), a mapping between
local (on each element) and global (on the complete system of equations) degrees
of freedom needs to be done. This is handled easily in the code by a simple array
lookup, and we will not go into details about this here. Since each element face is
flat, the normal vector is constant, and by (5.42) we can then simply write
(5.91)
Q(Γ j ) = |Γ j | (u j · n j ),
since u j already represents the average of u over the face.
To calculate |Γ j | and n we just use some simple algebra. Let {pk | k = 1, 2, 3, 4}
be the vertices of the face in counter-clockwise direction. Define the vectors
a = p2 − p1 ,
b = p3 − p1 ,
c = p4 − p1 ,
d = p4 − p2 .
(5.92)
(5.93)
(5.94)
(5.95)
Then we have for a single face j:
|Γ j | = 0.5(ka × bk + ka × ck),
b×d
(5.97)
.
nj =
kb × dk
Let Γ denote a crossection of a vessel, and F denote the set of faces on this
surface in the grid. The flow rate through Γ is then easily calculated by summing
the flow rates through each face.
X
(5.98)
Q(Γ j )
Q(Γ) =
(5.96)
Γ j ∈F
Numerical stress calculations. Section 2.5 describes how to calculate the
stress vector s. Here we briefly explain how we calculate the velocity gradients
numerically. We only calculate the stress vector on faces Γi on the boundary ∂Ω.
This means that only one element has nonzero basis functions in this point. Furthermore, we only calculate the stress on the midpoint mi of each face, resulting
in a piecewise constant surface. In the rest of this section, denote by udk the velocity vector component in direction d associated with face Γk . Then the velocity
derivative with respect to x j is
6
(5.99)
X ∂vk
∂uh
(ml ) =
udk
(ml ).
∂x j
∂x j
k=1
The element routines in Featflow is used to calculate
expressions from section 2.5 the rest is trivial.
∂vk
∂x j (ml ),
and by following
CHAPTER 6
Grid generation software
The Circle of Willis is a complicated geometry which can not be described in
any simple way. No two people have an equal circle, and it is highly relevant to
have control over geometric variations. There are two possible approaches to this
problem, each with strong and weak sides.
The most accurate approach is to use image-based methods. Modern hospitals
have advanced imaging equipment capable of scanning the human head to create
3D volumetric images. An example image made by angiography is shown in figure
1.1 in the introduction, and another image made by MRI in figure 4.1. With the
help of techniques like signal processing, image segmentation, and automated grid
generation these images can be converted into 3D volume grids usable for the Finite
Element Method. This is very complicated for a geometry of this complexity,
specially because the resolution of the volumetric images often is insufficient to
capture all the details, such that the process cannot be fully automated. Cebral et
al has done this for the full CoW, with a semi-automatic approach. They describe
their current approach in [5]. If one wishes to capture patient-specific geometric
details an approach like this is absolutely necessary. But image-based methods
can only create grids from a given volumetric image, and is thus insufficient if one
wishes to do specific variations in the grid.
In this thesis, we wish to be able to create variations in diameters, angles, and
vessel connections. As an alternative approach we attempt to parameterize the
geometry. This necessarily means some simplifications compared to a real-world
geometry, but the major features of the resulting geometry should at least be close.
As a simplification, vessels can be approximated by circular pipes with smooth
walls. We ignore special details like aneurysms in the vessels. The circle can
then be be approximated by a network of pipes (see f.ex. figure 1.2). Section 6.2
describes the parameterization we have developed. This approach is close to the
approach used in [20] which was published this year, where the authors used the
commercial CAD software Solidworks to make a grid of the CoW based on splines
drawn after an MRI image.
6.1. Software requirements
Featflow only supports the hexahedral element described in chapter 5. Most
available grid software uses tetrahedra and is thus of little use. We also need to
construct a sequence of grids with increasing level of detail to use the geometric
multigrid method. The refinement strategy assumed by the Featflow package places
restrictions on the grid sequence. Featflow only supports regular refinement, where
each coarse element is subdivided into eight finer elements by using the midpoints
of the six coarse faces and the midpoint of the coarse cell as the new grid vertices.
All elements must be refined at each step, which rules out adaptive techniques
41
42
6. GRID GENERATION SOFTWARE
F 6.1. Crossection grid with two refinements.
(except very crude, manual “adaptivity”). To allow curved boundaries, boundary
points should always be placed on the correct boundary. These small deviations
from the perfect regular refinement will affect the accuracy of the grid transfer
operators. This shouldn’t be a problem for the accuracy of the overall problem,
since the post-smoothing step in the multigrid algorithm should pick up this kind
of fine-grained error anyway.
To perform this grid generation task, custom software had to be developed.
This software generates multiple grid levels for the multigrid solver in Featflow
based on an input file describing a parameterization of a network of pipes. The
refinement procedure refines (almost) uniformly and preserves curved boundaries
as required.
This grid generation is very explicit, which translates to high efficiency 1, but
a more limited geometric flexibility than other grid generation software packages
may offer. Possible problems include large curvature vs radius on certain vessel
sections, or particular angles in bifurcations. Additionally, if one wanted to add
an aneurysm or other special geometric details, the explicit approach used in this
software would not be very well suited. However, as the grids in chapter 7 will
show, in the cases we simulate here this method has worked out fine.
6.2. Parameterization
Crossections. Before we define the parameterization and show how a grid is
constructed from it, we introduce a central grid component in our grid tools. For
a single vessel crossection the grid is made the same way everywhere. On the
coarsest grid, there is a layer of eight elements around the circular boundary. In
the middle there are four more elements. The size of the boundary layer can be
controlled, as a kind of crude adaptivity. Refined grids will have the boundary
node pushed exactly out to the outer circle, while grid nodes closer to the middle
are uniformly refined. An example of a crossection grid with two refinements is
shown in figure 6.1.
Piecewise cubic curves. We will use piecewise cubic curves in several different contexts during the grid generation process. Therefore we first define how there
curves are constructed in a general setting. A function f is defined on an interval
[0, L]. On each subinterval [si , si+1 ] the function will assume the values of a cubic
1The grid generation is faster than writing the results to disc, at least on a modern computer.
6.2. PARAMETERIZATION
43
function fi . Different choices of representation of fi can lead to different properties
and different user parameters.
We choose to use Hermite interpolation, which gives intuitive user parameters
for our problem. The user specifies function values and derivative values at the
endpoints.
(6.1)
fi : [0, 1] → R,
(6.2)
(6.3)
fi (0) = ci ,
fi (1) = ci+1 ,
d fi (0)
= di ,
dt
d fi (1)
= di+1 .
dt
(6.4)
(6.5)
One common basis for cubic curves is {1, t, t2 , t3 }. If we instead use the basis
(6.6)
b1 (t) = 2t3 − 3t2 + 1,
(6.7)
b2 (t) = −2t3 + 3t2 ,
(6.8)
b3 (t) = t3 − 2t2 + t,
(6.9)
b4 (t) = t3 − t2 ,
we can write the cubic curve as
(6.10)
fi (t) = ci b1 (t) + ci+1 b2 (t) + di b3 (t) + di+1 b4 (t),
t ∈ [0, 1].
In the end we tie the cubic functions together as one function
f (s) : [0, L] → R,
(6.11)
(
(6.12)
)
s − si
f (s) = fi (
) | s ∈ [si , si+1 ] .
si+1 − si
The interval length L and partition {si } will be computed automatically. To define a
curve pi (t) in space, the values ci are simply replaced by points ci , and the derivatives di are replaced by tangent vectors ∆ci . The geometric length of each cubic
curve is obtained by integrating the tangent magnitude
Z t
dpi (t)
(6.13)
Li =
k
k dt,
dt
0
(6.14)
Z L
N−1
N−1
N−1
X Z si+1 dpi ( s s−s−si )
X Z 1 dpi (t)
X
dp(s)
i+1
i
k
L=
k ds =
k
k ds =
k
k dt =
Li .
ds
ds
dt
0
i=0 si
i=0 0
i=0
This means we can calculate the sublengths Li from each cubic piece of the curve
first, then define the total curve by
(6.15)
s0 = 0,
si =
i
X
Lk ,
i = 1, · · · , N,
k=0
(6.16)
p(s) = {pi (t) | s ∈ [si , si+1 ],
i = 0, · · · , N − 1} .
44
6. GRID GENERATION SOFTWARE
It should be mentioned that the derivatives are not scaled correctly in the software,
but this bug was kept intentionally to keep compatibility with already existing grid
descriptions. The piecewise curves should ideally satisfy
(6.17)
d fi (1) d fi+1 (0)
=
ds
ds
to make f (s) C1-continuous, but because of the bug we do not have this relation
and lose C1-continuity. Instead we have
(6.18)
d fi (1) d fi+1 (0)
=
dt
dt
or
(6.19)
Li+1
d fi (1)
d fi (1)
= Li
.
ds
ds
For most of the vessels in our grids, only one cubic curve is enough since the
geometry has plenty of bifurcations. In the few cases where more than one curve is
used, we usually have Li+1 ≈ Li which means the impact of the bug is insignificant.
Vessels. Each vessel is modeled as a tube around a parametric curve P(s) :
[0, L] → R3 , with variable radius R(s) : [0, L] → R, where L is the length of the
curve. For simplicity, we combine control points for the radius with control points
for the curve. Each control point ci on the parameterized curve has a coordinate pi ,
tangent vector ∆pi , tube radius ri , and radius derivative ∆ri .
(6.20)
ci ≡ {pi , ∆pi , ri , ∆ri }
To construct the coarse grid, first the parameterized curve is partitioned into a set
of parameterization coordinates ui = h x i, where h x is a user parameter 2. These
coordinates are independent of si , where the pieces of the curve are fitted together.
For each coordinate ui , a plane crossection of the tube is created. This plane has
i)
center point P(ui ), normal vector n in the direction of the curve tangent dP(u
ds , and
radius R(ui ). The vessel has a default up direction uD which is a user specified
parameter. We perform a Gram-Schmidt orthogonalization to find a local up vector
u that is orthogonal on n, and find the left vector l with a cross product.
(6.21)
(6.22)
(6.23)
(6.24)
dP(ui ) −1 dP(ui )
k
,
ds
ds
v = uD − (uD · n)n,
v
u=
,
kvk
u×n
l=
.
ku × nk
n=k
We can then define a local coordinate system with origo in P(ui ) and directions u, l.
The crossection grid points are simple to calculate in this local coordinate system.
If the curvature of the curve is too large compared to the radius, two subsequent
crossections may cross each other. This will make an invalid grid. Automated
checks for this hasn’t been implemented, but this error is easy to spot by visual
inspection of the grid, since it will always be visible on the boundary of the grid.
6.2. PARAMETERIZATION
45
F 6.2. Simple bifurcation grid.
Bifurcations. A number of vessels can be connected in an intersection, or bifurcation. This intersection is defined by listing which vessels should be connected
in clockwise order. Additionally, a number of tuning parameters are available for
better control of the geometry (for instance preserving the right angles).
First we draw cubic curves between the leftmost point of one crossection and
the rightmost point of the next. The tangents of the curve are taken with the same
directions as the tangents from the end of each crossection. User specified parameters αiL and αRi+1 define the magnitudes of these tangents. These cubic curves
define the sides of the bifurcation between pairs of vessels. The user parameters
allow control over the shape of the bifurcation.
Similar curves are drawn between the top and bottom points of each pair of
crossections. Let us denote the midpoints of these curves by mTi , miB , such that
mTi is on the curve between the top of crossections i and i+1. The top and bottom
midpoints of the bifurcation are defined as a weighted average of these points with
user specified weights ωi .

 n
n
X −1 X




T


(6.25)
ωi mTi ,
m =  ωi 
i=1
(6.26)
i=1
 n

n
X −1 X
B
m =  ωi 
ωi miB
i=1
i=1
The weights ωi are typically used for bifurcations where one small vessel connects
to a large vessel. The largest weight should then be assigned to the curve between
2This parameter can be seen as the approximate discretization length in the coarse grid along
the vessel length direction.
46
6. GRID GENERATION SOFTWARE
the two crossections from the large vessel. After finding the bifurcation midpoint,
curves are drawn from the top and bottom point of each crossection to the new
midpoints. Like with the side curves, tangent magnitudes are specified with user
parameters αTi , αiB at the crossection end of the curves and αTi M , αiBM at the midpoint end.
An example bifurcation grid is shown in figure 6.2. The crossection grid at the
end of a vessel is extended to the middle of the bifurcation. Here the left half of a
crossection is connected to the right half from the next crossection.
This approach has some limitations. It fails completely if three perpendicular
vessels are connected, which is of course an unnatural case. For most cases where
three vessels lie in the same plane, it works perfectly. For cases in between, care
must be taken that the positions and angles of the vessels fit correctly together, and
some parameter tuning may be necessary.
In practice, all bifurcations in the CoW are simple enough for this approach
except one. The area where the ICA splits into the MCA and ACA was a little bit
problematic. If specific configurations are wanted, it is possible that this approach
would fail. However, after careful tuning the final result was acceptable for our use
and can be seen in chapter 7.
6.3. Input file description
Figure 6.3 shows an example input file for the grid generation software. The
first part is the header, with parameters affecting the grid generation globally. The
parameters include the number of grid refinements to perform, the number of sections and intersections in the file, a scalar factor which may be used to scale the discretization parameter h x for all vessels, and a boundary layer size for the boundary
layer control. The three last parameters can enable alternatives in the algorithms
that were implemented for various reasons but are unused today.
Next we see a listing of all vessel sections. The first parameter is h x , followed
by four integers to identify the end boundaries of this vessel later. If the vessel
ends are not on the boundary of the total grid, these can be ignored. Otherwise the
first two integers can be set to 1 for essential boundary condition or 2 for natural
boundary condition on the beginning and end of the vessel respectively. The next
two integers are id tags which may be referenced in the parameter file when defining a simulation, and are not used in the grid generation. For example “0.5 1 2 3
4” will set h x = 0.5, essential conditions with id 3 on the beginning of the vessel,
and natural conditions with id 4 on the end of the vessel. The next line defines the
default up vector uD for this vessel, followed by the number of control points in
the piecewise curve. For each control point ci , there is one line containing p, ∆p, r
and ∆r.
After defining the vessel sections, we can define the intersections. An intersection is defined by a h x parameter, the number of connected sections, and one line
per connected section. The connected sections must be in clockwise order. Each
connection line starts with the number of the section to connect, and an integer 1
or 2 indicating that the beginning or end of the section is to be connected. The
sections are numbered, starting from 1, in the order they are listed in the file. Next
we have the midpoint influence weight ωi , and the final 6 numbers are the tangent
scales αiL , αRi , αTi , αiB , αTi M , αiBM , which can be used to fine tune the bifurcation
geometry. At the end of the file the user may write comments about the grid.
6.3. INPUT FILE DESCRIPTION
=============================== H e a d e r :
3
! nrefine
5 2
! nsections , nintersections
1.0 0.2
! s c a l e d t , boundary l a y e r s i z e
1 1 1
! node d i s t r . ( 1 / 2 ) , t a n g e n t s c . ( 1 / 2 ) , u n u s e d ( 1 )
=============================== S e c t i o n s :
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− (BA) B a s i l a r A r t e r y
1.50 0 0 0 0
0.00 0.00 1.00
2
0.00
10.00
0.00
0.00
1.40
0.00
0.46
−0.08
0.00
12.20
0.00
0.00
3.36
0.00
0.40
−0.06
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ( R BA)
R i g h t BA t o PCA s t u b
1.50 0 2 0 5
0.00 0.00 1.00
2
0.54
12.80
0.00
1.00
0.40
0.00
0.26
0.00
2.06
13.50
0.00
1.00
0.40
0.00
0.26
0.00
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ( L BA)
L e f t BA t o PCA s t u b
1.50 0 2 0 6
0.00 0.00 1.00
2
−0.54
12.80
0.00
−1.00
0.40
0.00
0.26
0.00
−2.06
13.50
0.00
−1.00
0.40
0.00
0.26
0.00
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ( R VA) R i g h t V e r t e b r a l A r t e r y
1.50 1 0 1 0
0.00 0.00 1.00
2
2.00
7.00
0.00
−0.60
2.20
0.00
0.35
0.00
0.60
9.00
0.00
−1.20
1.80
0.00
0.35
0.00
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ( L VA) L e f t V e r t e b r a l A r t e r y
1.50 1 0 2 0
0.00 0.00 1.00
2
−2.00
7.00
0.00
0.60
2.20
0.00
0.35
0.00
−0.60
9.00
0.00
1.20
1.80
0.00
0.35
0.00
================================ I n t e r s e c t i o n s :
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− VA−BA
0.30
3
4
2
0.0
1.0
0.8
0.4
0.4
0.4
0.4
5
2
1.0
0.8
1.0
0.4
0.4
0.4
0.4
1
1
1.0
0.4
0.4
0.4
0.4
0.4
0.4
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− BA
0.30
3
1
2
1.0
0.6
0.6
0.4
0.4
0.4
0.4
3
1
9.0
0.8
0.1
0.4
0.4
0.4
0.4
2
1
1.0
0.1
0.8
0.4
0.4
0.4
0.4
================================ Comments :
F 6.3. Example input.grid file
47
CHAPTER 7
Simulations
Overview. In this chapter we have collected all the simulations. We use geometries ranging from simple cylinders, through bifurcation geometries, to a full
grid of the Circle of Willis. We also examine some variations of the posterior part
of the geometry. Simulations on the simpler geometries are defined with the aim
to examine the effect of variations in boundary conditions and solver parameters,
and to computationally verify the convergence of the solution w.r.t. h. We test
inflow velocity profiles and asymmetric pressures on outflow boundaries. Since
the boundary conditions in this application are based on coarse data and extensive
assumptions, it will be useful to have at least a rough feeling about the extent of
error that we introduce by choosing “wrong” boundary conditions. We verify our
grids with manufactured analytical solution, and we examine the convergence of
the shear stress, which is of one order lower accuracy than the velocity.
When we examine the simulation on the full Circle of Willis, we try to relate
the results to physiological reference values. Only average values from groups of
people are presented in the studies we know of, so we can only say if our results
show relatively normal behavior. We also wish to discuss the neccesity of simulating flow in the whole circle versus focusing on smaller parts of it.
In most of the sections, there are references to movies. The references point
to the list in appendix B which describes the content of the accompanying CD. In
the subsections below we collect issues common to all simulations and recap some
relevant notation from earlier chapters.
Scaling. To interpret the simulation results as physical quantities, we need to
scale the results back from the dimensionless quantities. The plots in this chapter
have been scaled, but the 3D figures shown in this chapter have not, which means
that the dimensionless numbers should be interpreted in the characteristic units
defined in chapter 4, table 4.3. Denoting the dimensionless quantities with hats
and the physical quantities without as before, we list a summary of the scaling of
each unit in table 7.1. For example, a max shear stress value of 0.1 in the figures
represents 25 Pa, a max velocity of 1.6 in the figures would represent 80 cm/s,
Physical quantity Calculated by
x
0.5 x̂
p
250 p̂
τ
250 τ̂
u
50 û
t
0.01 tˆ
Q
12.5 Q̂
T 7.1. Scaling.
49
Physical unit
cm
Pa
Pa
cm/s
s
ml/s
50
7. SIMULATIONS
Name
Value
N pulses Number of heartbeats
t0
0.0
t1
88.3 · N pulses
∆tmin
0.005
∆tmax
0.200
∆t start
0.100
T 7.2. Default time interval and ∆t range.
and a pressure difference of 2.0 represents 500 Pa (or 0.05 bar). For most of the
discussion here, we are interested in relative values, and ignore the scaling. The
exception is the validation against physiological reference values.
Common solver parameters. The following properties need to be specified
for each simulation:
• Domain Ω with artificial boundaries Γi and corresponding grid. This
chapter is sectioned by geometry, but each section may or may not define more than one grid of the same geometry. Each section will present
at least one figure showing the geometry. All the grid description files are
included on the CD (see appendix B).
• Boundary conditions for each artificial boundary Γi . See below.
• Eventual other solver parameters, in particular time parameters and stopping criteria (accuracy requirements) for the iterative solvers. Unless otherwise mentioned, the time parameters will be set like in table 7.2. Other
default solver parameters are described in chapter 5 together with the description of each part of the numerical methods. Deviations from the
defaults will be described in each section.
Boundary conditions. To describe boundary conditions compactly in the following sections, we recap a few functions defined in previous chapters here. Remember that the boundary ∂Ω is split into three different sets.
n o n o
(7.1)
∂Ω = ∂Ω0 ∪ ΓiN ∪ ΓEj .
The physical vascular walls, denoted ∂Ω0 , have a no-slip condition:
(7.2)
u = 0,
x ∈ ∂Ω0 .
All the artificial boundaries Γi are circular. The set Γi is split into boundaries with
essential conditions, ΓiE , and boundaries with natural conditions, ΓiN . Unless otherwise is specified, we use essential conditions on the inflow boundaries and natural
conditions on the outflow boundaries.
For each ΓiN we need to specify a pressure function Pi (t).
1 ∂u
− pn = −Pi (t)n,
x ∈ ΓiN .
Re ∂n
For each ΓiE we need to specify a flow rate function Qi (t) and a spacial velocity
profile vi (t, r), where r is the local radial coordinate on Γi . The flow rate functions
re f
re f
QV A (t) and QICA (t) from chapter 4 are the usual choice, scaled with the timeaveraged flow rate. The velocity profiles are chosen from vw , v2 and v9 defined in
(7.3)
7.1. MANUFACTURED SOLUTIONS
51
chapter 3.
(7.4)
u = −v( t, r)n,
x ∈ ΓiE .
7.1. Manufactured solutions
Featflow has been used and tested by many others for many applications, so
we assume that the solver in general is working well. However, we need to verify
that the grids produced by our own grid tools create valid grids for Featflow. To
verify the grids, we run some simulations with the general manufactured analytical
solution described in section 3.3. We first make some runs on cylinders with a
range of discretization parameters. Next we test the reference CoW grid in two
parts, the posterior and anterior parts.
Cylinder. In all the cylinder tests we use the same geometry, with radius 0.5
and length 12. We discretize with different coarse grid h x in the length direction
and with different levels of refinement. The tested discretization parameters were
h x = {1, 1.5, 2, 4}, with n = {2, 3, 4} grid levels. Almost all these simulations failed
to converge! The only configuration that converged properly with the stationary
solver CC3D was the finest grid, with h x = 1 and n = 4. Even on this level, the
relative L2-error was 0.1 and the relative H1-error was 0.65.
Anterior CoW. On the anterior part of the CoW grid we got similar results.
We did variations in levels of refinement, but the h x parameters (not the same for
all vessels) were fixed. The stationary solver converged for n = 4, but not for
n < 4. The relative L2 error was then 0.072 and relative H1 error was 0.804.
The convergence rates for the multigrid and nonlinear iterations were in the ranges
ρ MG ∈ [0.25, 0.76] and ρNL ∈ [0.34, 0.73].
Posterior CoW. For the posterior part of the CoW grid the solver first diverged even with n = 4, but with a decrease in the largest h x parameters for some
of the vessels we got convergence for n = 4. The relative L2 error was then 0.027
and relative H1 error was 0.403. The convergence rates for the multigrid and nonlinear iterations were in the ranges ρ MG ∈ [0.22, 0.96] and ρNL ∈ [0.18, 0.61].
Results. This manufactured solution is of course far from the solutions we
wish to approximate later, but these simulations are only meant to verify that the
grids are ok. We found that it was difficult to even get convergence in the solver
for this problem. At the very least, we managed to get a solution with an L2-error
within 10% for all sufficiently detailed grids. The grids are not well suited for this
manufactured solution, and in the more realistic simulations, the grids capture the
solution a lot better such that the solver does not need the finest grids to converge.
Because of this, and a limited time frame, we are satisfied with obtaining a solution that demonstrates the correctness of the grids. We ended with doing some
changes to the discretization parameters of the reference grid, hopefully improving
the worst parts of the grid.
It is not possible to run simulations on the more complex geometries with 5
grid levels with our current available hardware because we would need more than
4 Gb of memory. We cannot increase the complexity of the coarse CoW grid much
further either without a severe decrease in the efficiency of the geometric multigrid
algorithm, since the coarse grid solver already uses enough of the solver time. In
52
7. SIMULATIONS
F 7.1. Snapshot of cylinder simulations with different inflow
velocity profiles.
some of the simulations below we look at the grid detail necessary for the wall
shear stresses in a realistic flow scenario.
7.2. Cylinder
Geometry. The geometries to be used in these tests are the cylinders Ω0.5
10 and
with boundaries Γin and Γout .
Ω0.5
30 ,
Boundary conditions. The question we ask here is, how far into the pipe is
the spacial velocity profile on the inflow significant? To answer this question, we
re f
run simulations with the same flow rate Q(t) = 0.22QV A (t), three different profiles vw (t, r), v2 (t, r) and v9 (t, r) on the inflow boundary, and homogeneous natural
conditions on the outflow boundary.
(7.5)
(7.6)
(7.7)
re f
Qin = 0.22QV A (t),
vin (t, r) = {vw , v2 , v9 },
Pout = 0.
Results. As demonstrated in figure 7.1, the characteristics of the incoming
velocity profile is lost after just a few diameter 1. In movie 1a we can see how the
Womersley profile vw is reproduced after just 5 diameters even with v9 on the inlet.
This length may be larger if the inlet profile is not symmetric like vγ here.
So far it seems that the Womersley profile is the most natural choice, since it
appears naturally. But it should still be remembered that this is only valid for a
straight pipe, and the profile in a vessel shortly after a bifurcation or curve is not
in general symmetric like the prescribed analytical profiles here. Examples of this
can be seen in section 7.3. Blood vessels in and just before the CoW usually don’t
follow straight lines for more than a few diameters before they bend or bifurcate,
leading to the conclusion that radially asymmetric profiles like seen in figure 7.5 is
the rule rather than the exception. Nevertheless, if the geometry and viscous forces
make v2 and v9 lead to the same results after a short enough distance, the eventual
error should be negligible.
The quadratic profile v2 is very close to the Womersley profile. This can be
attributed to the fact that the constant throughput of blood leads to a dominating
1There was a bug in the Womersley code when running these simulations, so the flow rate is
slightly higher or lower for the vw profile some times during the pulse. However, the difference is
small so we did not bother to rerun the tests.
7.3. FLATTENED ICA
53
f lat
F 7.2. Pressure contours at peak systole on Ωica .
f lat
F 7.3. Pressure contours under diastole on Ωica .
re f
Fourier coefficient Q0 for the flow rate function QV A . Flatter profiles like v9 is
more likely to appear closer to the heart, where the pulse is more intense.
7.3. Flattened ICA
Geometry. We demonstrated in section 7.2 that practically any choice of (symmetric) velocity profile on the inflow of a simple cylinder leads to the Womersley
solution after about 5 diameters under typical blood flow conditions. Now we
construct a domain by taking the ICA vessel from the reference CoW grid, and
54
7. SIMULATIONS
f lat
F 7.4. Maximum wall shear stress on Ωica .
flattening the parameterization curve to the z=0 plane. This vessel has a radius
f lat
a = 0.5, and the resulting domain Ωica is shown in figure 7.4. The domain is
discretized with h x = 0.8 on the coarse grid, and 3 refinements (4 gridlevels). This
gives a max h around 0.1, or 0.5 mm. There are two artificial boundaries, which
E and ΓN . We run the simulation for three heartbeats.
we name Γin
out
Boundary conditions. In these simulations we wish to see how much of the
velocity profile that survives the curved vessel. We use our reference ICA flow
rate, and define three simulations where only the velocity profile on the inflow is
different. The outflow boundary has natural homogeneous conditions.
f lat
Ω = Ωica ,
re f
(7.8)
Qin = 0.33QICA (t),
vin (t, r) = {vw , v2 , v9 },
Pout (t) = 0.
Results. During the flow through the curved vessel, a force is needed to accelerate the blood in the right direction. This force is represented by the pressure
gradient, which points from the outer towards the inner wall, giving higher pressure on the outer wall and low pressure on the inner wall. This can be seen in the
figures 7.2 and 7.3, and the dynamics are very well illustrated by the movies 3a,
3c. At the same time, the blood velocity is high close to the outer wall, and close to
the inner wall the blood is almost not moving. This naturally leads to a lower wall
shear stress on the inner wall, and higher on the outer wall. Figure 7.4 illustrates
this 2 with the maximum wall shear stress for both v = v2 and v = vw . The figure
also shows how the stress is increased in a focused point on the wall, where the
2See also movies 3b, 3d for the different WSS patterns with v = v and v = v , respectively.
2
9
7.4. FLATTENED BASILAR ARTERY
55
(a) v9, t=10
(b) vw, t=10
f lat
F 7.5. Velocity profiles on entry and exit of Ωica .
curvature is largest, just before the area with low flow and low stress. (This point
is almost like a corner, and probably sharper than how a natural vessel curve would
look like). All these characteristics are very similar regardless of the chosen spacial
velocity profile. The largest differences are found, as expected, close to the inflow
boundary.
When looking at the velocity profile at the end of the vessel, we see that the
profile is skewed because of the low velocity on the inner curve and high velocity
on the outer curve. At the peak of the systolic pulse the end profiles look the same,
as seen in figure 7.5. However, there are differences, illustrated in figure 7.6 from
in the diastolic part of the heartbeat.
7.4. Flattened Basilar Artery
Geometry. This geometry is a simplification of the area around the Basilar
Artery. It includes the left and right VA which combines into the BA, then splits
again into the beginning of the left and right PCA. However, the z variation of the
vessel curves is removed like in the flattened ICA case, to simplify visualization of
56
7. SIMULATIONS
(a) v9, t=50
(b) vw, t=50
f lat
F 7.6. Velocity profiles on entry and exit of Ωica .
the results. The grid is refined twice, using 3 gridlevels. This domain is referred to
f lat
by Ωba and the grid is shown in figure 7.7.
Boundary conditions. We use our reference VA flow rate functions. We use
non-homogeneous natural conditions on the two outflow boundaries ΓR and ΓL .
We test two main issues.
First, we run with three different velocity profiles vin = {v2 , v9 , vw } on the inflow. We use the same conditions on both inflow boundaries. The question now is if
the bifurcation geometry changes the flow enough to cancel most of the differences
in the inflow profile.
Second, we introduce a pressure difference 0.5 between the outflow boundaries
by setting PL = 1.0, PR = 0.5. Here we wish to see how significant the resulting
pressure gradient is for the flow. The value 0.5 is chosen in the same order of
magnitude that the pressures in the first simulation take on. Realistic pressure
differences might be smaller, but this illustrates a maximum pressure difference.
Results. We first look at the choice of velocity profiles on the inflow boundaries. Figure 7.8 shows the left and right half from the simulations with v = v9
7.4. FLATTENED BASILAR ARTERY
57
f lat
F 7.7. Flattened Basilar Artery, Ωba
f lat
F 7.8. Velocity field on lower half of Ωba with v = v9 (left)
and v = vw (right) as inflow conditions.
and v = vw , respectively. (In this symmetric geometry, the left and right side of
the velocity field is equal at all times). It is clear from the simulation results, illustrated by this snapshot 3 , that the choice of inflow velocity profile does not affect
3See also movie 4b for the whole heartbeat.
58
7. SIMULATIONS
f lat
F 7.9. Average pressure and shear stress on walls of Ωba
with symmetric (left) and asymmetric (right) pressure on outlets.
F 7.10. Velocity field (cut plane z=0) at the BA-PCA bifurf lat
cation in Ωba just before peak systole.
7.4. FLATTENED BASILAR ARTERY
59
F 7.11. Velocity field (cut plane z=0) at the BA-PCA bifurf lat
cation in Ωba at peak systole.
f lat
F 7.12. Flow rates in main vessel and outlets of Ωba with
asymmetric pressure on outlets.
60
7. SIMULATIONS
f lat
F 7.13. Pressures in the Ωba geometry with asymmetric
outflow pressure conditions.
the velocity field after the first bifurcation (at least visibly, this has not been quantified exactly). This naturally leads to the same shear stress results in the BA-PCA
bifurcation.
The pressure shows some difference, however small. With v = vw the pressure
gradients are just a few percent smaller, but the time-averaged pressure is equal in
“eye-norm“ over the whole domain. There is no visible difference in the characteristic high pressure area where the blood from the BA vessel hits the wall between
the left and right outflow vessels.
In these simulations, the grid for the vessels is coarser than in the bifurcation.
The shear stress is computed as a piecewise constant field (see section 5.10), with
values computed at the midpoints of the element faces on the boundary. Thus the
shear stress is not represented well in areas with large spacial gradients. This can
be seen f.ex. in figure 7.9, where the shear stress looks more discontinuous than it
should be in the area between the left and right outflow vessels. There are obvious
grid artifacts other places in the bifurcation as well, coinciding with edges in the
parameterization, which clearly demonstrates the need for both a smoother surface
description and fine enough grids when computing this quantity. As a side effect,
it also illustrates the importance of realistic vascular wall geometry on a detailed
level if one wishes to calculate accurate shear stress values. In the next section the
shear stress in a bifurcation is calculated on finer grids to check consistency and
accuracy of the solution better.
Next we examine the simulations with a pressure gradient between the outflow
boundaries. Figure 7.9 show the time-averaged pressure and shear stress on the
walls. The pressure is almost unchanged at and before the BA-PCA bifurcation,
7.5. BIFURCATION
61
and in particular the characteristic high pressure area at the middle of the bifurcation has a very similar shape and max value, compared to the symmetric solution.
As expected, the shear stress is more sensitive to the changes in velocity, such that
the shear stress at the middle of the bifurcation is asymmetric and directly related
to the redistribution of blood.
Examples of the velocity profiles in the BA-PCA bifurcation is shown in figures 7.10 and 7.11, at t=96 and t=99 respectively (just before and at the peak systole, after one pulse). As can be seen in these figures, when the flow rate increases
fast this results in an increasingly skewed profile in the outlet vessels here. This is
easier to see in the movie 4a.
Figure 7.12 show how the flow rate distribution between the left and right outlets is not the same throughout the heartbeat. Throughout the diastolic part of the
beat, the low pressure outlet gets an increasingly large portion of the blood. At the
end diastole there is almost no flow through the high pressure outlet. This can be
attributed to the fact that the pressure difference between the inflow and outflow
boundaries is highly varying through the heartbeat, see figure 7.13. Thus the constant pressure gradient in our case has a larger relative influence in the diastolic part
of the pulse. The side-side pressure difference chosen here has nothing to do with
realistic values, but this simulation still serves to illustrate the effects such differences can have on the flow. It is not only important to have realistic values for the
pressure differences among different artificial vessel boundaries, but the pressure
gradient variation through the heartbeat makes transient pressure differences count
as well.
7.5. Bifurcation
Geometry. To investigate the shear stress accuracy in the critical parts of the
bifurcation closer, we run some simulations on a simple bifurcation where it is possible to do further grid refinements because the coarse grid is simpler. In contrast to
f lat
the Ωba grids above, the coarse discretization in the length direction, h x , is about
the same in the vessels as in the bifurcation. We perform the same simulation with
a different number of grid levels n, with n from 2 to 4. We also try a set of grids
with n=4 and smaller h x . And at last we try with stricter accuracy requirements for
the velocity equation.
We also tried with n=5, which was the largest grid used in this thesis, but this
simulation failed. It was not possible to build Featflow with enough memory to run
the grid with n=5, because the linker ld failed with common blocks 4 of sufficient
size. This means the best we can do is compare the simulations with 3 and 4 grid
levels.
Boundary conditions. The boundary conditions are the usual
re f
(7.9)
Qin (t) = 0.22QV A (t),
v(t, r) = vw ,
PL (t) = 0,
PR (t) = 0.
4Common blocks are the way Fortran77 enables shared global memory between subroutines and
compilation units. The FEAT library uses this concept to implement its own semi-dynamic memory
allocation system, since Fortran77 does not have the concept of dynamic memory.
62
7. SIMULATIONS
Results. Both velocity, pressure, and shear stress show highly visible differences between the simulations with n=3 and n=4. Since we cannot refine further to
demonstrate convergence with respect to h, we cannot currently trust the absolute
values in the simulations. The differences are, not unexpected, much larger in the
shear stress than in pressure and velocity. In particular, the max shear stress show
a difference of up to 25 % (!) between n=3 and n=4. However, the characteristic
spacial distribution of both shear stress 5 and pressure 6 in the bifurcation is the
same in all simulations, giving us at least a little bit of confidence in the qualitative
correctness of the results.
The grid artifacts in the beginning and middle of the bifurcation actually grow
more visible for finer grids. This can be attributed to the grid generation tools.
Since the unsmooth parts of the geometry is actually a problem in the parameterization, these edges get more distinct with a more refined grid.
In chapter 3 we calculate the analytical wall shear stress for an idealized velocity profile with degree γ. The shear stress values on the walls of the vessels are
in good agreement with (within 10% of) this expression, even with n=3.
However, the velocity gradient in the the boundary layer in the bifurcation is
very steep, and may require finer grids than we have here. To compute accurate
shear stress with the tools we use here will thus require some more work on validation and gridtools. The bottom line is that although the qualitative features of
our simulation results are probably ok, we cannot trust the actual values of the wall
shear stress in the interesting areas. We end this section by refering to movie 2b,
which shows four visualizations of the same simulation (v = vw ) at once. Focusing
at the WSS and pressure in the bifurcation during systole, we see how the pressure
pushes on the wall in the middle of the bifurcation while the shear stress pulls to
each side at the same time. Clearly, this part of the vascular wall is subject to a
much harder treatment than the walls in regular vessels.
7.6. The Circle of Willis
re f
Geometry. We define a reference domain Ωcow (figure 1.2) which is meant to
describe an “average” Circle of Willis. A volumetric image from MRI scans were
the first source when we started writing the parameterization. In the image we had
to work with7 it was difficult to distinguish some of the vessels clearly from the
surrounding tissue. Therefore, the rest of the parameterization was written based
on pictures from medical atlas, and guidance from Dr. Jørgen Isaksen. Vessel
lengths, radii, and vessel connection points are close to average sizes found in
medical literature (see table 4.1).
Boundary conditions. This domain has a total of 12 artificial vessel boundaries. Blood flows in through four vessels (left and right ICA and VA) and out
through eight vessels (left and right PCA, ACA and two MCA). As usual, we have
essential conditions on the inflow boundaries and natural conditions on the outflow
re f
boundaries. The inflow boundaries use the reference flow rate curves QV A (t) and
re f
QICA (t) as described in chapter 4, and the inflow velocity profiles will be chosen
5Movie 2c shows the wall shear stress pattern during systole clearly.
6In movie 2a, we see that the v profile leads to a larger pressure gradient than the Womersley
9
solution close to the inlet boundary, but the difference disappears once the v9 profile is “killed”.
7Thanks to Dr. Tor Ingebrigtsen for providing this dataset.
7.6. THE CIRCLE OF WILLIS
63
F 7.14. Streamlines and pressure from the full CoW grid at
peak systole (t=186).
from v(t, r) = {vw , v9 } on all four boundaries. All the eight outflow boundaries have
constant pressure P(t) = Pavg = 30Pa in the reference simulation.
Results. The inflow velocity profile had as expected little relevance, so all
results discussed here are taken from the simulation with v = vw . Figure 7.14 shows
velocity-colored streamlines and pressure on the surface on the full CoW grid,
taken from the peak systole on the third pulse of the simulation. In sections 7.7 and
7.8 a comparison is done with other simulations on the anterior and posterior part
of this domain, respectively. Following is a comparison of the simulation results
with physiological reference values.
In [17] average velocities for ICA and MCA are reported to be 40 cm/s (0.8
U) and 70 cm/s (1.4 U), respectively. This statement is supported by table 2 in
[1] which give a summary of several studies where the MCA/ICA velocity ratio
is reported as 1.76 on average. Velocity in the MCA is reported to be around 7894 cm/s at systole and 32-46 cm/s at diastole. In our simulations we have peak
velocities in the MCA of 80 cm/s at peak systole (see figure 7.17), and 35 cm/s at
the lowest point of diastole. This is well within the reported physiological ranges.
Flow in the PCoA is discussed in [16]. In only one of four patients the blood in
the PCoA flows in the direction from ICA to PCA, like we have in our simulations.
This can be because of the chosen pressure values on the outlets relative to the
position of the truncated boundaries. If the pressures on the posterior outlets were
larger relative to the anterior outlets, or the posterior vessels were truncated at
points closer to the Basilar Artery, this could change the flow direction in PCoA.
64
7. SIMULATIONS
Typical peak flow velocity in the PCoA is reported to be about 35±15 cm/s. In
our simulation here we have a peak flow rate in PCoA at 0.24 ml/s, corresponding
to an average velocity over a crossection of 18 cm/s, and a peak velocity of 35.8
cm/s if we assume a quadratic profile. This velocity is only reached for a very
short time at the peak systole, and most of the time it is only around half of this.
(In sections 7.7 and 7.8 we see increased velocity in the PCoA because of a low
pressure applied to the artificial PCoA boundaries). Like we saw in section 7.3, the
velocity profile on the end of the ICA vessel can be a little bit different depending
on the inflow profile. Since the blood from the outer wall of the ICA flows into
the PCoA, we examined the flow rate in PCoA for the two velocity profiles. This
slight difference in velocity profile results in a very small change in the flow rate in
the PCoA, but the difference is less than 0.5% of the total PCoA flow rate and can
easily be neglected.
Destruction or removal of the endothelium (an inner layer of the vessel wall)
of a normal healthy artery occurs for WSS above 30 Pa (see [4] and the references
therein). Thus it is interesting to observe that in our simulation of blood flow in the
full CoW, the maximum occuring wall shear stress is 20 Pa, which is well within
this limit. See section 7.9 for some simulations with WSS above 30 Pa.
The animations from the full CoW simulations with v = vw include one with
velocity vectors (movie 5a), one with the wall pressure (movie 5b), shear stress
from two angles (movies 5d, 5e), and streamlines in the Basilar Artery (movie 5c).
The first two show the overall behaviour of the flow, but it is difficult to see local
details. The shear stress animation clearly demonstrate the grid artifact problem
with the shear stress. In the last movie, the streamlines show how the flow in the
middle of the BA hits the bifurcation wall and separates to the right and left.
7.7. Anterior CoW
Geometry. We run simulations on subsections of the CoW reference geomere f
re f
try. First we try the domains Ωant , Ωantright . These are truncations of the domain
cut at the communicating arteries.
Boundary conditions. This truncation introduces a couple of new artificial
boundaries where the vessels have been cut, and our choice of boundary conditions
here will change the results. Comparing the results from the reference simulation
with these simulations can demonstrate the kind of modeling error we do, since
we now cut the vessels in another place than before. The outflow pressure on the
communicating arteries is simply set to the same pressure we use on the other
boundaries.
Results. As a direct result of the different placement of the artificial boundary
and the associated boundary conditions, there is a larger pressure drop to the PCoA
and ACoA vessels. This naturally leads to an increased flow in these vessels, and
consequently less flow in the MCA. Flow rates through selected vessels are shown
re f
re f
in figures 7.15, 7.16, from simulations with Ωantright and Ωcow , respectively, and
v = vw 8 on the inflow.
8Using v = v or v = v yield the same flow rates.
9
w
7.8. POSTERIOR COW
65
F 7.15. Flow rates from simulation with the antcowright
grid. (Negative flow in PCoA means from anterior to posterior.)
re f
Figure 7.18 shows 9 velocity-colored streamlines and pressure on the Ωantright
grid. The differences in pressure drop and velocity are obvious. Flow directions
are the same, and the shear stress does not show significant differences aside from
the direct effects of increased flow. The largest shear stress 10 is found at the PCoAICA connection and MCA split, two of the common aneurysm locations.
7.8. Posterior CoW
Geometry. This time we cut the PCoA on the other side, close to the ICA, to
re f
obtain the posterior part of the CoW. This geometry is denoted by Ω post , and can
be seen in figure 7.20.
Boundary conditions. The boundary conditions are chosen the exact same
way as for the anterior part. Like the simulations above, this means the pressures
at the end of the PCoA are different from the reference simulation in section 7.6,
which changes the flow pattern.
The boundary conditions are the same as the reference simulation for the common boundaries. In addition the two boundaries ΓNPCoA needs pressure functions
assigned to them. As above we set Pi = 0.75. On the inflow we use v = vw and
re f
Q = 0.11 · QV A (t).
9
See also movies 6a (wall pressure) and 6d (streamlines).
10The movies 6b, 6c show the wall shear stress.
66
7. SIMULATIONS
F 7.16. Flow rates from simulation with the full CoW grid,
main vessels in the anterior/right part.
F 7.17. Pressure and streamlines colored by velocity from
the anterior/right part of the full CoW grid.
7.8. POSTERIOR COW
F 7.18. Pressure and streamlines colored by velocity from
the antcowright grid.
F 7.19. Pressure, WSS, and streamlines colored by velocity
re f
for the posterior part of Ωcow .
67
68
7. SIMULATIONS
F 7.20. Pressure, WSS, and streamlines colored by velocity
re f
from Ω post .
Results. Figure 7.20 shows the simulation results at peak systole. The flow
follows the streamlines from high to low pressure. The streamlines are colored
by velocity, and shows clearly how the blood stagnates at the symmetric BA-PCA
bifurcation, then flows faster to each side through the thinner P1 segments. The
shear stress matches the flow pattern well 11 , with max values where the velocity
gradients are largest close to the walls. The PCA-PCoA bifurcation shows a similar
pattern for both the shear stress and pressure.
Figure 7.19 shows the same simulation results at peak systole, but from the
reference simulation of the full CoW. Here the blood flows through PCoA from the
anterior to the posterior side. This obviously influences the velocity in the PCA
vessels, which is now just as high throughout the PCA as it is in the P1 segment in
both simulations. It also influences the shear stress in the PCA-PCoA bifurcation.
Now the shear stress is high only on one side of this bifurcation, on the entry of
PCA. The flow rate, and therefore the shear stress, is in this case very low in the
PCoA vessel. However, the flow, pressure distribution and shear stress in the BAPCA bifurcation is unchanged (both the spacial distribution and max value is the
same).
7.9. POSTERIOR COW VARIATIONS
69
F 7.21. Time-averaged pressure on posterior geometric variang
ations Ωrad
post and Ω post (right).
Vessel Original radius
Right
Left
VA
1.75 mm 1.25 mm 2.00 mm
P1
1.30 mm 1.05 mm 1.60 mm
PCA
1.35 mm 1.00 mm 1.45 mm
PCoA
0.65 mm 0.85 mm 0.55 mm
T 7.3. Radius variations in posterior grid
7.9. Posterior CoW variations
Finally, we do some simulations with variations around the Basilar Artery.
At the BA-PCA bifurcation lies the most common place for aneurysms, so it is
interesting to investigate the effect of changes in this area.
re f
Geometry. Based on the posterior reference grid Ω post from section 7.8, we
do two geometric changes. First, we do a variation of the radii in the VA, PCA and
PCoA. Table 7.3 shows the changes. This new geometry is denoted Ωrad
post . Second
rad
we keep the changes from Ω post , change the angle of the P1 segments in the BAang
PCA bifurcation, and denote this geometry by Ω post . Both geometries can be seen
in figure 7.21. A notable feature of these geometries is that the right side is the
same for both, and the radii are the same. This way it is easier to analyze the effect
of the change in angle.
Discretization. In addition to making these geometric variations, we improve
the discretization parameters a bit around the P1 segments. We run simulations
with 4 gridlevels, since this seems necessary by previous tests. This results in large
grids, with over 540 thousand elements and about 1.65 million faces. In addition
we increased the accuracy demand EPSUD for the Burgers equations from 10−5 to
10−8 , and doubled the number of smoothing steps. We reduced the minimum ∆t to
10−6 , letting the adaptive timestep algorithm choose the size without our limitation.
11See movies 7e (WSS) and 7b, 7a (velocity vectors).
70
7. SIMULATIONS
(a) τavg
(b) τmax
F 7.22. τavg (a) and τmax (b) in geometric variations of Ω post
7.9. POSTERIOR COW VARIATIONS
71
The resulting average macro12 timestep was about 0.03 and the simulations ran for
about 2850 macro timesteps. Hence the simulation times were long, about 18 days
for each simulation on 3.5 GHz Intel Xeon processor.
Boundary conditions. To have the simulations comparable to the simulations
re f
on Ω post we keep the same total flow volume in the Basilar Artery. For the same
reason we keep the same pressure on the outflow boundaries. However, it is more
natural to divide the flow in uneven portions between the left and right VA since
their crossectional area are different now. For all simulations here we have
(7.10)
(7.11)
vr = vl = vw ,
Pi = 0.75.
On the asymmetric grids with 4 gridlevels we use
n
o
ang
(7.12)
Ω = Ωrad
post , Ω post ,
re f
(7.13)
Qr (t) = 0.3 · 0.22 · QV A (t),
(7.14)
Ql (t) = 0.7 · 0.22 · QV A (t).
re f
We repeat a simulation on the improved symmetric reference grid:
(7.15)
re f
Qr (t) = Ql (t) = 0.11 · QV A (t).
In addition, we do one simulation on the symmetric reference grid with different
flow rate:
re f
(7.16)
Qr (t) = 1.1 · 0.11 · QV A (t),
(7.17)
Ql (t) = 0.9 · 0.11 · QV A (t).
re f
This last simulation is only done with three gridlevels.
Results. We notice that the flow rate distribution between the right and left
sides is only affected by the asymmetric radii and unchanged by the angle difference. Perhaps the most interesting features in these simulations are the shear stress
distribution in the downstream bifurcations. Figure 7.22 shows the maximum and
re f
ang
average WSS over time for Ω post , Ωrad
post and Ω post in the bifurcations before and
after the P1 segments. In these images we recognize the WSS pattern from previous sections in the symmetric geometry. In addition we see that the WSS pattern is
very similar in the right PCA-PCoA bifurcation for both the new geometries. Similarly, the WSS is in general significantly lower (about half as large) in the left P1
ang
segment of Ω post than in the other two, because of the change in angle which lets
the blood from the BA flow through the left P1 segment almost without changing
direction. It is obvious that the angles and radii of a bifurcation is fundamental
for the spacial WSS distribution. As a final note, the max WSS values in the right
PCA-PCoA bifurcations of the two modified geometries are higher than the color
scale on the figures indicate. In fact, the max WSS values are about 32 Pa, which
is higher than the force needed to damage the inner vascular wall. Thus we have
here demonstrated conditions under which aneurysms may start to grow, under the
assumption that the shear stress is in fact the critical factor.
12In each macro timestep the equations are solved four times.
CHAPTER 8
Conclusions
We have performed simulations of blood flow in an “average” Circle of Willis
and parts of the circle with some geometric variations. In the next subsections, we
first discuss the limitations on the validity of our results due to of modeling errors
and numerical errors. Next we proceed to discuss the most important observations
from the simulation results. In the end we round off by mentioning related work
carried out by various research groups around the world, and discussing possible
future research directions.
Limitations of the current study. We have applied many simplifications in
the mathematical model. These are described in chapter 2 and will not be repeated
here. However, simulation results can never be more accurate than the applied
input data are. Just as important as the use of a better mathematical model is to
obtain more data from real patients. The amount of data we have used in this thesis
is not enough either as good input or for good validation of the results.
One important numerical bottleneck has been the use of geometric multigrid
with regular refinement. This method places large restrictions on the element distribution in the grid for a geometry of this complexity. The minimum coarse grid
we could construct that kept all geometric features of the vessels without degenerating in the curves gave close to 10 thousand faces in the grid (and thus the same
number of unknowns for each velocity component). However, not all parts of this
grid would really need all the refinement we applied. Adaptive grid refinement in
the areas of interest, close to max values for the WSS in particular, is a must to
improve the accuracy of these computations without a huge computational cost.
A geometry like this also seems like a good candidate for domain decomposition.
These are some of the most important numerical components that Featflow lacks.
Simulation results. Although the set of simulations performed here is too
small to draw final conclusions, we have demonstrated that blood flow in this complex biomechanical system is computable today on a single workstation with modern numerical methods (though the simulation time is long enough to be counted
in weeks).
Using a steady state solution as the initial condition has proved to be a good
choice, since it is a good approximation of the flow pattern at the end of diastole.
The flow after one and two pulses looks the same. However, the flow rate distribution can be a bit different for the steady state solution than the flow rates obtained
during a transient simulation, in particular if the outflow boundary pressures are
constant but not equal like we tested in the flattened BA case. The reason for this
seems to be mainly that the pressure differences from inflow to outflow boundaries
vary during a transient simulation, while the outflow pressure difference was held
constant, thus getting a varying relative importance in the flow.
73
74
8. CONCLUSIONS
The choice of velocity profile at the inflow boundaries is not very significant
given that the boundary is about five diameters from the area of interest. For temporal flow rate shapes like we have taken from Ford et al, a quadratic velocity profile
is a close approximation of the Womersley solution. Thus this profile can very
well be used as a replacement without the implementation hassle of the Womersley
formula.
Our simulation results are well within normal physiological ranges as reported
in various medical studies. Although our total flow rates are a given quantity, the
flow rates in vessels within the circle may be affected by the chosen pressures on
outflow boundaries, and by the placement of the same boundaries. However, the
flow rates are at least realistic in average. We do not have the data necessary to
validate the pressures in our simulations.
Wall shear stresses take on their maximum values in three of the four bifurcations where aneurysms are most common, namely the BA-PCA bifurcation, the
MCA bifurcation and the ICA-PCoA bifurcation. These max WSS values only
reach about 20 Pa, which is less than the reported limit[4] the inner vascular wall
can withstand. This simulation is based on average conditions in all ways, so this
is not unrealistic. In the geometric variations of the posterior part of the CoW,
we reach WSS values of 32 Pa, demonstrating conditions under which the inner
vascular wall could be damaged.
Modeling errors of several kinds may need to be addressed in order to get
quantitatively correct shear stress values. Most of the simplifications we do have
a larger effect on this quantity than it has on the average flow properties. This includes the stress model, rigid or elastic vessel walls, and geometric wall details.
Computation of shear stresses also places the greatest requirements on the numerical methods, and in particular on the grids. It is possible that the WSS has not
converged properly because our grids are too coarse, since we were not able to
confirm convergence of this property w.r.t. h. Thus the max WSS values may
actually be larger (they are unlikely to be smaller).
The WSS seems to be mostly dependent on the geometric features of a bifurcation, and on the flow rate distribution between the vessels. Assuming correct flow
rates or pressures at the artificial boundaries, we can thus expect simulations performed on simpler geometries to give very good information on the spacial WSS
distribution and max values. This way we can use eventual increased computational resources for more accuracy in the areas of interest.
Only if one is interested in computing the overall flow rates and pressures in
the Circle of Willis does the simulation of the whole circle seem necessary. These
quantities can be computed more accurately than the shear stress with the same
computational effort, and is thus easier to compute on the whole geometry as well.
The resulting flow rates and/or pressures could for example be used as boundary
data for more detailed simulation of WSS on a smaller geometry.
Future research. All over the world researchers continue to contribute to the
field of Computational Biomechanics, which has been gaining increased interest
over the last few decades. In Italy and Switzerland, Quarteroni and his group work
with general blood flow research, including fluid-structure[25], multiscale simulations, other related areas. For an introduction to many of the existing mathematical
models related to cardiovascular simulations, see f.ex. [24]. In Japan, Marie Oshima [21] has performed fluid-structure simulations on the Basilar Artery with an
8. CONCLUSIONS
75
aneurysm modeled from images of a patient. In England, Cebral et al [5] have
developed image-based methods for generation of 3D grids for the CoW and coupled this with 1D tree models for improved outflow boundary conditions. Another
approach is seen in [20] by Moore et al, where an autoregulation model is applied
to simulations on the full 3D CoW with pressure drop boundary conditions. With
this approach they examine the response to pressure changes for a few common
geometric variations of the CoW.
The details around the circumstances leading to aneurysm occurrence and growth
is still a subject to research. Ingebrigtsen et al has done a study [15] where they
attempt to relate aneurysm risk statistically to observed geometric features of bifurcations in the Circle of Willis, by examining 3D angiography images of the
CoW from several patients. They found that bifurcation angles are predictors for
aneurysm locations. Because shear stress seems to be an important factor in the formation of aneurysms, simulation results from the current study support the ideas
behind this approach. We have demonstrated that shear stress distribution in a bifurcation is highly dependent on the bifurcation geometry. However, only a few
simulations have been performed here. A more systematic computational exploration of relations between bifurcation geometry and shear stresses can be of great
interest as a supplement to in vivo examinations in the research about aneurysms.
APPENDIX A
Solver software
For solving the incompressible Navier-Stokes equations, we use the open source
software package Featflow[6] by Stefan Turek et al, written in Fortran 77. This
package has two main solvers for 3D flow, called CC3D and PP3D. CC3D uses a
fully coupled approach while PP3D uses a projection method. An brief overview
of the numerics used in the PP3D package was given in chapter 5. The numerics
of the CC3D package has not been described here, but it is used for calculating the
initial conditions to PP3D by a stationary solution. For a more detailed description
of both solvers see the book [30] and the user manual [31]. The Featflow package build on the FEAT2D[3] and FEAT3D[12] libraries (Finite Element Analysis
Tools), which are general software packages for solving partial differential equations with the Finite Element Method. Written in Fortran 77 with a focus on speed,
this software is highly efficient but not very flexible and difficult to extend. The
rest of this chapter deals with the scripts, tools and Featflow extensions that has
been written during this thesis.
1.1. Installing the software
Prerequisites. The software has only been run on Linux platforms, and there
probably are a few platform-dependent shortcuts in the scripts. The Gnu Compiler
Collection version 4.0 [11] with gfortran and g++, as well as SWIG[29], Python
2.4[23], SciPy[28] and matplotlib[19] is assumed to be installed on the system.
Featflow. Install Featflow 1.3RC3, found on the CD, by following the installation instructions. Compiling Featflow and accompanying libraries may take a little
while. You should then define the environment variable $FEATFLOW to point to
the installation directory.
FeatCoW. Unpack the file featcow.tar.gz, found on the CD. Follow the instructions in the README file to compile the grid tools.
1.2. Using the software
Chapter 6 describes the parameterization of a domain, and the input file format
for the grid tools. The featcow.py script automates the running of this tool and
combines the contents of the grid input file with a parameter input file to generate grid files and otherwise prepare the Featflow solver for a particular case. The
script also handles some post processing and plotting of the results. The following
subsections describe step by step how to run the solver.
77
78
A. SOLVER SOFTWARE
Making the grids. Assuming you have a grid desciption in the file griddir/input.grid, the following command will make the grid sequence.
featcow.py -amakegrid -g griddir/
The gridfiles are written in AVS, GMV, and Featflow formats. The command
featcow.py -ashowgrid -g griddir/
will generate and show the grid using VTK without writing to file. Since the grid
generation is faster than writing the grid to disk, this is useful when writing grid
parameterizations.
Making the solver application. To make the solver application, you need to
compile some problem specific user code and link it with the CC3D and PP3D applications. This step will generate all the input files and Fortran 77 source code you
need for a particular simulation, and then build the CC3D and PP3D applications.
featcow.py -aprepare -g griddir/ -p paramsdir/ -s solverdir/
The resulting directory solverdir/ contains directories cc3d and pp3d with the compiled simulator software and all input files, ready to run.
Running the solver application. Use the command
featcow.py -arun -g griddir/ -p paramsdir/ -s solverdir/ -o outputdir/
to run the applications in the directories created above. This automates copying the
solution vector from the stationary simulation with CC3D to the PP3D directory,
and some post processing steps like finding the max, min and average velocity,
pressure and timesteps.
Calculating shear stresses. The command
featcow.py -acalcshear -g griddir/ -o outputdir/
calculates the wall shear stress from each dumped solution vector, as well as the
quantities τavg , τmin , τmax , pavg , pmin and pmax , defined in section 2.5. The actual calculations are done in a utility written in Fortran 95. The calcshear tool
was created as a separate tool written in Fortran 95 instead of incorporating in the
Featflow applications, mostly because of the convenience of dynamic memory allocation. To calculate the needed basis function derivatives, element code copied
from Featflow is used. The stresses are calculated on the midpoints of all essential
boundary faces, and dumped as a piecewise constant surface in AVS (.inp) format.
Source code for this tool is found in featcow/gridtools/src/calcshear.f90, since it
uses some modules from the grid generation code.
Running on a cluster. To run sets of simulations on the titan cluster at UiO,
the script runall.py was written. First you need a case directory, lets call it casedir/.
This directory should contain directories called grids/ and params/. Each subdirectory of those two directories should contain an input.grid file and a set of parameter
files, respectively. The command
runall.py casedir mprepare
will run a partial prepare, without the final compilation step, for all combinations
of grid and parameter files. For example, two directories under grids/ and three under params/ will lead to six simulations. After copying casedir/ to the titan cluster,
running the command
runall.py casedir qrun
on the cluster will finish compilation for all the cases with the local compilers,
1.3. INPUT.PARAMS
79
and queue them for execution. When the simulations are done, all post processing is applied and each simulation is neatly packaged as a gzipped tarball into the
∼/cases/finished/ directory. Although the manual commands above are useful for
local runs and small cases, this script is all that is needed for running large sets of
simulations. Note that Featflow and FeatCoW must be installed on the cluster as
well, but the local partial prepare step reduces the other software requirements.
Plotting results. After a successful simulation, you can plot the flow rates
through each vessel with the command:
featcow.py -aplotq -o outputdir/
Or through a selected set of vessels:
featcow.py -aplotq -o outputdir/ –sec=’BA, L ICA, R ICA’
The vessel names “BA”, “L ICA” etc. are taken from the input.grid file. Similarly,
you can plot the pressures at the midpoint of the beginning or end of each vessel in
the parameterization like this:
featcow.py -aplotp -o outputdir/ –sec=’BA In, BA Out, L PCA In, R PCA In’
The vessel names are the same, with an additional postfix “In” or “Out”. The
Matplotlib library is used for the plotting.
1.3. input.params
Figure A.1 shows the input.params file used for the reference simulation on the
full CoW. We will here step through the file and explain the format.
Defining boundary conditions. The first part contains one line for each artificial boundary in the grid. Each line has the format ID: ¡function string¿, where
ID is a number that refers to the ID assigned to the boundary in input.grid. The
function string must be a Fortran 77 expression, and a function of the variables
r ∈ [0, 1] and t. The function womVA() is explained later.
Overriding solver parameters. The files default cc3d.dat and default pp3d.dat
contain the default parameters for each of the two solvers. These parameters can
be overridden in the next parts of the input.params file. First is a section where
overrides common to cc3d.dat and pp3d.dat can be written. This is typically the
starting time TIMENS, the Reynolds number RE, and the number of grid levels
NLMAX. The next two sections contain overrides for pp3d and cc3d respectively.
The format of each override-line is simply set ¡PARAMNAME¿ = ¡VALUE¿ !
comment. During the ’-aprepare’ step mentioned above, the script will first read
the default parameter files, then replace the values for each overridden parameter
¡PARAMNAME¿ with the given value, and finally write out the resulting cc3d.dat
and pp3d.dat.
Fourier decomposition of flow rate functions. The next section contains
lines on the format NAME: N, T, EXPRESSION. NAME is just an identificator,
without spaces. EXPRESSION is a Python expression for the flow rate function, T
is the period of that function, and N is the number of Fourier modes to decompose
the function into. Fourier decomposition of a flow rate function is performed in
Python with fftpack from the SciPy[28] library. The Fourier coefficients Qn are
then written to common blocks in the generated Fortran 77 code. When defining a
flow rate function with the name “VA”, corresponding utility functions polyVA and
womVA are generated and made available for the boundary data specification.
80
A. SOLVER SOFTWARE
=========== Boundary c o n d i t i o n s
1 : 0 . 1 1 d0 ∗ womVA( Re , a , r , t , 0 . 8 8 3 d0 , 1d −2)
2 : 0 . 1 1 d0 ∗ womVA( Re , a , r , t , 0 . 8 8 3 d0 , 1d −2)
3 : 0 . 3 3 d0 ∗ womICA ( Re , a , r , t , 0 . 8 8 3 d0 , 1d −2)
4 : 0 . 3 3 d0 ∗ womICA ( Re , a , r , t , 0 . 8 8 3 d0 , 1d −2)
5 : 0 . 7 5 d0
6 : 0 . 7 5 d0
7 : 0 . 7 5 d0
8 : 0 . 7 5 d0
9 : 0 . 7 5 d0
1 0 : 0 . 7 5 d0
1 1 : 0 . 7 5 d0
1 2 : 0 . 7 5 d0
=========== O v e r r i d e p a r a m e t e r s f o r b o t h pp3d . d a t and c c 3 d . d a t
s e t RE
= 715 d0
s e t NLMAX = 3
s e t TIMENS = 0 d0
=========== O v e r r i d e p a r a m e t e r s f o r pp3d . d a t
s e t TIMEMX = 265 d0
! three pulses
s e t NITNS = 10000
! enough i f d t a v g = 0 . 0 1
s e t TSTEP = 0 . 0 5
! f i r s t s t e p i s tough
s e t DTMIN = 0 . 0 0 5
! allow smaller steps for s y s t o l i c pulse
s e t DTMAX = 0 . 2 0
! allow l a r g e r steps for d i a s t o l i c p a r t
s e t DTAVS = 2 . 0
! need t o l i m i t d i s c usage
=========== O v e r r i d e p a r a m e t e r s f o r c c 3 d . d a t
s e t ISTOK = 0
=========== F o u r i e r decompose t h e s e f u n c t i o n s :
VA:
1 6 , 0 . 8 8 3 , QVAFord ( t )
ICA : 1 6 , 0 . 8 8 3 , QICAFord ( t )
=========== Comments ( e v e r y t h i n g below i s i g n o r e d )
. . . Summary o f b o u n d a r y c o n d i t i o n IDs :
Dirichlet :
R VA
= 1
L VA
= 2
R ICA = 3
L ICA = 4
Neumann / PD :
R PCA
= 5
L PCA
= 6
R MCA P = 7
L MCA P = 8
R MCA A = 9
L MCA A = 10
R ACA
= 11
L ACA
= 12
F A.1. Example input.params file
Womersley implementation. The Womersley velocity profile had to be implemented in Fortran 77 for the indat3d.f file. The complex Bessel functions are
calculated with the AMOS[2] library in Fortran 77. The Fourier coefficients Qn are
read from the common blocks.
Reference flow rate functions. To implement the reference flow rates QV A (t)
and QICA (t), described in chapter 4, we have copied time,value pairs from table 2
in [8]. These are fed to the interpolate.UnivariateSpline class from SciPy, which
produces a callable object representing splines through the specified points. The
1.4. FEATFLOW DETAILS
81
resulting functions are made available as QICAFord(t) and QVAFord(t) when reading flow rate function specification from the input.params file.
1.4. Featflow details
To use the Featflow software, we have to write a Fortran 77 file called indat3d.f
with functions that describe the boundary conditions of our particular case. This
file can be the same for the two solvers CC3D and PP3D. We then run make 1 to
compile and link the solver application. We also have to supply a parameter file
called pp3d.dat (or cc3d.dat for the CC3D solver), and of course the gridfiles which
are named #tria1, #tria2 etc. with the trailing number representing the gridlevel.
indat3d.f. We here give a brief description of the relevant contents of the indat3d.f file. The most important function is the fdatin function, which is called on
from Featflow to return boundary values and analytical solutions. In this function
we are given a time t, a point x = (x, y, z), and some flags indicating what kind of
content we should return. We need to find out ourselves which part of the boundary
the point x is on.
We generate the necessary Fortran 77 code in the Python script featcow.py
based on the grid parameterization file input.grid and the parameter file input.params.
The grid files #triaN contain boundary markers, but those only mark if a boundary
face has a natural or essential condition. To find which boundary x is on, we use
the following algorithm.
For each crossection Γi with radius ai , midpoint pi and normal vector ni , we
define
(A.1)
d ≡ x − pi ,
(A.2)
r2 = d · d,
and check the following conditions.
(A.3)
(A.4)
r2 − a2i ≤ ,
d · ni ≤ ,
where is a small positive number larger than machine precision and smaller than
the smallest grid cell. If both conditions (A.3) (A.4) are true for a given i, the point
x is on boundary Γi , and the local radial coordinate on the boundary circle is r. If
the conditions are false for all i, the point x is on ∂Ω0 .
This simple algorithm is implemented as a subroutine which is used by the
Python-generated code in indat3d.f. The grid parameterization file contains all the
necessary data to generate this code (radii and endpoints of vessels). When the
right boundary is found, the boundary values (essential or natural) are calculated
with the expression listed in the input.params file.
Output files. Featflow originally dumps several kinds of output files. We have
added some additional functionality to meet our own particular needs in the PP3D
solver. The source code for the solver is found in featcow/featflow/pp3d/src/. The
modifications and additions to PP3D are mainly in the added file userpost.f, as well
as some changes in fpost.f.
1Featflow 1.3RC3 has a makefile with support for many platforms, and tries to autodetect the
current one. To compile on unsupported platforms, we had to edit the file Globals.mk. The edited
file is found on the CD.
82
A. SOLVER SOFTWARE
• The protocol file (#data/pp3d.out, #data/cc3d.out) contains runtime output from the application, including parameters like timesteps, convergence rates, residual magnitudes, and iteration counts.
• Solution vectors (#ns/DX*). These files contain the raw solution vector
in a binary format. For some reason Featflow dumps max 10 files, so we
extended the code to dump solution vectors each time an AVS file was
dumped. The files are dumped in an ASCII format, since binary formats
in Fortran are platform dependent.
• Point values (#points/*). Featflow has some functionality for sampling
pressure and velocity in a few points. We instead added functionality to
dump pressure and flow rates in each vessel. The grid generation tools
dump some metadata about the grid for this purpost, and the featcow.py
script handles plotting of these data after a simulation.
• Visualization files: AVS (#avs/u.*.inp) and GMV (#gmv/u.*.gmv). The
finite element solution is interpolated to regular linear isotropic parametric elements before writing to these files, since visualization software that can handle nonconforming elements is rare. AVS files can
be viewed with for example Paraview[22], and GMV files with General
Mesh Viewer[10].
pp3d.dat. The algorithm for solving the Navier-Stokes equations is complicated with a lot of different parameters. These parameters doesn’t necessarily have
values that work good for all cases. Turek tries in [30] to give advice on which
parameters and algorithm choices that work most robust in many cases. To find
good parameters for this particular kind of problem, we started out with the file
pp3d robust.dat from the Featflow distribution. Then we experimented with most
of the parameters to find choices which works good for our cases. Together with the
description of the numerical methods in chapter 5, we also mention the most important default solver parameters used for the simulations in chapter 7. We haven’t
necessarily found optimal parameter choices, the goal was only to make the simulations work.
APPENDIX B
CD contents
This chapter lists the contents of the accompanying CD. File sizes restrict the
amount of data we can include on the CD, but we try to include some key result
files in addition to the software. The content is also available on the internet (at
least for a limited time period) under the address
http://folk.uio.no/martinal/master/.
This webpage is a direct mirror of the CD contents. All paths mentioned below
are relative to this address and the root of the CD.
2.1. Casefiles
To document the performed simulations, the directory casetars/ contains the
casefiles used for some of the simulations. The tarfiles contain complete gridfiles.
• full.tar.gz - The full CoW simulations.
• sym.tar.gz - Simulations on the symmetric Ω post grid.
ang
• asym.tar.gz - Simulations on the asymmetric Ωrad
post and Ω post grids with 3
gridlevels.
ang
• asym-n4.tar.gz - Simulations on the asymmetric Ωrad
post and Ω post grids
with 4 gridlevels.
2.2. Datasets
Pictures and animations can never replace having a full 3D model, which may
be rotated and zoomed in on to get a better overview of the results. For completeness, some selected simulation result datasets are placed in datasets/. An overview
follows below.
• datasets/cow-vw/ contains result files from the CoW simulation with v =
vw (see section 7.6). The files u 0047.inp, u 0048.inp and u 0049.inp
contain velocity and pressure for timesteps around the peak systole of the
second heartbeat. In ws pressures.inp and ws summary.inp the results
of the calcshear tool is collected.
• We also include some results from the posterior CoW grid variations:
– ./pcowvars/peaksystole-n3/angpcow-A/ : u 0019.inp, ws 0019.inp
– ./pcowvars/peaksystole-n3/finepcow-side/ : u 0019.inp, ws 0019.inp
– ./pcowvars/peaksystole-n3/radipcow-A/ : u 0019.inp, ws 0019.inp
– ./pcowvars/summaries-n4/ : angpcow pressures.inp, angpcow wss.inp,
radipcow pressures.inp, radipcow wss.inp, sym pressures.inp, sym wss.inp.
2.3. Movies
Animations are contained in the directory movies/ for some of the simulations.
Following is a list of the available movies.
83
84
B. CD CONTENTS
(1) Cylinder:
(a) movies/cyl/flowcomparison.mpg
(2) Bifurcation:
(a) movies/bif/bif dual velprof.avi
(b) movies/bif/bif four.avi
(c) movies/bif/bifh vw shearstress.avi
(3) Flattened ICA grid:
(a) movies/icaflat/icaflat v2 pressure.avi
(b) movies/icaflat/icaflat v2 shear.avi
(c) movies/icaflat/icaflat v9 pressure.avi
(d) movies/icaflat/icaflat v9 shear.avi
(4) Flattened BA grid:
(a) movies/baflat/pgradcomp glyphs.avi
(b) movies/baflat/vwv9 glyphs.avi
(5) Full CoW grid:
(a) movies/cow/cow vw glyphs.avi
(b) movies/cow/cow vw pressure.avi
(c) movies/cow/cow vw streamlines BA.avi
(d) movies/cow/cow vw shearstress.avi
(e) movies/cow/cow vw shearstress2.avi
(6) Anterior/right CoW grid:
(a) movies/antcowright/antcowright vw pressure.avi
(b) movies/antcowright/antcowright vw shearstress.avi
(c) movies/antcowright/antcowright vw shearstress2.avi
(d) movies/antcowright/antcowright vw streamlines.avi
(7) Posterior CoW grid:
(a) movies/postcow/postcow vw glyphs.avi
(b) movies/postcow/postcow vw glyphs2.avi
(c) movies/postcow/postcow vw pressure.avi
(d) movies/postcow/postcow vw pressure2.avi
(e) movies/postcow/postcow vw shearstress.avi
2.4. Software
Here is a list of included software files in the software/ directory.
• featcow.tar.gz - The complete FeatCoW software collection. This contains all the software written by me, including the modified versions of
the pp3d and cc3d solvers from Featflow.
• featflow1.3RC3.tar.gz - The version of Featflow used with FeatCoW. Included for compatibility reasons, in case a future version of Featflow
• Globals.mk - The modified makefile from Featflow, with gfortran rule.
Bibliography
[1] Robert J. Adams, Fenwick T. Nichols, and David C. Hess. Normal values and physiological
variables (4). In D. W. Newell and R. Aaslid, editors, Transcranial Doppler. Raven Press, Ltd.,
New York, 1992.
[2] D. E. Amos. AMOS software library. http://www.netlib.org/amos, 1986.
[3] H. Blum, J. Harig, S. Müller, P. Schreiber, and S. Turek. Feat2d user manual.
http://www.featflow.de, 1995.
[4] Armelle C. Burleson and Vincent T. Turitto. Identification of quantifiable hemodynamic factors
in the assessment of cerebral anerism behaviour. Thrombosis and Haemostasis, 76(1):118–123,
1996.
[5] Juan R. Cebral, Marcelo A. Castro, Orlando Soto, Rainald Löhner, and Noam Alperin. Bloodflow models of the circle of willis from magnetic resonance data. Journal of Engineering Mathematics, 47:369–386, 2003.
[6] S. Turek et al. FEATFLOW software package. http://www.featflow.de, 1998.
[7] P. Fogarty-Mack, J. Pile-Spellman, L. Hacein-Bey, A. Osipov, J. DeMeritt, E. C. Jackson, and
W. L. Young. The effect of arteriovenous malformations on the distribution of intracerebral
arterial pressures. American Journal of Neuroradiology, 17:1443–1449, September 1996.
[8] Matthew D. Ford, Noam Alperin, Sung Hoon Lee, David W. Holdsworth, and David A. Steinman. Characterization of volumetric flow rate waveforms in the normal internal cartoid and
vertebral arteries. Physiological Measurement, 26:477–488, 2005.
[9] Luca Formaggia, Daniele Lamponi, and Alfio Quarteroni. One-dimensional models for bloodflow in arteries. Journal of Engineering Mathematics, (47):251–276, 2003.
[10] General Mesh Viewer. http://www-xdiv.lanl.gov/XCM/gmv/GMVHome.html.
[11] Gnu compiler collection. http://gcc.gnu.org.
[12] J. Harig, P. Schreiber, and S. Turek. Feat3d user manual. http://www.featflow.de, 1994.
[13] M. J. Hartkamp and J. van der Grond. Investigation of the circle of willis using mr angiography.
Medica Mundi, 44(1), 2000.
[14] J. Heywood, R. Rannacher, and S. Turek. Artificial boundaries and flux and pressure conditions
for the incompressible navier-stokes equations. International Journal of Numerical Methods
for Fluids, 22:325–352, 1996.
[15] Tor Ingebrigtsen, Michael K. Morgan, Ken Faulder, Linda Ingebrigtsen, Trygve Sparr, and
Henrik Schirmer. Bifurcation geometry and the presence of cerebral artery aneurysms. Journal
of Neurosurgery, 101:108–113, 2004.
[16] Christof Klötzsch, Octavian Popescu, and Peter Berlit. Assessment of the posterior communicating artery by transcranial colod-coded duplex sonography. Stroke, 27:486–489, 1996.
[17] J. Krejza, P. Szydlik, D. S. Liebeskind, J. Kochanowicz, O. Bronov, Z. Mariak, and E. R. Melhem. Age and sex variability and normal reference values for the v MCA /vICA index. American
Journal of Neuroradiology, 26:730–735, April 2005.
[18] Kent-Andre Mardal and Ragnar Winther. Uniform preconditioners for the time dependent
stokes problem. Numerische Matematik, 98:305–327, 2004.
[19] Matplotlib package. http://matplotlib.sourceforge.net.
[20] S. Moore, T. David, J. G. Chase, J. Arnold, and J. Fink. 3d models of blood flow in the cerebral
vasculature. Journal of Biomechanics, 39:1454–1463, 2006.
[21] Marie Oshima. A new approach to cerebral hemodynamics - patient-specific modeling and
numerical simulation of blood flow and arterial wall interaction. iacm expressions, 2004.
[22] Paraview software. http://www.paraview.org.
[23] Python programming language. http://www.python.org.
[24] Alfio Quarteroni. What mathematics can do for the simulation of blood circulation. 2006.
85
86
BIBLIOGRAPHY
[25] Alfio Quarteroni and Luca Formaggia. Mathematical modelling and numerical simulation of the
cardiovascular system. In P. G. Ciarlet and J. L. Lions, editors, Modelling of Living Systems.
Elsevier, Amsterdam, 2004.
[26] R. Rannacher and S. Turek. A simple nonconforming quadrilateral stokes element. Numerical
Methods for Partial Differential Equations, 8:97–111, 1992.
[27] P. Scheel, C. Ruge, U. R. Petruch, and M. Schöning. Color duplex measurement of cerebral
blood flow volume in healthy adults. Stroke, 31:147, 2000.
[28] SciPy software package. http://www.scipy.org.
[29] SWIG software package. http://www.swig.org.
[30] S. Turek. Efficient Solvers for Incompressible Flow Problems, volume 6 of Lecture Notes in
Computational Science and Engineering. Springer, 1999.
[31] S. Turek and C. Becker. Featflow user manual. http://www.featflow.de, 1998.
[32] Bryce Weir. Aneurisms Affecting the Nervous System. Williams and Williams, 1987.
[33] J. R. Womersley. Method for the calculation of velocity, rate of flow and viscous drag in arteries
when the pressure gradient is known. Journal of Physiology, 127:553–563, 1955.
[34] B. Yazici, B. Erdogmus, and A. Tugay. Cerebral blood flow measurements of the extracranial
cartoid and vertebral arteries with doppler ultrasonography in healthy adults. Diagnostic and
interventional radiology, 11(4):195–198, December 2005.
Download