computational fluiddynamics inmesoscopicnozzlesgervaislab.mcgill.ca/petrescu_msc_thesis.pdf ·...
TRANSCRIPT
-
Computational Fluid Dynamics
in Mesoscopic Nozzles
Matei Petrescu
Master of Science
Department of Physics
McGill University
Montréal, Québec, Canada
December 2015
A thesis submitted to McGill University in partial fulfillment of the degree of
Master of Science
c© Matei Petrescu 2015
-
Contents
Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Abrégé . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Dedication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii
List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Unruh Effect and Sonic Black Hole . . . . . . . . . . . . . . . 1
1.1.2 Experimental Project Symbiosis . . . . . . . . . . . . . . . . . 3
1.2 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.1 Physical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.2 Numerical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Fluid Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Laminar Incompressible Flow . . . . . . . . . . . . . . . . . . . . . . 7
2.2.1 Poiseuille Approximation . . . . . . . . . . . . . . . . . . . . . 9
2.2.2 Short-Pipe Approximation . . . . . . . . . . . . . . . . . . . . 10
2.2.3 Analogy between Electrical Circuits and Physics of Flow . . . 12
i
-
Computational Fluid Dynamics in Mesoscopic Nozzles
2.3 Laminar Compressible Flow . . . . . . . . . . . . . . . . . . . . . . . 13
2.3.1 1D Isentropic Flow Approximation in a de Laval Nozzle . . . . 14
2.4 Gas Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3. Computational Fluid Dynamics . . . . . . . . . . . . . . . . . . . . 21
3.1 Introduction and Motivation of CFD . . . . . . . . . . . . . . . . . . 21
3.1.1 Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.1.2 Validity and Limitations . . . . . . . . . . . . . . . . . . . . . 22
3.2 Discretization Methods . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.2.1 Finite Difference Method . . . . . . . . . . . . . . . . . . . . . 22
3.2.2 Finite Volume Method . . . . . . . . . . . . . . . . . . . . . . 25
3.2.3 Summary of Discretization Methods . . . . . . . . . . . . . . . 27
3.3 Solution Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.3.1 Residuals and Convergence . . . . . . . . . . . . . . . . . . . . 28
3.3.2 CFL Condition and Stability . . . . . . . . . . . . . . . . . . . 28
3.3.3 Numerical Errors . . . . . . . . . . . . . . . . . . . . . . . . . 29
4. OpenFOAMR© CFD Software . . . . . . . . . . . . . . . . . . . . . 30
4.1 Background and Motivation for OpenFOAM . . . . . . . . . . . . . . 30
4.2 Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.2.1 Computational Mesh . . . . . . . . . . . . . . . . . . . . . . . 32
4.2.2 Discretization Methods . . . . . . . . . . . . . . . . . . . . . . 34
4.2.3 Solution Algorithms . . . . . . . . . . . . . . . . . . . . . . . 37
4.2.4 Solvers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.2.5 Time Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.3 Parallelization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5. Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.1 Theory Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.1.1 Incompressible Flow . . . . . . . . . . . . . . . . . . . . . . . 47
5.1.2 Compressible Flow . . . . . . . . . . . . . . . . . . . . . . . . 52
6. Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
6.1 Achievements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
ii
-
Computational Fluid Dynamics in Mesoscopic Nozzles
6.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
A. Analytical Mach Number of a de Laval Nozzle . . . . . . . . . . . 60
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
iii
-
Abstract
We studied the computational fluid dynamics in mesoscopic nozzles acting as
tools to create acoustic horizons. A python wrapper was constructed to validate the
selected OpenFOAM software solvers: icoFoam and sonicFoam. In order to speed-
up the simulation time for refined computational domains, parallel computing was
implemented in the python wrapper. In the incompressible flow, icoFoam solver was
validated for long cylinders using the Poiseuille model. For pipes with lengths smaller
than ten times the radius, the Langhaar model was validated only for the upper limit
(starting at radii five times smaller than the length). A de Laval nozzle geometry
capable of having the wall profile described by any arbitrary function r(z) was built
using python. In the compressible flow regime, sonicFoam was validated mainly
for the region of interest near the nozzle’s throat in the one-dimensional isentropic
flow approximation. The speed of sound was reached in a mesoscopic nozzle, yet
the optimal wall shape leading to a transonic flow with the lowest pressure gradient
remains to be determined.
iv
-
Abrégé
On a étudié la dynamique des fluides computationnelle dans des tuyères
mésoscopiques qui servent comme outils de création des horizons acoustiques. Un
programme d’encapsulation écrit en python a été utilisé pour valider les solveurs
numériques icoFoam et sonicFoam faisant partie logiciel OpenFOAM. Pour accélérer
le processus de simulation dans le cas où le domaine de calcul est très vaste, le
calcul en parallèle a été implémenté dans l’encapsulateur python. Dans le régime
d’écoulement incompressible, le solveur numérique icoFoam a été validé pour des
long cylindres en utilisant le modèle de Poiseuille. Pour les tuyaux ayant des
longueurs plus petites que dix fois celle du rayon, le modèle de Langhaar a été
validé seulement dans la limite supérieure (pour des rayons cinq fois plus petits que
la longueur). Une tuyère de Laval capable d’avoir la géométrie des murs décrite par
n’importe quelle fonction mathématique r(z) a été bâtie en utilisant le langage de
programmation python. Dans le régime d’écoulement compressible, sonicFoam a été
validé principalement dans la région de proximité entourant la gorge de la tuyère en
utilisant l’approximation de l’écoulement unidimensionnel isentropique. Même si la
vitesse du son a été atteinte dans une micro-tuyère, la géométrie optimale des murs
menant à un écoulement transsonique avec une différence de pression minimale reste
à être déterminée.
v
-
Abstract
Am studiat mecanica numericǎ a fluidelor ı̂n duze mezoscopice folosite pen-
tru producerea de orizonturi acustice. Un ı̂nvelis, python a fost construit pentru a
valida algoritmii software-ului OpenFOAM: icoFoam s, i sonicFoam. Pentru a reduce
timpul de simulare ı̂n prezent,a domeniilor de calcul consistente, a fost implementatǎ
simularea ı̂n paralel cu ajutorul ı̂nvelis,ului python. Pentru regimul de flux incom-
presibil, icoFoam a fost validat folosind modelul lui Poiseuille pentru t,evi lungi.
Pentru t,evile cu raze mai mari decât o zecime din lungime, modelul lui Langhaar a
fost validat numai ı̂n limita superioarǎ (̂ıncepând cu raze mai mici decât o cincime
din lungime). Tot cu ajutorul limbajului python, a fost construit un domeniu de
calcul numeric de forma unei duze de Laval flexibilǎ la nivelul peret, ilor care pot fi
configurat, i folosind orice funct, ie matematicǎ r(z). În regimul de flux compresibil,
sonicFoam a fost validat cu precǎdere ı̂n regiunea de interes de lângǎ gâtul duzei
folosind aproximat, ia unidimensionalǎ de flux fǎrǎ schimb de entropie. Chiar dacǎ
viteza sunetului a fost atinsǎ ı̂ntr-o duzǎ microscopicǎ, forma optimǎ a peret, ilor
necesarǎ ı̂n obt, inerea unui flux supersonic cu o diferent, ǎ de presiune micǎ rǎmâne
sǎ fie determinatǎ.
vi
-
Acknowledgements
I sincerely thank Prof. Guillaume Gervais for giving me a chance to per-
form this research and entrusting me this project. His devotion and enthusiasm for
new discoveries motivated me throughout this work. I owe many thanks to Pierre-
François Duc who initiated me with the python programming language and also
guided me throughout the numerical simulations. The productive discussions we
have had about various scientific fields developed my knowledge and straightened
my analytical skills. Thanks to Prof. Gill Holder for the physical and numerical
insights gained during the constructive discussions we have had. Ben Schmidt de-
serves my thanks for troubleshooting python and other software related problems.
Thanks to Joshua Cayetano-Emond for the feedback given in the python scripting. I
would like to thank Alessandro Ricottone and Pericles Philippopoulos for their help
with the use of the Mathematica software.
Finally, many thanks to all my family and friends who have offered me their
support throughout this project. Their moral encouragement gave me confidence
and pushed me forward towards achieving my personal goals.
vii
-
Dedication
This document is dedicated to all future scientific researchers in hope that
this work will be used as an important asset in their future scientific endeavors.
viii
-
List of Tables
2.1 Classification of Compressible Flow Regimes based on Mach Number 13
2.2 Classification of Gas Flow Regimes based on Knudsen Number . . . . 18
3.1 Discretization Methods Comparison . . . . . . . . . . . . . . . . . . . 27
4.1 OF Dimensional Unit System . . . . . . . . . . . . . . . . . . . . . . 31
4.2 List of OF Classes used for FVM . . . . . . . . . . . . . . . . . . . . 34
4.3 Behavior of the Execution Time using Different Computational Power 44
ix
-
List of Figures
1.1 Unruh Temperature Profile for Different Acceleration Distances . . . 2
2.1 The Analogy between an Electrical Circuit and the Physics of Flow . 12
2.2 A de Laval Nozzle Accelerating the Flow from Subsonic to Supersonic
Speeds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.3 Representation of the Slip Length Effect on the Boundary Flow . . . 19
2.4 The Behavior of Knudsen Number as a function Pressure Gradient
across the Pipe for Different Radii . . . . . . . . . . . . . . . . . . . . 20
3.1 Representation of a 2D Cartesian Grid using FDM . . . . . . . . . . 23
3.2 Comparison between various FDM Approximations based on Taylor
Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.3 Control Volume Representation for 2D Cartesian Grid . . . . . . . . . 25
3.4 Control Volume Representation for 3D Cartesian Grid . . . . . . . . . 27
4.1 OF Structure Representation . . . . . . . . . . . . . . . . . . . . . . . 31
4.2 OF Case Folder Structure . . . . . . . . . . . . . . . . . . . . . . . . 32
4.3 OF Typical Polyhedral Cell Structure . . . . . . . . . . . . . . . . . . 33
4.4 OF Basic Domain Description . . . . . . . . . . . . . . . . . . . . . . 33
4.5 OF Representation of the Face Area Vectors used in FVM Discretiza-
tion Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.6 OF Flow Chart for SIMPLE and PISO Algorithms . . . . . . . . . . 38
4.7 OF PIMPLE Algorithm Flow Chart . . . . . . . . . . . . . . . . . . . 38
4.8 OF Time Loop Output Example . . . . . . . . . . . . . . . . . . . . . 42
4.9 Domain Decomposition of the 3D Nozzle Geometry for 8 Cores . . . . 45
5.1 OF Wedge Block Shape . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.2 OF Computational Domain of a Cylinder based on Radial Symmetry 47
x
-
Computational Fluid Dynamics in Mesoscopic Nozzles
5.3 Velocity Radial Profile for Poiseuille Approximation . . . . . . . . . . 48
5.4 Pressure Longitudinal Profile for Poiseuille Approximation . . . . . . 49
5.5 Mass Flow as a function of Pressure Gradient . . . . . . . . . . . . . 50
5.6 Mass Flow as a function of Length to Radius Ratio . . . . . . . . . . 51
5.7 OF Computational Domain of a Nozzle based on Radial Symmetry . 53
5.8 Local Mach Number as a function of Position across the Longitudinal
Profile of a Nozzle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.9 Local to Total Pressure Ratio as a function of Position across the
Longitudinal Profile of a Nozzle . . . . . . . . . . . . . . . . . . . . . 55
5.10 Local to Total Temperature Ratio as a function of Position across the
Longitudinal Profile of a Nozzle . . . . . . . . . . . . . . . . . . . . . 56
5.11 Local to Total Density Ratio as a function of Position across the
Longitudinal Profile of a Nozzle . . . . . . . . . . . . . . . . . . . . . 56
A.1 Analytic Mach Number Roots . . . . . . . . . . . . . . . . . . . . . . 61
xi
-
Acronyms
CFD Computational Fluid Dynamics.
CFL Courant-Friedrichs-Lewy.
DILU Diagonal incomplete-LU.
FDM Finite Difference Method.
FOAM Field Operation and Manipulation.
FVC Finite Volume Calculus.
FVM Finite Volume Method.
GPL General Public License.
MPI Message Passing Interface.
ODE Ordinary Differential Equation.
OF OpenFOAM.
PBiCG Preconditioned bi-conjugate gradient.
PDE Partial Differential Equation.
PISO Pressure Implicit with Splitting of Operators.
SI Système International d’Unités or International System of Units.
SIMPLE Semi-Implicit Method for Pressure-Linked Equations.
xii
-
Chapter 1
Introduction
1.1 Motivation
The study of black holes is an active area of research in astrophysics. In 1974,
Stephen Hawking applied quantum mechanics to the general relativity approach and
predicted that black holes should radiate by emitting particles from the event horizon
towards infinity [1, 2]. This type of radiation, which is known today as Hawking
radiation, has not yet been measured1. The elusive nature of Hawking radiation
from black holes drove the search for analog effects in hydrodynamic systems with
fluids reaching the speed of sound. This approach was first proposed by Canadian
physicist William Unruh.
1.1.1 Unruh Effect and Sonic Black Hole
In 1981, Unruh mathematically showed that in transonic fluid flow, the sonic
horizon should generate a thermal spectrum of sound waves [4]. As further indi-
cated by Unruh, the analogy between the black hole and the hydrodynamic system,
called acoustic or sonic black hole, is striking. For instance, when both systems are
compared, vacuum is replaced by fluid, photons by phonons and electromagnetic
waves by sound waves. As a result, both systems have a specific radiation temper-
ature depending on parameters such as the curvature of space time at the horizon.
Therefore, the sonic black hole represents an interesting analog which, in principle,
is possible to be created in a laboratory.
1There is a research group in cold atoms and laser spectroscopy who claims having detected theanalog radiation using a fluid made of quasi-particles (polaritons) driven via laser excitation [3].
1
-
Computational Fluid Dynamics in Mesoscopic Nozzles
As mentioned by Unruh [4], the phonon temperature spectrum is proportional
to the gradient of velocity with respect to the radius of the acoustic black hole event
horizon. The Unruh temperature for a flow in the z direction is given by [5]
TUnruh =�
2πkB
(∂|�u|∂z
) ∣∣∣∣|�u|=cs
, (1.1)
where � is the Plank constant, kB is the Boltzmann constant, �u denotes the
velocity vector and cs is the speed of sound. Figure 1.1 illustrates the dependency of
the Unruh temperature with the distance over which the fluid is accelerated (Δz),
assuming a constant acceleration.
101 102 103
Acceleration Distance (nm)
0
20
40
60
80
100
120
140
UnruhTem
perature
(mK)
Figure 1.1: Unruh temperature profile for different acceleration distances. It isassumed that the fluid accelerates constantly from rest to the speed of sound at thehorizon given that the temperature is 77 Kelvin while the pressure is one atmosphere.
Thus, the temperature of the spectrum at which the phonons will be emitted
can be raised considerably as the length over which the fluid is accelerated is lowered
towards a few nanometers. One should, in principle, be able to observe a thermal
Chapter 1 2 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
spectrum with a temperature on the order of milli-Kelvin, which is measurable
even with a thermal background of liquid helium temperatures. Assuming that the
phonons are radiated as a blackbody, the emission power Pemitted is
Pemitted = σsAAHT4 =
(π3r2AHk
4B
120c2s�3
)T 4, (1.2)
where σs is the Stefan-Boltzmann sonic constant as defined in [6], AAH area
of the acoustic horizon, rAH is the radius of this horizon and T stands for temper-
ature. As a consequence, a small acceleration length will result in a higher Unruh
temperature. This will lead to a large phonon emission power given that there is a
strong temperature dependence, as depicted by equation (1.2).
1.1.2 Experimental Project Symbiosis
The need for a small acceleration length naturally brought the use of meso-
scopic nozzles as tools to create acoustic horizons. In 2011, Sam Neale, a former
graduate student in Prof. Gervais’ research group, started an experimental project
on the acoustic black hole. The approach consists in forcing helium gas/liquid to
reach the speed of sound across an approximatively 100 nanometeres long pipe which
has an approximate nozzle geometry. The acoustic horizon should, in principle, coin-
cide with the smallest cross-sectional area since the speed of sound is being reached
at that point. This thesis aims to study numerically the fluid dynamics for such
mesoscale nozzles, so as to obtain a greater understanding of the first experiments
performed by Neale [7].
The need for numerical study became obvious for multiple reasons. One of
which is that the experiment solely measures volumetric flow and thus one can only
estimate the average velocity of the fluid passing through the mesoscopic nozzle. The
numerical simulations can provide more details regarding the longitudinal velocity
profile(
∂|�u|∂z
), as well as the optimal shape of the pores required to create an acoustic
horizon with the highest ∂|�u|∂z
. Therefore, the numerical simulations performed in
this work are an important step forward and provide the knowledge essential for the
successful realization of this experiment.
Chapter 1 3 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
1.2 Goals
There are various goals in this research project. Even though not all have
been achieved at the time of writing this thesis, I will outline them all here for
completeness, as well as consistency for the future work that will be performed. I
present these by grouping them into two categories: physical and numerical goals.
1.2.1 Physical
A short-term goal is to validate the simulations for both incompressible and
compressible flow with theoretical models. For the incompressible flow regime, I use
the long pipe steady flow as well as the short pipe approximations, whereas for the
compressible flow regime I rely on the one-dimensional isentropic flow approxima-
tion.
A long-term goal is to perform an experimental validation for the mesoscopic
nozzle simulations at high pressure gradients in the compressible flow regime. Fi-
nally, an extensive study of which is the best geometry to create a black hole for the
lowest pressure gradient still has to be conducted.
1.2.2 Numerical
On the numerical side, a short-term goal is to find the numerical solvers best
suited for the incompressible and compressible flow regimes. Another short-term
goal is to generate the geometry of a three dimensional nozzle with any arbitrary
radius function, r(z), along symmetry axis z. In order to analyze the data produced
by the simulations, I built a data analysis tool (a so-called wrapper) which is able
to prepare the simulation input files and handle large output data files generated
by the latter. I also wrote code in order to run simulations on a computer cluster
using parallel computing and so optimize the simulation execution time.
Chapter 1 4 Matei Petrescu
-
Chapter 2
Fluid Dynamics
In this chapter, I recall the theoretical notions necessary to understand the
main thesis results. Fluid dynamics is a branch of physics that studies the behavior of
liquids or gases, specially under non-equilibrium conditions. The physics of fluids has
been derived from fundamental principles in the 19th century based on conservation
laws such as Newton’s second law. The Navier-Stokes equations are the Partial
Differential Equations (PDEs) that govern fluid mechanics. Assuming a constant
gravitational field, these PDEs, also called continuity equations, are derived from
the principle of mass (2.1), momentum (2.2) and energy (2.3) conservation [8]:
∂ρ
∂t+∇ · (ρ�u) = 0, (2.1)
∂(ρ�u)
∂t+ (�u · ∇)ρ�u = ∇ · τ + ρ�g (2.2)
and
∂(ρE)
∂t+∇ · (ρE�u) = �u · (∇ · τ ) + ρ�u · �g. (2.3)
Here ρ is the density of the fluid, t the time, τ the stress tensor, �g gravitational
acceleration vector and E the total energy. These equations will serve as reference
for the numerical solver validation. In other words, the differential equations solved
by the numerical simulation must match the theory, namely the Navier-Stokes equa-
tions for the fluid flow. Below, I will outline and briefly explain the assumptions
necessary for simplifying the Navier-Stokes equations. I will then continue with fur-
ther simplifications for the laminar incompressible flow and its long and short pipe
approximations. Finally, the isentropic one-dimensional flow approximation in a de
5
-
Computational Fluid Dynamics in Mesoscopic Nozzles
Laval nozzle geometry will follow.
2.1 Preliminaries
I begin by stating the assumptions that will be used in this work. First, the
flow is assumed to be of the laminar type. The stark difference between turbulent
and laminar flows has been nicely illustrated by Reynolds which, in 1883, injected
some dye in a stream of water flowing through a tube. At low flow rates, the dye
in the fluid moved in a well-defined straight path, a laminar flow signature, whereas
at high flow rates, the dye streak broke up into irregular chaotic flow, known as
turbulent flow [8]. Also, given that this thesis work will only study the internal
pressure-driven flow in pipes, the gravitational acceleration will be neglected. In
addition, we assume that the fluid behaves as a Newtonian fluid meaning that the
shear stress is linear, τij ∝(
∂uj∂xi
). The stress tensor τ is defined as2
τ = −(p+
2
3μ∇ · �u
)I + μ
(∇(�u)T +
[∇(�u)T
]T ), (2.4)
where p is the pressure, μ is the dynamic viscosity, I is the identity matrix
and (...)T denotes the transpose matrix. In order to simplify the notation used for
the Navier-Stokes equations, I introduce the material derivative defined as
Df
Dt=
∂f
∂t+ �u · ∇f, (2.5)
where f is a dummy variable which can either be a scalar or a vector. Using
the first law of thermodynamics, one can write the total energy in terms of internal
energy and kinetic energy E = e + K. As a result, with all the assumptions and
simplifications stated above, the Navier-Stokes equations can be re-written as
1
ρ
Dρ
Dt+∇ · �u = 0, (2.6)
ρD�u
Dt= −∇p+∇ ·
(μ(∇(�u)T +
[∇(�u)T
]T ))−∇(23μ∇ · �u
)(2.7)
2(∇(�u)T
)ij=
(∂uj∂xi
), thus ∇(�u)T is an i× j matrix, known as the velocity Jacobian matrix.
Chapter 2 6 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
and
ρD
Dt(e+K) = −∇ · �q − p(∇ · �u) + 2μ
(1
2
(∇(�u)T +
[∇(�u)T
]T )− 13
(∇ · �u
)I
)2,
(2.8)
with �q the heat flux emerging as consequence of the dissipation when τ is re-
placed. These equations govern the laminar flow in a pipe. The energy conservation
equation (2.8) can be further simplified using
�q = −k∇T (2.9)
which is known as Fourier’s Law. Here, k represents the thermal conductivity
of the fluid. The kinetic energy of the fluid is simply
K =1
2|�u|2, (2.10)
whereas the internal energy (as function of temperature) is given by
e = cvT, (2.11)
where cv is the specific heat capacity at constant volume. By subtracting the
mechanical or kinetic energy from (2.8), one recovers the heat or thermal energy
equation [8],
ρcvDT
Dt= ∇·k∇T −p(∇·�u)+2μ
(1
2
(∇(�u)T +
[∇(�u)T
]T )− 13
(∇ · �u
)I
)2. (2.12)
This last relation is important and required in the numerical solver validation
and also for the assumptions made in the incompressible flow section.
2.2 Laminar Incompressible Flow
In the incompressible regime, it is assumed that the fluid density is constant
in space and time, i.e. ρ(x, y, z, t) = ρ0. This assumption is valid until the flow
velocity exceeds roughly 30% the speed of sound in the corresponding medium. In
Chapter 2 7 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
other words, the flow can be assumed to be incompressible as long as M � 0.3,where M is the Mach number defined as
M =|�u|cs
, (2.13)
while cs represents the speed of sound. As a result, the Navier-Stokes equa-
tions are greatly simplified by this assumption. First, the mass conservation equation
simplifies to
∇ · �u = 0. (2.14)
The momentum conservation equation also reduces to
D�u
Dt= −∇p
ρ0+
μ
ρ0∇2�u = −∇pk + ν∇2�u, (2.15)
where pk here stands for the kinematic pressure and ν is the kinematic vis-
cosity. Assuming that the fluid is a gas, the thermal energy equation (2.12) can also
be simplified by using the ideal gas law
p = nV kBT = ρRsT = ρ(cp − cv)T = ρcv(γ − 1)T, (2.16)
where nV is the volumetric density(
1m3
), Rs =
RMm
is the specific gas constant
with R the universal gas constant, Mm the molar mass, while cp stands for the
specific heat capacity at constant pressure and finally γ is the ratio of specific heat
capacities. The last term in the thermal equation (2.12) can be neglected as it is
much smaller than in the left hand side while the second to last one is simplified
using the Boussinesq approximation [8, 9],
p(∇ · �u) ≈ pT
DT
Dt= ρ(cp − cv)
DT
Dt. (2.17)
Replacing (2.17) back into (2.12) one obtains the incompressible thermal
equation known as the heat equation
DT
Dt=
k
ρcp∇2T = κ∇2T, (2.18)
where κ is the thermal diffusivity. Here, we have assumed that the tempera-
Chapter 2 8 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
ture variation is small such that the fluid properties such as μ, cp, cv and k remain
all constant. These analytical relations (2.14, 2.15, 2.18) will be used to validate the
simulation outcome in the incompressible regime.
2.2.1 Poiseuille Approximation
The laminar incompressible internal flow offers one of the few problems in
fluid mechanics for which there are analytical solutions, albeit with some restric-
tions. First, all the assumptions already made for the incompressible fluid shall
hold. Moreover, the geometry is restricted to a cylinder (i.e. a pipe) with length
L much larger than its diameter D, typically with LD
� 10. The pressure differ-ence between the pipe ends creates a laminar flow3 that develops until it reaches a
steady-state in which no fluid acceleration is present. As a result, the incompressible
momentum conservation Navier-Stokes equation (2.15) looses its material derivative
and reduces to
ν∇2�u = ∇pk. (2.19)
Assuming that the cylinder’s axis is along the z-axis, the flow will be along
the z-axis meaning that only uz will be of interest. The z-component of the velocity
will only depend on x and y since there is no acceleration. Given this geometry,
the cylindrical (r,φ,z) coordinates will be used to simplify the problem. In addition,
since there is no acceleration, the pressure drop across the cylinder is assumed to be
constant so,
∂2uz∂x2
+∂2uz∂y2
=1
r
∂
∂r
(r∂uz∂r
)= −Δpk
νL, (2.20)
where Δpk is the kinematic pressure drop across the cylinder. Fortunately,
the expression (2.20) is an ordinary differential equation (ODE) that can be solved
analytically. The general solution is given by
uz(r) = −Δpk4νL
r2 + a log(r) + b, (2.21)
3Fluid flow is called laminar if the Reynolds number Re = |�u|avgD/ν, satisfies Re � 2000, fora pipe. For this work, in the incompressible regime at T = 300 K: D ≤ 0.02 m, ν ≥ 0.00621 m2/s,and |�u|avg ≤ 627.2 m/s. Therefore, as Re � 202 the laminar condition is always satisfied.
Chapter 2 9 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
where a and b are integration constants. Since the flow has to remain finite
for r = 0, it enforce that a ≡ 0 and b will be determined by the boundary condition
in the case of no slip4
�u|| = uz(R) = 0, (2.22)
where �u|| is he tangential velocity vector component and R is the radius of
the cylinder. The final solution, as derived by Poiseuille [10] is given by
uz(r) =Δpk4νL
(R2 − r2
)=
Δp
4μL
(R2 − r2
). (2.23)
This function is quadratic and symmetric. It accurately represents the pressure-
driven internal incompressible flow in a pipe provided there is no slip condition. The
parameters influencing the magnitude of the solution for a fixed geometry (assum-
ing R and L are constant) are the dynamic viscosity μ and the pressure difference
Δp (between inlet and outlet). We note that Poiseuille derived the mass flow for-
mula (2.24) by integrating uz with respect to the surface area of interest (i.e. area
through which the flow is passing), namely the cylinder’s cross-sectional area,
Qm =πρ0Δp
8μLR4 =
πΔp
8νLR4 (2.24)
where Qm here stands for the mass flow in unit of kg/s. The strong radius
dependency of the flow dictates how much mass transport there will be. For a
fixed geometry, the pressure difference is still the leading parameter and the mass
flow is linear. Both results, (2.23) and (2.24) will be useful in the numerical theory
validation for the incompressible flow. For a certain constant pressure difference
Δp, the velocity radial profile and the mass flow can be analytically predicted and
as such, it can be used to test the validity of the numerical simulation in the regime
where Poiseuille approximation holds.
2.2.2 Short-Pipe Approximation
When LD� 10, the acceleration near the inlet and outlet can no longer be ne-
glected. In 1942, Henry Langhaar derived a short-pipe model for this case [11]. Given
4The relative velocity of the fluid with respect to a solid boundary is zero.
Chapter 2 10 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
a geometry restricted to a short cylinder, the approximation made by Poiseuille
( LD
� 10) is no longer satisfied. However, the Navier-Stokes equations can still belinearized [9, 12, 11],
Δp =8μL|�u|avg
R2+
α
2ρ|�u|2avg, (2.25)
where |�u|avg is the average velocity of the fluid inside the pipe and α is a
dimensionless parameter describing the acceleration of the fluid at the end pipe
boundary. Langhaar estimated that α = 2.28 [11], a value commonly accepted in
the community today. From (2.25), Langhaar recovered two important expressions:
the average velocity (2.26) and the volumetric flow (2.27),
|�u|avg =8νL
αR2
(√1 +
αρR4Δp
32μ2L2− 1
), (2.26)
Qv =8πνL
α
(√1 +
αρR4Δp
32μ2L2− 1
), (2.27)
where Qv is the volumetric flow in the unit of m3/s. This quantity is closely
related to the mass flow shown in (2.28.a) and so the short-pipe mass flow is given
by (2.28.b):
Qm = ρQv = ρA|�u|avg = ρ∫∫
�u · d �A, (2.28.a)
Qm =8πμL
α
(√1 +
αρR4Δp
32μ2L2− 1
), (2.28.b)
where d �A is cross-sectional area over which we are integrating on. This
expression is crucial for the experimental determination of flow conductance
Gf =QmΔp
(2.29)
as it is the slope of the mass flow plotted versus the pressure difference. This
quantity is useful for the comparison between numerical results and the experiment.
Finally, the experimental data can also be fitted using the short pipe Langhaar
Chapter 2 11 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
model [13].
2.2.3 Analogy between Electrical Circuits and Physics of
Flow
Here, we present a quick analogy that can be made with electrical circuits.
A pressure difference in mass flow corresponds to the voltage difference supplied by
a battery in an electrical circuit.
Figure 2.1: The analogy between electrical circuits and physics of flow (modifiedfrom source: [14]).
A schematic of this analogy is shown in Figure 2.1 were the volumetric flow
rate and the current flow both obey a conservation principle. Analytically, the
resemblance between Ohm’s Law and the physics of flow is directly illustrated by
equations (2.30.a) and (2.30.b)
ΔV =I
Ge= ReI, (2.30.a)
Δp =QmGf
= RfQm, (2.30.b)
where ΔV is the voltage difference, Ge the electric conductance, Re the elec-
tric resistance, I the electric current and Rf the resistance to mass flow.
Chapter 2 12 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
2.3 Laminar Compressible Flow
In this section, I will begin by emphasizing the difference between compress-
ible and incompressible flow. First, all flow regimes are classified as displayed in
Table 2.1. Importantly, the density can no longer be assumed to be constant in the
compressible regime when M > 0.3 and as such a modification of the Navier-Stokes
solutions have to be performed.
Flow Regimes Mach Interval Main Properties
Incompressible M � 0.3 Density variations can be neglected.Subsonic 0.3 � M � 1.0 Variations in both density and temperature are
important.
Transonic 0.8 � M � 1.2 Shock waves lead to rapid drag increase.Supersonic 1.0 � M � 3.0 Information propagates along paths called
characteristics.
Hypersonic M � 3.0 Severe heating in boundary layers plays an im-portant role.
Table 2.1: Classification of Compressible Flow Regimes based on Mach num-ber (modified from source:[8]).
We define the speed of sound as
cs =
√(∂p
∂ρ
)S
ideal gas=
√γRsT . (2.31)
In order to gain insight on the incompressible condition, we can rewrite the
mass conservation equation (2.1) in 1D under the assumption that the density is
constant with respect to time,
u∂ρ
∂x+ ρ
∂u
∂x= 0. (2.32)
Assuming that the first product term in (2.32) is much smaller than the last
one, it follows that
Chapter 2 13 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
δρ
ρ≈ u
2
c2s
δu
u. (2.33)
Using the definition of the Mach number (2.13) and the speed of sound (2.31),
we recover the incompressible condition,
u2 � c2s, (2.34)
and as such it is safe to assume that the flow is incompressible when M2 is
small [8]. However, many interesting phenomena can happen when the above condi-
tion is not satisfied. As a consequence, we will use the relations constructed earlier
in this chapter (in section 2.1). Subsequently, I will present the one-dimensional
flow approximation in a particular type of nozzle, both providing very important
insights for the validation of the numerical simulations in the compressible regime .
2.3.1 1D Isentropic Flow Approximation in a de Laval Noz-
zle
In order to reach the speed of sound, a fluid can be accelerated by decreasing
the cross-sectional area through which the fluid is passing. In 1888, the Swedish
engineer de Laval found that turbines could accelerate the steam to supersonic speeds
via a nozzle whose cross-sectional area first decreases, and then increases. If we
assume an inviscid5 laminar flow in the z-direction along a streamline, we obtain
uz duz = −dp
ρ. (2.35)
Differentiating the mass flow with respect to position in z-direction, we obtain
dQmdz
=1
uz
duzdz
+1
A
dA
dz+
1
ρ
dρ
dz= 0. (2.36)
Making use of previous relations, (2.35) and (2.36), along with the definition
for the speed of sound (2.31) and the Mach number (2.13), we find,
5In this work, we consider Helium gas at 77K for the compressible regime simulations. It hasa dynamic viscosity 100 times smaller than water at room temperature. Thus, it is safe to assumethat the flow is inviscid.
Chapter 2 14 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
1
uz
(1− u
2z
c2s
)duzdz
= − 1A
dA
dz=
1
M
(1−M2
) dMdz
. (2.37)
The speed of sound can only be reached when dAdz
= 0. This occurs at the
throat of the de Laval nozzle which is also at times referred to as a convergent-
divergent nozzle. The most common scenario for the velocity evolution across the
nozzle’s length is given by a subsonic inlet and a supersonic outlet. In this case, the
speed of sound barrier is reached at the nozzle’s throat, as illustrated by Figure (2.2).
Figure 2.2: A de Laval nozzle accelerating the flow from subsonic to supersonicspeeds (source: [8]).
Another way of viewing this is to imagine that subsonic velocity increases
in such a manner that it will be equal to the speed of sound at the nozzle throat.
This is a “point of no return” since the velocity will keep increasing with expanding
cross-sectional area towards the outlet. However, if the speed of sound is not reached
between the inlet and the nozzle’s throat, then the diverging nozzle part towards
the outlet will decrease the velocity resulting in a subsonic outlet.
When a fluid passes through a de Laval nozzle, the velocity varies along the
flow direction even for a fully-developed steady-state flow (unlike in the Poiseuille
approximation). The fluid accelerates along the nozzle as the surface area through
which the flow is passing decreases while the mass flow is conserved, i.e. is constant
as illustrated by (2.36). If the nozzle a has small curvature (i.e.∣∣dAdz
∣∣ is small),the radial velocity variation can be neglected and so we can assume that the flow
is isentropic6 and occurring only in one direction along the nozzle [8]. As a result,
the fluid should in principle accelerate as the cross section decreases and decelerate
6Flow during which the entropy remains constant.
Chapter 2 15 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
as the cross section increases. The variation in cross sectional area compresses the
fluid, and thus its temperature, density and pressure will vary as well. In order
to develop a proper theoretical framework, I will start with Bernoulli’s theorem for
barotropic fluids7 which defines the stagnation8 or total temperature raise [15],
T0 − T =|�u|22cp
, (2.38)
where T0 is the stagnation or total temperature. For a reservoir with a fluid
at rest, the total temperature will equal the local temperature given that the average
velocity is zero. On the other hand, using the ideal gas law and adiabaticity, we can
write the isentropic relations of the fluid,
T2T1
=
(p2p1
) γ−1γ
=
(ρ2ρ1
)γ−1, (2.39)
where Ti, pi, ρi are the temperature, pressure and density at position i. Mak-
ing use of the definitions of the speed of sound in (2.31), the Mach number (2.13),
the stagnation temperature raise (2.38) and the isentropic relations (2.39), we obtain
the temperature ratio (2.40), from which the analog relations for pressure (2.41) and
density (2.42) are obtained:
T
T0=
(1 +
γ − 12
M2)−1
, (2.40)
p
p0=
(1 +
γ − 12
M2)− γ
γ−1(2.41)
and
ρ
ρ0=
(1 +
γ − 12
M2)− 1
γ−1. (2.42)
These isentropic relations (2.40, 2.41, 2.42) will be used to test the validity of
the simulation results in the compressible regime. At M = 1, we can define a sonic
temperature T ∗, a sonic pressure p∗, a sonic density ρ∗ and a sonic area A∗. Hence,
the temperatures ratio can be rewritten as
7The density of these fluids depends only on pressure, i.e. ρ = ρ(p).8The stagnation point for any field (i.e. pressure, temperature or density) occurs when the
velocity of the fluid is zero.
Chapter 2 16 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
T
T ∗=
(1 +
γ − 1γ + 1
(M2 − 1
))−1. (2.43)
Last, but not least, making use of the mass flow definition (2.28.a) and the
sonic temperature ratio (2.43), the sonic area ratio can be written as
A
A∗=
1
M
(1 +
γ − 1γ + 1
(M2 − 1
)) 12+(γ−1)−1. (2.44)
Therefore, the local Mach number can be retrieved analytically based on
the area ratio whenever γ is known. The analytical roots9 of the Mach number
can be compared with the numerical solutions in order to test the validity of the
compressible numerical simulation.
Using the mass flow (2.28.a), the Mach number (2.13), the speed of sound (2.31)
and the stagnation temperature ratio (2.40) definitions, the mass flow for a com-
pressible fluid in 1D approximation becomes
Qm =
√γ
RsT0Ap0M
(1 +
γ − 12
M2)− γ+1
2(γ−1). (2.45)
This relation can also be used to test the validity of the simulation with
respect to the 1D isentropic flow approximation. The mass flow obtained from the
simulation will thus be compared with the isentropic relation (i.e. the right hand
side of 2.45) and in a similar fashion, one can verify the isentropic relations for the
temperature ratio given by (2.40), as well as for the pressure and density ratios
determined using equation (2.39).
2.4 Gas Flow
So far, nothing was mentioned regarding the scale at which the flow is an-
alyzed. It turns out that Navier-Stokes equations hold very well at macroscopic
scales, but how about at smaller, microscopic scales? Let us recall that Navier-
Stokes equations are based on the continuum physical approach where conservative
laws apply. As the size of the system approaches the molecular scales, the assump-
tion of continuity is no longer valid. Thus, the assumptions made for Navier-Stokes
9The analytical expression as well as the graphical representation of these solutions are presentedin Appendix A.
Chapter 2 17 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
equations break down at molecular scales [16]. In 1909, Martin Knudsen published
the results of his studies for systems having a size similar to the mean free path of
their molecules [17]. The so-called Knudsen number, named after the Danish physi-
cist, provides a good measure for the gas flow regime in which the fluid flow belongs
to. It is defined as Kn = λlswhere λ is the mean free path of the gas molecule and
ls the system size [13]. Using kinetic theory, we can rewrite as
λ =(√
2πd2nV
)−1=
(√2πd2
p
kBT
)−1, (2.46.a)
Kn =λ
ls=
kBT√2πd2pD
, (2.46.b)
where πd2 represents the effective cross-section of collisions with d depending
on the fluid element composition, D is the diameter of the pipe or duct through
which the flow passes.
Flow Regime Knudsen numberInterval
Main Characteristics
Continuum Kn � 0.01 Inter-molecular collisions dominated system.Slip 0.01 � Kn � 0.1 Modified flow behavior near the walls.Transition 0.1 � Kn � 10 Gas rarefaction affects the flow.Molecular Kn � 10 System dominated by kinetic theory of sta-
tistical physics.
Table 2.2: Classification of gas flow regimes based on Knudsen number (modifiedfrom source: [18]).
The classification of gas flow regimes illustrated in Table 2.2 is commonly
accepted by the community [19]. The continuum regime is based on the assumption
that the system will reach a microscopic equilibrium state much faster than most
changes occurring at macroscopic scales. As a result, the Navier-Stokes equations
are used along with no slip boundary condition (i.e. the flow velocity at the walls
is zero). As the Knudsen number increases, the no slip boundary condition is no
Chapter 2 18 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
longer satisfied near or at the walls. At this point, a crossover to the slip flow regime
occurs and in this regime, the Navier-Stokes equations can still be used, provided
that the slip boundary condition is used:
�u|| = λl(�n)T(∇(�u)T +
[∇(�u)T
]T )(I − �n(�n)T
). (2.47)
Here, the slip boundary condition dictates the value of the tangential velocity
component, �u||, which depends on the shear stress at the surface with �n being the
normal vector. Owing to rarefaction effects, the wall velocity can be determined by
the slip length, λl, which is defined as the fictitious distance inside the wall surface
where the fluid velocity would be zero. A visual representation for the meaning of
this length scale is depicted in Figure (2.3).
Figure 2.3: Representation of the slip length effect on the boundary flow (modifiedfrom source: [20]).
The remaining two regimes (transition 0.1 � Kn � 10 and molecular Kn �10) will not be of interest for this work given that Navier-Stokes equations can no
longer applied. We note, however, that the transition flow regime can be described
by Boltzmann or Brunet’s equations, whereas in the molecular flow regime only
Boltzmann statistics apply [18].
In order to better visualize how the pressure and system size can influence
the gas flow regime, Figure (2.4) illustrates the variation of Knudsen number in a
pipe with respect to pressure gradient for different radii at a given temperature.
Chapter 2 19 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
100 101 102 103 104 105 106 107 108
Pressure (Pa)
10−6
10−5
10−4
10−3
10−2
10−1
100
101
102
103
104
105
106Knu
dsennu
mber
Continuum
Slip
Transition
Molecular
R = 10−4 m
R = 10−5 m
R = 10−6 m
R = 10−7 m
R = 10−8 m
R = 10−9 m
Experiment
Simulation
Figure 2.4: The behavior of Knudsen number as a function of pressure differenceacross the pipe for different radii. Simulation and experiment data points wereadded in order to enhance the poor overlap with the continuum gas flow regime. Itis assumed that the fluid used is helium gas with a constant temperature of 77K.
Each gas regime is highlighted by the grey shading in Figure 2.4. In this
figure, the temperature10 chosen for the gas is 77K. Note that for small radii
(on the order of nanometers), the reservoir pressure at the inlet has to be above
107Pa in order to have the gas flow in the continuum or slip regimes. This imposes
restrictions on the choice of pressure gradients for the simulations, as the Navier-
Stokes equations are only valid for the slip and continuum gas flow regimes. As a
consequence, this leads to a poor overlap with the experimental data available given
that the most of the measurements in Prof. Gervais’ laboratory were performed a
low pressure gradients and in small radii (a few tenths of nanometers).
10This temperature corresponds to the liquefaction temperature of nitrogen. Thus, it is experi-mentally convenient to perform measurements using constant thermal bath.
Chapter 2 20 Matei Petrescu
-
Chapter 3
Computational Fluid Dynamics
In this chapter, I introduce and motivate the use of Computational Fluid Dy-
namics (CFD). Then, I present different discretization methods and compare them.
Finally, I follow with solution methods touching upon concepts such as residuals,
convergence, Courant-Friedrichs-Lewy (CFL) condition and various types numerical
errors.
3.1 Introduction and Motivation of CFD
One of our motivations for using CFD is the need to find the optimized ge-
ometry to achieve the speed of sound within a minimum pressure gradient. As seen
in Chapter 2, fluid dynamics provide analytical solutions when simplifications and
assumptions are made. With today’s technology, high-speed computing can be used
to solve the Navier-Stokes equations numerically. To do so, the PDEs first have to
be discretized to form a system of algebraic equations which is then solved numeri-
cally [21]. Unlike in analytical solutions where the whole space continuum is avail-
able, a numerical solution uses discrete spatial values; the space is divided in cells
in which one solves the Navier-Stokes equations and extracts physical parameters
such as velocity, temperature, pressure, density, etc. A cell’s dimension relatively
depends on the geometry and the refinement of the computational domain, named
grid, etc.
3.1.1 Mechanism
CFD consists of two large categories of operation: pre-processor and solver [22].
The pre-processor stage is very similar to a declaration of variables. The initial and
21
-
Computational Fluid Dynamics in Mesoscopic Nozzles
boundary conditions, fluid properties and physical process to be modeled are de-
clared in this stage as well as the definition of computational domain geometry [22].
The solver stage is the heart of the whole process, where the physics is indeed sim-
ulated. Spatially, the equations modeling the physical process are discretized and
new values for the variables are computed. Depending on the CFD software used,
different discretization methods can be employed. The software will reiterate the
process over a certain number of time steps until a convergence of the results is
achieved, or until a defined number of iterations or simulation time is reached.
3.1.2 Validity and Limitations
As mentioned earlier, the numerical solutions of a physical problem will only
tend to approach the real solution. Given the number of approximations made
during the numerical process, it is impossible to affirm that a numerical solution is
not approximate. During the solver stage, the physical equations used to describe
a particular phenomenon may have some assumptions which are not be 100% true.
In addition, the space and time are discretized and so, further approximations are
introduced. As the number of cells is large (yet finite), it is possible to converge
towards a solution. In this process, one has to find a balance between computational
time and the accuracy of the numerical solution. In order to test the validity of the
numerics, it is wise to first run the CFD simulation in conditions where analytical
solutions exist. Furthermore, a comparison with the experiment will provide more
confidence in the results of the numerical simulations so as to provide a feedback
loop between the knowledge brought by both calculations and experimental data.
3.2 Discretization Methods
3.2.1 Finite Difference Method
The Finite Difference Method (FDM) is the oldest discretization method
amongst those presented here. It is a method which is easy to implement in simple
geometries [21]. There are two types of discretization: domain discretization and
mathematical model discretization. The domain discretization is performed on the
Chapter 3 22 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
geometry by dividing up the solution domain in all directions using some user de-
fined increments in each direction. This results in network of nodes where a node
represents the intersection of two or three dividers (lines for 2D, or planes for 3D).
The two dimensional case is illustrated by Figure 3.1, where the empty circles are
the computational nodes and the filled circles denote the boundary nodes.
Figure 3.1: Representation of a 2D Cartesian grid using FDM (source: [21]).
The mathematical discretization used by FDM is called point-wise. It re-
places the derivatives by finite difference equations that use the new solution values
at the nodes. As a result, each node of the grid will solve an algebraic equation
using first and second-order Taylor Series approximations of the physical quantities
involved in the model [23].
There are three main approximations used to approximate gradients in FDM:
forward difference, backward difference and central difference. The forward differ-
ence (first-order) for a 2D grid is identical to the first-order forward Taylor expansion
as shown in equation (3.1),
dζi,jdx
∼=ζi+1,j − ζi,j
δx, (3.1)
where ζi,j is the physical quantity of interest (which could be the velocity,
pressure, density, etc.), δx represents the increment of domain discretization in x
direction and i is the x-index on the grid and j gives the y-index. Similarly, the
first-order backward difference is derived from first-order backward Taylor series
expansion,
dζi,jdx
∼=ζi,j − ζi−1,j
δx. (3.2)
Chapter 3 23 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
It should be noted that the order of the error for both approximations is
O(δx). The central difference is a combination of both forward and backward ap-
proximations and has a higher-order error, O(δx2),
dζi,jdx
∼=ζi+1,j − ζi−1,j
2δx. (3.3)
If a second-order approximation is needed, the same procedure applies except
that now the order of the error will be higher for each type of approximation; i.e.
O(δx2) for forward (3.4) and backward (3.5), and O(δx4) for the central approxi-
mation (3.6),
dζi,jdx
∼=−ζi+2,j + 4ζi+1,j − 3ζi,j
2δx, (3.4)
dζi,jdx
∼=3ζi,j − 4ζi−1,j + ζi−2,j
2δx, (3.5)
and
dζi,jdx
∼=−ζi+2,j + 8ζi+1,j − 8ζi−1,j − ζi−2,j
12δx. (3.6)
The difference between all three types of approximation using first-order ap-
proximation is depicted by Figure 3.2.
Figure 3.2: Comparison between various FDM approximations based on TaylorSeries (modified from source: [21]).
It should be pointed out that the spacing in each direction can vary with
respect to the position on the grid. When this is the case, the denominator δx in
each type of approximation shown above will be written with its position index for
Chapter 3 24 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
differentiation, as illustrated in Figure 3.2.
3.2.2 Finite Volume Method
The Finite Volume Method (FVM) uses control volume boundaries instead
of computational nodes as previously seen for FDM. The computational nodes are
usually assigned at the center of the control volume, but in some cases the nodes are
defined first and then the control volumes are build around them [21]. The generic
conservation equation in integral form is given by:
∂
∂t
∫V
ρφdV +
∫S
ρφ�u · d�S =∫S
Γφ∇φ · d�S +∫V
qφdV, (3.7)
where φ represents any intensive property and might be a vector, a scalar or
a constant, V is the control volume with S the surface of interest (i.e. the surface
through which the flux is passing), Γφ stands for the diffusivity11 of the φ quantity
and qφ accounts for creation or annihilation (source or sink) of φ [21]. For a steady-
state system, the first term in (3.7) vanishes. Moreover, the ρφ�u term is known as
the convective term, whereas Γφ∇φ is referred as diffusive term. Note that one can
recover the conservation of mass (2.1), momentum (2.2) and energy (2.3) by setting
φ to be 1, �u and E, respectively in (3.7).
Figure 3.3: Control Volume representation for 2D Cartesian grid (modified fromsource: [21]).
The generic conservation equation can describe the whole domain or a single
control volume in particular. Given it is conserved, the net flux over the whole
domain is given be the sum of each control volume fluxes. This result holds because
11Diffusivity is a measure for the rate of spread. It can apply to fluids, particles or heat.
Chapter 3 25 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
all the contribution of non-boundary faces in the control volumes cancel one another.
As seen in (3.7), there are two type of summations: surface and volume integrals.
Assuming a cartesian control volume, the grid can be described in both 2D and 3D,
as illustrated by Figures 3.3 and 3.4.
Three main approximations of surface integrals are: mid-point (3.8), trape-
zoidal (3.9) and Simpson’s (3.10) rules [21],
Fe =
∫Se
fdS ≈ feSe, (3.8)
Fe =
∫Se
fdS ≈ Se2(fne + fse) (3.9)
and
Fe =
∫Se
fdS ≈ Se6(fne + 4fe + fse) , (3.10)
where f is a component of either convective or diffusive term which is normal
to the surface Se, while the subscript e represents the direction (east) in the example
illustrated by Figure 3.3. The point e is at the boundary of two control volumes
while all variables are defined either at node P or at node E. As a result, the term fe
is calculated using a second-order approximation to the mean value over the entire
surface Se. The mid-point and trapezoidal rules have an error of second-order, but
the latter uses two points (the corners) to approximate the integral as opposed to
one for the former. Simpson’s rule, on the other hand, has a fourth-order accuracy
given that it using three points: the center and two corners [21].
The volume integrals such as the source/sink term in (3.7) can be approxi-
mated without performing any interpolation given that theses variables are available
at the center of the control volume. In 2D, the simplest approximation of the volume
integral has a fourth-order error and uses the value of the source/sink term at nine
locations, as shown by equation (3.11) [21],
Qp =
∫V
qdV ≈ δxδy36
(16qP + 4qs + 4qn + 4qw + 4qe + qse + qsw + qne + qnw) .
(3.11)
Chapter 3 26 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
Figure 3.4: Control Volume representation for 3D Cartesian grid (modified fromsource: [21]).
Note that all nearest neighbor control volume nodes are used to approximate
the integral.
3.2.3 Summary of Discretization Methods
As presented so far, the discretization methods are different approaches with
the same goal. Table 3.1 illustrates the differences between these discretization
methods.
FDM FVMApproach Taylor Series Surface & Volume IntegralsConservation of quantities Not the best candidate Best suited forComplex geometry handle Poor Very good
Table 3.1: A comparison between FDM and FVM.
The FVM will be the easiest approach to program as the method is conser-
vative12 by construction [21], and thus it represents the best choice.
3.3 Solution Methods
The solution methods effectively solve the system of non-linear algebraic
equations generated by the discretization scheme. Depending on the problem, tran-
12Method based on physical conservation properties such as conservation of mass, momentumor energy, as suggested by equation (3.7).
Chapter 3 27 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
sient or steady-state, the system of equations is linearized via iteration schemes13.
A transient problem will have a time-dependent initial value problem for Ordinary
Differential Equations (ODEs), or an equivalent iteration scheme for a steady-state
problem [21].
3.3.1 Residuals and Convergence
The residuals represent a measure of the error in the solution. They are
evaluated by substituting the current solution into the governing equation and eval-
uating the normalized magnitude of the difference between the left and right hand
sides of that equation [24]. In order to have an accurate final solution, they should
be as small as possible [22]. Convergence, on the other hand, is the property of a
numerical method to have its discretized solution approaching the exact solution as
the grid spacing tends towards zero [21]. For real simulations, the grid spacing can-
not get arbitrarily small, given that the total number of control-volumes has strong
effects on the simulation time while the time frame for an numerical experiment is
finite.
3.3.2 CFL Condition and Stability
The CFL condition was derived in early 20th century, by Courant and Friedrichs
who stated that the numerical time step δt depends on the grid spacing δx and should
satisfy the following condition [21],
δt <
(2Γφ
ρ(δx)2+
|�u|δx
)−1. (3.12)
For convection14 dominated systems, the CFL condition is simplified as shown
by (3.13) and the Courant number Co can be introduced (3.14) as,
δt <δx
|�u| , (3.13)
Co =|�u|δtδx
< 1. (3.14)
13Such as conjugate gradient schemes employed in Chapter 4, section 4.2.5.14Process in which a physical property (such as density) is transported by the ordered motion
of the flow [25].
Chapter 3 28 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
This condition applies only fir explicit discretization methods such as Euler
method, described later in section 4.2.2 from Chapter 4. A Courant number larger
than one would signify that the fluid simulated using the CFD software crosses more
than one cell in a single time step. Its behavior will dictate the stability of numerical
simulation and as a result, influence convergence. For instance, an unstable solution
will magnify the errors that occur during the solution iterations and therefore large
oscillations or even divergence may occur [21]. There are different type of errors
that influence the stability of a solution. I will briefly describe them in the next
paragraph.
3.3.3 Numerical Errors
The two main types of numerical errors related to the discretization and
solution methods are: truncation error and round off error. Truncation errors occur
when approximating derivatives and integrals. In Taylor Series, one always truncates
the infinite series to a predefined order. As a result, all the terms dropped from the
series represent a truncation error. The round off error depends on the number
of significant figures. The simulating tool, i.e. the computer, possesses a number
system that will store information in a binary form. Hence, the round off error
depends on the computer’s memory size. A real number can be expressed using the
floating point system [23] as:
(Rn)b = ±d1d2d3 · · · dn × be, (3.15)
where R is the real number, n stands for the finite length of mantissa m =
d1d2d3 · · · dn containing the digits di, b represents the base and e corresponds to the
exponent.
Round off error is due to chopping or rounding approximations done by the
computer in order to match the number of significant digits of a given variable to
its limit. As a result, the extra digits will either be discarded or rounded off to the
desired digit limit.
Chapter 3 29 Matei Petrescu
-
Chapter 4
OpenFOAM R© CFD Software
The following chapter will address in detail the software used for the simula-
tions. For the experts in the field this might be relevant, otherwise I would suggest
treating this chapter as optional and skip to the results presented Chapter 5.
4.1 Background and Motivation for OpenFOAM
OpenFOAM (OF) is a CFD open-source software under registered trademark
of ESI Group. It has originally been named Field Operation and Manipulation
(FOAM) by Henry Weller and others at Imperial College. In its early stages, this
CFD software was commercially distributed by Nabla (∇) Ltd company for a few
years. However, in 2004 the name was switched to OpenFOAM and was released
under General Public License (GPL) [26]. Today it is developed by OpenCFD Ltd
organization ESI Group and distributed by the foundation OpenFOAM [27]. OF is
very simple and versatile compared to other CFD softwares available on the market.
OF has a vast category of solvers, a large compatibility with other softwares at the
pre and post processing levels. One of the most important aspects is that it is always
improving: the code gets developed not only by the CFD engineers, but also by the
users who have the possibility of modifying the existing applications.
4.2 Functionality
OF is based on a C++ library used to create applications which fall mainly
into two categories: solvers and utilities [24]. OF utilities are here to handle the data
manipulation. Figure 4.1 illustrates in a schematic manner how OF is structured.
30
-
Computational Fluid Dynamics in Mesoscopic Nozzles
Figure 4.1: OF structure representation (source: [24]).
OF object-orientation simplifies tremendously the code management as it
concentrates the development to classes. Any new classes can inherit properties
from the preexisting ones. Given that the general features of a template class are
passed on, there will be a significant reduction in code duplication and a more
structured code overall [24].
Exponent Property Unit� Mass kilogram (kg)η Length meter (m)ι Time second (s)ξ Temperature Kelvin (K)υ Quantity mole (mol)χ Current ampere (A)ω Luminous Intensity candela (cd)
dimensionSet [� η ι ξ υ χ ω]
Table 4.1: OF dimensional unit system (modified from source: [24]).
As illustrated in Table 4.1, OF has a natural way of defining the units of
measure. It is using only Système International d’Unités or International System of
Units (SI) unit system. The Greek symbols used in the first column correspond to the
exponents declared by the user in the dimensionSet . For instance, the kinematic
pressure, Pk =Pρ0
= Pa·m3
kg= m
2
s2, should have the following coefficients: η = 2 and
ι =-2 while all the other exponents are zero. Therefore, for kinematic pressure, the
declaration made by the user should be: dimensionSet [0 2 -2 0 0 0 0].
In order to classify all the necessary files and folders for a specific case study,
OF takes a hierarchal approach. A representation of the OF case folder structure is
given by Figure 4.2. This hierarchy is also partially depicting structure of this chap-
Chapter 4 31 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
ter’s section categories: the mesh15 (constant folder) and the numerical parameters
(system folder). The time directories folder which contains the results generated by
the simulation at a specific time, while one of them, the 0 folder, will contain the
initial conditions. The properties folder also contains the physical parameters.
Figure 4.2: OF case folder structure (source: [24]).
4.2.1 Computational Mesh
The mesh in OF is defined by default as a collection of polyhedral cells in three
dimensions as shown in Figure 4.3. Thus, having no restriction on the alignment or
number of edges and faces these cells can have, OF provides great flexibility in the
creation of any desired geometry [24].
The user has to define the vertices (points) coordinates first and then decide
if the edges that join two vertices are straight or curved lines. By default, OF will
draw straight edges, but the user has the option of choosing a type of curved line,
such as splines or arcs which require some additional interpolation points along the
desired path. The polyhedral cell depicted by Figure 4.3 is called a block and can
form by itself an entire domain. It can be sliced in all directions (x, y and z) into
multiple cells. The number of divisions is given by in Nx, Ny and Nz respectively.
The total number of cells is given by the product Ntotal = Nx · Ny · Nz. However,
this can vary depending on the geometry and the number of blocks. If multiple
15A collection of cells (control-volumes) also know as a grid.
Chapter 4 32 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
Figure 4.3: OF typical polyhedral cell structure (source: [24]).
blocks are used, each block can have its own structure as long as its boundary faces
with the other blocks are well defined. A simple example is shown in Figure 4.4a.
Here the total cell number would be Ntotal = 6 while Nx = 3, Ny = 2 and Nz = 1.
Furthermore, on the same domain we can define internal and boundary cells as well
as their faces on which one can define patches containing crucial information about
the boundary faces (i.e. boundary conditions) as depicted in Figure 4.4b.
(a) OF simple space domain. (b) OF schematic mesh description.
Figure 4.4: OF basic domain description (source: [28]).
Chapter 4 33 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
4.2.2 Discretization Methods
In this sub-section, I will present the discretization methods that OpenFOAM
employs in order to numerically solve the Navier-Stokes PDEs governing the physics
of fluids. OF uses a FVM approach for the numerical discretization. Some classes
have been defined for the geometrical quantities of interest such as areas and volumes
of the cells. Table 4.2 lists all these classes, while Figure 4.5 illustrates one of them
(Sf ) graphically.
Figure 4.5: OF representation of the face area vectors used in FVM discretizationscheme (source: [28]).
Description SymbolCell volumes VFace area vectors SfFace area magnitudes |Sf |Cell centers CFace centers CfFace motion fluxes φg
Table 4.2: List of OF classes used for FVM (modified from source: [28]).
OF offers a variety of schemes such as: interpolation, gradient, divergence,
Laplacian, time and flux based generating schemes. These will be used in the dis-
cretization of the governing PDEs. As a result, each term in these equations is
separately discretized using FVM for the implicit derivatives and Finite Volume
Calculus (FVC)16 for explicit derivatives and other calculations which are explicit.
Spatial derivatives are converted to surface integrals which are approximated as
sums. For instance, the diffusive term from equation (3.7) can be approximated as,
16This represents the OF namespace assigned for the explicit FVM discretization method.
Chapter 4 34 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
∫S
Γφ∇φ · d�S =∑f
Γf �Sf · (∇φ)f = | �Sf |φN − φP
|�d|, (4.1)
where as indicated in Table 4.2, the index f stands for the face of interest
between the two cells, �d is the length vector between the center (P ) of the cell of
interest and the center (N) of the neighboring one and �Sf is the normal surface
vector for the face f . The convection term from equation 3.7 can be linearized as,
∫S
ρφ�u · d�S =∑f
(�Sf · (ρ�u)f
)φf , (4.2)
where the face field φf can be approximated using three different techniques.
The first one is a central difference scheme given by
φf = φN +(φP − φN)d(
PN) d(fN) ≈ φN + ∂φ∂dΔd, (4.3)
where d(fN
) is the distance between face f and the grid point N , whereasd(
PN) stands for the distance between P and N . This technique is accurate but
unbounded17 [28] and has second-order error, as seen in Chapter 3. The second
technique is the upwind difference and is dependent on the flow direction denoted
by the sign of �Sf · (ρ�u)f :
φf =
⎧⎪⎨⎪⎩φP if �Sf · (ρ�u)f ≥ 0,
φN if �Sf · (ρ�u)f < 0.(4.4)
The third technique, named blended difference, is a combination of previous
two and can be defined as,
φf = a (φf )CD + (1− a) (φf )UD , (4.5)
where a is the blending coefficient, (φf )CD is the central difference approxi-
mated term and (φf )UD is the upwind difference approximated term [28].
The temporal discretization for transient cases is performed by adding time
integrals to the generic conservation equation (3.7) presented in Chapter 3 as
17Output without any limits.
Chapter 4 35 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
follows,
∫ t+δtt
(∂
∂t
∫V
ρφdV +
∫V
AφdV)dt = 0, (4.6)
where A denotes any spatial operator among those present in the generic
conservation equation (3.7), such as the diffusive term, Γφ∇φ, also known as the
Laplacian. The Euler implicit method18 is used to approximate the new transient
generic equation (4.6):
∫ t+δtt
(∂
∂t
∫V
ρφdV
)dt =
∫ t+δtt
(ρPφPV )n − (ρPφPV )oδt
dt
= (ρPφPV )n − (ρPφPV )o ,(4.7)
∫ t+δtt
(∫V
AφdV)dt =
∫ t+δtt
A∗φdt, (4.8)
where the subscripts n and o stand for new value at the current time step
and old value from the previous time step while A∗ is the spatial discretization of
of A which can be any of the ones presented above [28]. OF uses both implicit and
explicit Euler discretization for spatial terms as denoted by equation (4.9),
∫ t+δtt
A∗φdt =
⎧⎪⎨⎪⎩A∗(φ)nδt for implicit Euler,
A∗(φ)oδt for explicit Euler.(4.9)
The implicit discretization has first-order time accuracy, guaranties bound-
edness and is unconditionally stable, whereas the explicit Euler discretization is
accurate in time to first-order as well, but is unstable if the Courant number is
greater than 1. Using OF notation the Courant number from equation (3.14) can
be written as,
Co =δt
|�d|2(�uf · �d
), (4.10)
where �uf is the characteristic velocity (i.e. the velocity of the flow) [28].
18For an initial value problem y(t0) = y0, Euler method can be: implicit as, yi+1 = yi + δtdyi+1dti+1
,
or explicit as, yi+1 = yi + δtdyidti
.
Chapter 4 36 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
Another type of temporal discretization is Crank Nicolson scheme which uses the
trapezoid rule as given by equation (4.11). This method is second-order accurate,
unconditionally stable but does not guarantee boundedness. It can be defined as,
∫ t+δtt
A∗φdt = A∗((φ)n + (φ)o
2
)δt. (4.11)
The discretization at the boundaries requires special attention. As shown in
Figure 4.4b, the boundary cells have special treatment (patches) which are different
from the rest of the domain (internal cells). There are two main types of boundary
conditions: Dirichlet and Neumann. Dirichlet boundary condition prescribes a fixed
value, φb, for a dependent variable on the boundary, whereas Neumann prescribes
a fixed gradient, gb =(
�S
|�S| · ∇φ)f, of the variable normal to the boundary. If the
value (4.12) or the gradient (4.13) on the boundary face are required, then,
φf =
⎧⎪⎨⎪⎩φb for Dirichlet,
φP + �d · (∇φ)f = φP + |�d|gb for Neumann,(4.12)
�S · (∇φ)f =
⎧⎪⎨⎪⎩| �Sf |φb−φP|�d| for Dirichlet,
| �Sf |gb for Neumann.(4.13)
4.2.3 Solution Algorithms
Once the discretization process is done, the system of equations must be
solved using linear algebra. The form of this system is A�x = �b, where A is a square
matrix of coefficients, �x is a column vector of dependent variables and �b is column
vector of independent variables (sources or sinks). OF uses algorithms that decou-
ple the pressure from velocity in order simplify the task. Semi-Implicit Method
for Pressure-Linked Equations (SIMPLE) and Pressure Implicit with Splitting of
Operators (PISO) algorithms contain procedures for solving pressure-velocity (cou-
pled) equations. SIMPLE algorithm is used for steady-state problems whereas PISO
is employed for transient ones [24]. There is a third algorithm, named PIMPLE,
which is a combination the first two and can thus be used for both steady-state and
transient problems.
The SIMPLE algorithm computes the velocity and then adjusts pressure and
Chapter 4 37 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
velocity in a feedback loop until convergence criteria is reached, as illustrated by
Figure 4.6a. The PISO algorithm has a different order in the procedure but it is
following the same steps. Thus, the velocity is predicted using the momentum pre-
dictor first and, only then the pressure and velocity are corrected until the predefined
number of iterations is reached, as shown in Figure 4.6b.
(a) SIMPLE algorithm flow chart. (b) PISO algorithm flow chart.
Figure 4.6: OF flow chart for SIMPLE and PISO algorithms (source: [29]).
The momentum predictor is denoted by UEqn.H file while pEqn.H will cor-
rect the pressure and velocities. Note that for a laminar flow simulation, turbulence-
> correct() command calls an empty function [29].
Figure 4.7: OF PIMPLE algorithm flow chart (source: [29]).
Chapter 4 38 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
The PIMPLE algorithm is similar to PISO, but contains an extra loop as
shown in Figure 4.7. As one may notice, there is a slight difference for the turbulence
approach. By using turbCorr(), OF decides whether to tackle turbulence or not
depending on the simulation type. For the laminar case, the false option is obviously
chosen.
4.2.4 Solvers
In OF, the solvers are C++ codes that execute the solution algorithms as
well as the governing equations and the discretization methods. In brief, a solver
will link all the solving methods and procedures presented in this chapter. OF
has numerous solvers and they all have their specifications. OF also provides the
possibility of modifying the existing solvers or building new ones by importing the
existing libraries.
In this study, two solvers were chosen: (i.) icoFoam for the incompressible
regime and (ii.) sonicFoam for the compressible one. They will be introduced
separately as their description will be specific and not necessary valid for other
solvers.
i. Incompressible regime - icoFoam
icoFoam is a transient solver for incompressible, laminar flow of Newtonian
fluids. Thus, it solves the incompressible Navier-Stokes equations using the PISO
algorithm. The physical model of the momentum predictor equation (UEqn.H) is
the momentum conservation equation for incompressible fluids (2.15) which is
∂�u
∂t+ (�u · ∇) �u−∇ · (ν∇�u) = −∇pk. (4.14)
In icoFoam code, the second term is declared as div(phi,U). This might be
misleading as φ = phi should be replaced by �u = U . However, depending on the
regime φ can have different values. For the incompressible regime, this quantity
yields the volumetric flux for a specific cell. Meanwhile, for the compressible regime
the mass flux will be the end result of φ. In all cases, φ is always present in the OF’s
discretization of the divergence term. Therefore, using Gauss theorem we have
Chapter 4 39 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
∫V
[(�u · ∇)�u
]dV =
∫∂V
[�u(�u)T
]· d�S =
∑f
∫f
[�u(�u)T
]· d�Sf . (4.15)
Recall that �Sf is the surface normal vector of the face f . Using the FVM
approximation we obtain [29]
∑f
∫f
[�u(�u)T
]· d�Sf =
∑f
[�u(�u)T
]f· �Sf ≈
∑f
[�uf (�uf )
T]· �Sf . (4.16)
We then complete by rearranging and replacing the corresponding variables
as follows,
∑f
[�uf (�uf )
T]· �Sf =
∑f
�uf
[(�uf )
T · �Sf]=
∑f
�ufφf . (4.17)
If the flow is compressible, one has now to include the density ρ into φf ,
∑f
�uf
[ρ(�uf )
T · �Sf]=
∑f
�ufφf . (4.18)
The continuity equation for mass conservation is identical to equation 2.14.
However, icoFoam does not have a thermal equation 2.18. Therefore, there is no
temperature in the output solution files which contain only the pressure and velocity
field. As OF can be modified freely, one can create a new solver by adding the heat
equation from 2.18 to the old (icoFoam) solver. The only drawback of adding the
temperature dependence is a slight increase in the computational time. As the
temperature profile is not needed in the incompressible regime, I have only used
icoFoam for this work.
ii. Compressible regime - sonicFoam
In the compressible regime, the solver used is sonicFoam, a transient, pressure-
based solver for trans-sonic/supersonic, laminar or turbulent flow of a compressible
gas. The governing equation for mass conservation used by this solver is identical
to equation (2.1) from Chapter 2. However, the momentum conservation is now,
Chapter 4 40 Matei Petrescu
-
Computational Fluid Dynamics in Mesoscopic Nozzles
∂ρ�u
∂t+ (�u · ∇) ρ�u−∇ ·Reff = −∇p, (4.19)
where Reff is the stress tensor notation in OF. It is defined as,
Reff = μeff (∇�u) + μeff([
∇(�u)T]T − 2
3tr([
∇(�u)T]T)
I
), (4.20)
where μeff is the effective dynamic viscosity which in the laminar case is the
same as the dynamic viscosity, μ, defined in Chapter 2, and tr([
∇(�u)T]T)
= ∇·�u.
Thus, Reff along with p form exactly the same expression as in the one used in
equation (2.4) for the stress tensor τ . Thus, the OF momentum predictor (4.19) is
identical to (2.7). The energy equation for sonicFoam is given by
∂ρe
∂t+∇ · (ρ�ue) + ∂ρK
�