Openfoam 2d Refinement Explanation Dynamic Meshing Around Fluid-Fluid Interfaces With Applications T
Openfoam 2d Refinement Explanation Dynamic Meshing Around Fluid-Fluid Interfaces With Applications T
2015
Recommended Citation
Baniabedalruhman, Ahmad, "DYNAMIC MESHING AROUND FLUID-FLUID INTERFACES WITH APPLICATIONS TO
DROPLET TRACKING IN CONTRACTION GEOMETRIES", Dissertation, Michigan Technological University, 2015.
http://digitalcommons.mtu.edu/etds/1005
By
Ahmad Baniabedalruhman
A DISSERTATION
DOCTOR OF PHILOSOPHY
In Mathematical Sciences
2015
c 2015 Ahmad Baniabedalruhman
This dissertation has been approved in partial fulfillment of the requirements for the Degree
List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
ABBREVIATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii
Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Mathematical Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3 Rheology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
v
2.4 Numerical Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
(SIMPLE) algorithm . . . . . . . . . . . . . . . . . . . . 40
algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
vi
3.4.3 Effect of Parallelization on Efficiency of interDyMFoam . . . . . . 74
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
vii
B Modifications to interDyMFoam . . . . . . . . . . . . . . . . . . . . . . . . . 159
C nozzle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
viii
List of Figures
ix
3.7 Schematic diagram of a drop of radius 1 mm centered in a channel. The
x-axis and y-axis are horizontally and vertically, respectively, and the
3.8 A droplet at steady-state for the 3D drop in shear flow test case (Ca = 0.3). . 66
3.9 Velocity at steady-state along line y = 0 using interFoam for the 3D drop in
shear flow test case Ca = 0.3. The vertical lines indicate the boundary of
3.10 Pressure at steady-state along line y = 0 using interFoam for the 3D drop
in shear flow test case Ca = 0.3. The vertical lines indicate the boundary of
drop in shear flow test case Ca = 0.3. The vertical lines indicate the
drop in shear flow test case Ca = 0.3. The vertical lines indicate the
3.17 A cell with divided face and two internal faces added in axisymmetric case . 79
x
3.18 Example of a dynamicMeshDict for 2D simulations . . . . . . . . . . . . . 80
test case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.21 Drop at steady-state t = 0.99 s for the 2D drop in a shear flow test case . . . 84
3.22 Velocity using interFoam on three different meshes Ca = 0.3 for the 2D
3.23 Velocity using interDyMFoam on three different meshes Ca = 0.3 for the
3.24 Pressure using interFoam on three different meshes Ca = 0.3 for the 2D
3.25 Pressure using interDyMFoam on three different meshes Ca = 0.3 for the
3.26 Drop breakup in 2D using Ca = 0.4 at t = 0.99 s using interFoam (top) and
xi
3.29 Geometry sketch for a drop detachment from a micro T-channel test case
3.30 Drop deformation and detachment at t = 0.01, 0.012, and 0.014 s using
3.31 Drop deformation and detachment at t = 0.01, 0.012, and 0.014 s using
3.32 Dynamic refinement at t = 0, 0.004, and 0.014 s for a drop detachment from
3.33 Pressure using interFoam for a drop detachment from a micro T-channel
3.36 Drop deformation and detachment at t = 0.335, 0.34, and 0.35 s using
3.37 Drop deformation and detachment at t = 0.35, 0.355, and 0.365 s using
3.38 Dynamic refinement around the interface for a bubble rising in water test case109
3.39 Pressure using interFoam for a bubble rising in a water axisymmetric test
case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
xii
3.40 Pressure using interDyMFoam for a bubble rising in a water axisymmetric
4.1 Schematic diagram of the nozzle geometry used in experiments (left) and
4.3 Computational domain and number of blocks for the nozzle. . . . . . . . . 121
curves) fluids for the refined mesh for the nozzle. . . . . . . . . . . . . . . 122
4.5 Velocity along the centerline for the single phase calculations using
4.6 Pressure along the centerline for the single phase calculations using
4.7 Nozzle streamlines at y equal to 0.75, 1, 1.5, 2, and 2.5 millimeter. . . . . . 126
xiii
4.8 Shear rates as a function of transit time along a set of streamlines for the
4.9 Mesh around the drop interface in the low-shear-rate upstream (top) and
high-shear-rate downstream (bottom) portions of the domain for the nozzle. 128
4.10 Drop deformation at t = 0.01, 0.08, and 0.13 s for the nozzle. . . . . . . . . 129
4.11 Drop deformation and breakup for streamline y = 1.5 at t = 0.02, 0.42, and
0.5 s for the non-Newtonian continuous phase for the nozzle. . . . . . . . . 130
4.12 Critical drop sizes as a function of the streamline position (top) and the
4.13 Critical Capillary number as a function of the streamline position for the
xiv
4.16 Critical capillary number as a function of viscosity ratio along two
streamlines in the Newtonian continuous phase for the nozzle. The dashed
vertical lines represent the range of viscosity ratios encountered for the
xv
xvi
List of Tables
3.1 Boundary conditions for the 3D drop in shear flow test case, where Ca is
3.2 DynamicMeshDict parameters for the 3D drop in shear flow test case . . . . 68
3.3 Initial mesh and number of cells using interFoam and interDyMFoam for
3.4 CPU time and cell size around the interface using interFoam and
interDyMFoam for the 3D drop in a shear flow test case (Ca = 0.3) . . . . . 73
3.5 interDyMFoam in parallel for the 3D drop in a shear flow test case (Ca = 0.3) 74
3.6 Boundary conditions for the 2D drop in a shear flow test case where Ca is
3.7 Initial mesh and number of cells for the 2D drop in a shear flow test case . 82
3.8 CPU time, cell size around the interface, and relative change in radius for
3.9 CPU time, cell size around the interface, and relative change in radius for
xvii
3.10 Number of cells in each block for a drop detachment from a micro
3.11 Boundary conditions for a drop detachment from a micro T-channel test case 95
3.12 CPU time and ratio of a drop radius to the pore radius using maximum
3.13 CPU time and Ratio of a Droplet to the radius of the Pore with Different
equal to 3 and buffer layer equal to one for a drop detachment from a micro
3.14 CPU time and Ratio of a Droplet to the radius of the Pore with Different
Maximum Refinement Numbers using refine interval equal and buffer layer
equal to one for a drop detachment from a micro T-channel test case . . . . 102
3.15 CPU time and Ratio of a Droplet to the radius of the Pore with Different
Number of Buffer Layers using refine interval equal to one and max.
3.16 Number of cells in each block for the standard mesh of a bubble rising in a
3.17 Boundary conditions of a bubble rising in a water axisymmetric test case . . 106
3.18 CPU time, bubble radius, and relative change using interFoam and
xviii
4.1 Fluid parameters used in the simulations. The parameters for the
C.1 Critical breakup radius, capillary number, viscosity ratio, and the breakup
C.2 Critical breakup radius, capillary number, viscosity ratio, and the breakup
C.3 Critical breakup radius, capillary number, viscosity ratio, and the breakup
position in the nozzle for the Newtonian fluid at stream line y = 1 . . . . . . 192
C.4 Critical breakup radius, capillary number, viscosity ratio, and the breakup
position in the nozzle for the Newtonian fluid at stream line y = 2 . . . . . . 193
xix
Acknowledgments
I wish to express my gratitude to my advisors, Prof. Kathleen Feigl and Prof. Franz Tanner,
research and writing the thesis. Also, I would like to thank the other committee members,
Prof. Song Yang and Prof. Zhengfu Xu, for their valuable comments and taking time to
serve on my committee.
with my friends and colleagues in the CFD group: Dr. Abdallah Al-Habahbeh, William
Case, Chao Liang, Samer Alokaily, and Olabanji Shonibare. Also, the department of
Finally, I would like to thank my father, mother, brothers, and sisters for their support
and encouragement. My special thanks to my wife Ruba for her assistance, patience,
motivation, and encouragement. I appreciate her help and comments throughout writing
xxi
ABBREVIATIONS
Acronyms
CV Control Volume
Greek symbols
τ viscous tensor
γ̇ shear rate
xxii
ρ Density
Roman symbols
P Pressure
v Fluid velocity
xxiii
Abstract
The dynamic meshing procedure in an open source three-dimensional solver for calculating
and axisymmetric geometries. Specifically, the dynamic mesh refinement procedure, which
functions only for the partitioning of three-dimensional hexahedral cells, is modified for
Moreover, the procedure is modified to allow for computing the deformation and breakup
of drops or bubbles that are very small relative to the mesh of the flow domain. This is
necessary to avoid mass loss when tracking small drops or bubbles through flow fields.
Three test cases are used to validate the modifications: the deformation and breakup of
a two-dimensional drop in a linear shear field; the formation and detachment of drops
a pore into a static liquid. The tests show that the modified code performs very well,
giving accurate results for much less computational time when compared to corresponding
The modified code is then applied to study drop breakup conditions inside a spray nozzle
various sizes through the flow field within the nozzle and determining conditions under
which they break up. The particular interest is in determining the largest drop sizes for
which breakup does not occur. The effects of viscosity ratio, capillary number, shear rate,
xxv
and fluid rheology on the critical drop sizes are determined.
Although the code modifications performed for this research were implemented for
dynamic mesh refinement of cells close to fluid-fluid interfaces, they may be adapted to
other regions in the domain and for other types of flow problems.
xxvi
Chapter 1
Introduction
Two-phase flow is a flow of a fluid system composed of two different kinds of matter,
e.g., solid particles in a gas or liquid, gas bubbles in a liquid or liquid droplets in a
gas stream or another immiscible liquid. An interface is a surface separating the two
phases of the fluid system. The study of two-phase flows is very important because of
processes, fluid-particle transport, food stuff processing (emulsions, foams), nuclear reactor
The dispersed phase can be either droplets of a single fluid, in which case the fluid
system is called a simple emulsion, or the dispersed phase can itself be an emulsion, in
which case the fluid system is called double emulsion or multiple emulsion. The most
1
common types of emulsions are water-in-oil (w-o) and oil-in-water (o-w). Hydrophilic
interfacial tension between the phases. Emulsions are inherently unstable due in part to
coalescence and compositional ripening [1], [2], [3]. Coalescence is the process by which
droplets merge with each other to form larger droplets, whereas compositional ripening
occurs by diffusion and/or permeation of the surfactants components across the disperse
phase. Hence their stability phenomena and the production of stable emulsions are studied
by many researchers [4, 5, 6, 7, 8]. Producing powders from emulsions reduces the problem
of stability and increases the shelf life. Many researchers have worked on spraying of
emulsions where they mostly studied simple emulsions rather than multiple emulsions
[9, 10, 11, 12]. Producing powders by spraying multiple emulsions is more complex in
terms of preserving its structure [13]. Many studies have looked at the effect of the spraying
process and the viscosity ratio on the spray drop size [14, 15, 16, 17, 18, 19]. A uniform
drop size distribution is desirable with drop radii on the order of microns.
two-phase flow problem in which the location of the fluid-fluid interface must be computed
along with the flow variables, such as velocity and pressure. There are different numerical
approaches to solve two-phase problems. Two popular approaches are interface tracking
and interface capturing methods. In the interface tracking method, a mesh to track the
interface is needed and mesh points lie on the interface. In this method, the interface is
explicitly described by the computational mesh and the mesh is updated if the interface is
2
moved so that mesh points remain on the interface [20]. On the other side, the interface
capturing methods implicitly describe the interface by an artificial function where the mesh
is fixed. The most popular interface capturing methods are the level set [21, 22] and
volume-of-fluid [23, 24] methods. In the level set method, the signed distance function
φ is used to describe the interface, where φ is zero at the interface, positive in the dispersed
phase, and negative in the continuous phase. In addition, the level set function is smooth,
allowing for an accurate calculation for the curvature κ . The volume-of-fluid method uses
a discontinuous volume fraction function α instead of the level set function. The volume
fraction function α is one in the dispersed phase and zero in the continuous phase. Once
a mesh is introduced, the value of α in a cell is the volume fraction of the dispersed phase
in the cell. Therefore, 0 < α < 1 in cells that contains the interface. The volume-of-fluid
approach has much better mass conserving properties than the level set approach, but a
two-phase flow calculations, a sufficiently refined mesh around the interface is required.
Instead of refining the mesh throughout the whole domain, dynamic mesh refinement can
be used.
Dynamic mesh refinement allows an accurate solution with low costs by having high
mesh resolution in specific regions, for example, around the interface in two-phase flow
problems. It reduces the costs in terms of computational time and storage compared to a
refined uniform mesh. Dynamic mesh refinement was studied on structured grids by Berger
et al. [25]. In general, there are two methods for the adaptive mesh refinement. The first is
3
r-refinement in which the number of grid points and cells are fixed, and the grid points are
redistributed on the mesh to produce high resolution (i.e. small cells) in particular places.
The second method is h-refinement in which new points and cells are added to the mesh
dividing a set of cells into smaller cells. Many scholars have worked on the dynamic mesh
refinement, including Mavriplis [26, 27] who formulated an adaptive mesh refinement for
an unstructured mesh; Pizadeh [28] who developed an unstructured grid adaption using
different adaptive techniques; and Anderson [29] who developed an algorithm to solve
with structured local adaptive mesh refinement. In addition, Coirier [30] developed an
adaptively-refined, Cartesian, cell-based scheme for the Euler and Navier-Stokes equations,
while Hunt [31] developed a code to solve three dimensional equations using adaptive
refinement; and Qingluan [32] developed an adaptive mesh refinement algorithm for
engine spray simulations where the refinement is required in the spray region. Also,
OpenFOAM
R
stands for Open Field Operation And Manipulation. It is an open source
code using C++ libraries and serves as a modeling and computational fluid dynamic (CFD)
platform for the research community. The mesh generation, equations discretization, and
matrix manipulations can be accomplished using applications of source codes and libraries
in OpenFOAM
R
[33]. The software contains solvers for many computational fluid
4
dynamics problems ranging from fluid flow including heat transfer, chemical reactions,
existing solvers or libraries can be constructed by the user to meet the needs of his/her
specific application.
OpenFOAM
R
has the ability to study multi-phase flows, specifically through the
flows. Two cases are studied to validate the modification for the 2D planar simulations,
specifically (1) a droplet in a planar linear shear flow, and (2) droplets detaching from a
pore into a shear flow field. Furthermore, a bubble rising in water is used to validate the
axisymmetric simulations.
The modified interDyMFoam is then used to study breakup conditions of drops inside a
nozzle when an emulsion is sprayed to produce a powder. Dynamic meshing around the
interface is necessary in this application since the drop sizes can be very small relative to
the geometry. Moreover, due to the large number of drops that need to be tracked, the
simulations are performed in two dimensions. The effect of capillary number, viscosity
ratio, shear rate, and fluid rheology on the critical break up radius is studied.
This dissertation makes several contributions to the field of Computational Fluid Dynamics
and the understanding of drop breakup conditions in complex geometries. The major
contributions are:
5
1. The dynamic meshing capabilities of a popular open source CFD software package
2. The dynamic meshing in a two-phase flow solver has been modified to allow
computational time and allows for application to problems in which many small
3. The modified dynamic meshing code was applied to three test problems:
(a) Drop deformation and breakup in linear shear flow (two-dimensional planar).
planar).
The performance of the modified code was evaluated on these three test problems
Comparisons were made with the two-phase flow solver without dynamic meshing.
4. The effect of the dynamic meshing parameters on the results was determined for the
5. The dynamic meshing code was further modified to improve the refinement around
droplets as they move in a flow field. This was necessary to prevent mass loss when
6
tracking droplets that are very small relative to the flow domain length scale and
corresponding mesh.
6. The modified dynamic meshing code was used to track droplets in a contraction
spray engineers are critical drop sizes, that is, the largest drops that will not break up
7. The effect of shear rate, rheology of the continuous phase fluid, nozzle length,
capillary number, and viscosity ratio (i.e., drop viscosity relative to continuous phase
8. Grace curves for this geometry, which give the critical capillary number as a function
of viscosity ratio, were determined. Results of the above parameter study were
9. The modified dynamic meshing procedure may be used for other two-dimensional
7
Chapter 2
Mathematical Model
Fluid dynamics is the science which studies the motion of liquids and gases and how
they interact with the environment. It has applications in many fields and its uses include
calculating forces and moments on aircraft, determining the mass flow rate of petroleum
through pipelines and predicting weather patterns. The solution of a fluid dynamics
problem involves calculating various properties of the fluid, such as velocity, density,
pressure and temperature, as a function of space and time. Continuum mechanics treats
the material as a continuous mass instead of discrete particles. The basic conservation
and conservation of energy. From these conservation laws we can derive the differential
Two-phase flow is best described as the flow of a fluid system composed of two different
9
Fluid 2 S
nS
Fluid 1
kinds of matter, e.g., solid particles in a gas or liquid, gas bubbles in a liquid, or liquid
the two phases of the fluid system. Two-phase flow has many industrial applications such
Two-phase flow is a flow of two fluids separated from each other by interface S as shown
in Figure 2.1, where nS is the unit normal vector on the interface S directed to fluid 2. In
this thesis, we are primarily interested in the two-phase flow where both fluids are liquids.
10
From the conservation of mass and momentum principles, the differential form of the
continuity equation is
∂ρ
+ ∇ · (ρ v) = 0, (2.1)
∂t
∂ (ρ v)
+ ∇ · (ρ vv) = ∇ · T + ρ g + f (2.2)
∂t
where ρ is the density, v is the velocity, T is the Cauchy stress tensor, g is the gravity and
f is a force per unit volume. The stress tensor T can be expressed as:
T = −PI + τ (2.3)
where P is the pressure and τ is the viscous stress tensor. Using Eq. (2.3), the momentum
equation becomes
∂ (ρ v)
+ ∇ · (ρ vv) = −∇P + ∇ · τ + ρ g + f . (2.4)
∂t
If changes in ρ are negligible, as in the case of incompressible flow, the equations become
∇ · v = 0, (2.5)
11
∂v
ρ[ + (v · ∇)v] = −∇P + ∇ · τ + ρ g + f . (2.6)
∂t
An equation is also needed to describe the evolution of the interface. This equation depends
on the numerical approach that is used to solve the two-phase flow problem, and will be
described later. Interface conditions must also be specified to describe the behavior at
the fluid-fluid interface. There are two conditions on the interface, given below, where
[m]S denote a jump across the interface S of a function m, i.e., [m]s = m1 − m2 , where the
1. Continuous velocity: [v]S = 0 (there is no jump in the velocity across the interface).
the Young-Laplace equation [34] that gives the capillary pressure difference across
There are several techniques for calculating the surface tension force. Some of those
methods are the Continuum Surface Stress method (CSS) [35, 36], ghost fluid method
(GFM) [37, 38], Meier’s method [39, 40] and The Continuum Surface Force method (CSF)
[41]. In the CSF method, these conditions, in particular, the jump in T · n is accounted for
12
in the momentum equation as
fS = σ κ nS δ (x − xS ) (2.7)
where fS is the volumetric surface tension force, κ = ∇ · nS is the local mean curvature,
nS is the unit normal vector on the interface, δ (x − xs ) is the Dirac delta function, and σ
is the interfacial tension. The calculation of the normal vector and curvature is discussed in
Section 2.2.
There are two main approaches for describing the evolution of the interface: Interface
tracking methods and interface capturing methods. In interface tracking methods, the
moving interface is explicitly described by the nodes of the computational mesh. The mesh
must be adjusted so that the nodes lie on the interface. In interface capturing methods,
the location of the moving interface is implicitly described by a scalar function. These
methods are Eulerian in which the mesh is stationary or moving in a given manner. The
most popular interface capturing methods are the level set method (LSM), volume of fluid
method (VOF), and coupled level set-volume-of-fluid (CLSVOF) method. The basic LSM
13
2.2.1 Level Set Method (LSM)
The level set method captures the motion of an interface by embedding the interface as the
zero level set of the level set function ϕ [22]. The level set function is defined as:
∂ϕ
+ v · ∇ϕ = 0. (2.8)
∂t
Physically, this equation means that the value ϕ does not change with time along a particle
path since the left hand side of this equation is the material derivative. That is, the interface
is convected with the flow fluid. For example, on the interface the value of ϕ will be the
same at each time. Initially, ϕ (x, 0) is the signed distance function to the interface. The
∂v
ρ (ϕ )( + v · ∇v) = −∇P + ∇ · τ + ρ (ϕ )g + σ κ (ϕ )nS (ϕ )δ (ϕ ) (2.9)
∂t
14
where
ρ (ϕ ) = ρ2 + (ρ1 − ρ2 )H(ϕ )
μ (ϕ ) = μ2 + (μ1 − μ2 )H(ϕ )
κ = ∇ · nS and
∇ϕ
nS = |∇ϕ |
where H is the Heaviside function and the subscript in ρ and μ indicate the fluid phase.
Also, μ is the dynamic viscosity, which is used in the constitutive equation for τ as
The volume-of-fluid method uses a volume fraction function α , instead of level set
function, to describe the location of the interface [23]. The volume fraction function α
the dispersed fluid (fluid 1). On a computational mesh, this discontinuity is smoothed by
letting
15
The volume fraction equation is
∂α
+ ∇ · (α v) = 0. (2.10)
∂t
As in the level set method, we can write the surface force term as: fS = σ κδ (x−xS )nS . In
∂v
ρ (α )( + v · ∇v) = −∇P + ∇ · τ + ρ (α )g + σ κ (α )∇α (2.11)
∂t
where
ρ (α ) = αρ1 + (1 − α )ρ2 ,
μ (α ) = α μ1 + (1 − α )μ2 , and
∇α
κ = −∇ · |∇α | and
The level set function is continuous, making the calculation of the unit normal and curvature
accurate, however the method does not guarantee the conservation of mass. On the
other hand, the volume-of-fluid is mass conserving but the volume fraction function is
discontinuous, making it less effective in calculating the unit normal and curvature as
surface tension force increases. In this thesis, we use the VOF method as implemented
in interFoam.
16
2.3 Rheology
To close the system of the governing equations in Section 2.1, an expression for the
stress tensor τ must be specified. This stress depends on the deformation and strain rate
Rheology is the science that studies the flow and deformation of materials. It describes
the relationship between stress and deformation (strain). The mathematical form of this
The common rheology terms are stress τ which is the force acting on an area divided by
that area, strain rate γ̇ which is the rate of change in shape of a deformed material with
where v is the velocity, shear rate γ̇ which is the magnitude of the rate-of-strain tensor, and
A Newtonian fluid is a fluid in which the stress is linear in the rate-of-strain tensor. The
A non-Newtonian fluid is a fluid whose stress is not linear in γ̇. There are two types
of non-Newtonian fluids: time-dependent fluids in which the relation between stress and
17
shear thickening
viscosity
Newtonian
shear thinning
shear rate
Figure 2.2: Viscosity vs shear rate for different fluids.
strain depends on how long the shear has been active, and time-independent fluids in which
the relation does not depend on the time. The time-independent non-Newtonian fluids are
the most popular and in this thesis only this type of non-Newtonian fluid is considered.
This type of fluid is classified into shear-thinning or pseudo-plastic fluids in which the
viscosity decreases when the shear rate increases, shear-thickening or dilatant fluids in
which the viscosity increases when the shear rate increases, and yield stress fluids in which
a minimum stress is required before the material will flow. Figure 2.2 shows a graph of
viscosity and shear rate for shear thinning, shear thickening and Newtonian fluids.
Generalized Newtonian fluid models assume a simple constitutive equation like the one
for the Newtonian fluid but here the viscosity is a function of the shear rate. The general
18
form of the constitutive equation for the generalized Newtonian fluid models is
where η (γ̇ ) is the viscosity function. The resulting values of the viscosity at very low and
high shear rates are known as the zero-shear-rate viscosity η0 and the infinite-shear-rate
viscosity η∞ respectively. Two popular models for generalized Newtonian fluid will be
described here.
The model describes a power-law relation between the viscosity η and shear rate γ̇ , and is
given by:
η = K γ̇ n−1 (2.14)
where K is the consistency coefficient (units of Pa · sn ) which reflects the vertical shift in the
viscosity curve on a log-log plot, and the dimensionless n is the power-law index such that
n − 1 represents the slope of the viscosity curve on a log-log plot and reflects how close the
fluid is to Newtonian. For a Newtonian fluid, n = 1 and the consistency index K is equal
to the viscosity of the fluid. If n < 1, then the fluid is shear-thinning and if n > 1, then the
fluid is shear-thickening. This model is popular because most fluids have a linear relation
19
η0
log(η) transition region
η∞
.
log(γ)
Figure 2.3: Viscosity vs shear rate for a Carreau-Yasuda model.
in some region of the log-log graph but it does not describe the zero- and infinite-shear-rate
viscosities.
A model which does describe the upper and lower shear rate regions is the Carreau-Yasuda
model. The relationship between viscosity and shear rate is given by:
η − η∞ n−1
= [1 + (mγ̇ )a ] a (2.15)
η0 − η ∞
1
The parameter m is a constant with units of time, where m is the critical shear rate at
20
the shape of the transition region (e.g., increasing a sharpens the transition), and n is
a dimensionless constant which describes the slope in the power law region as show in
Figure 2.3. The Bird-Carreau model is given by a = 2 in Eq. (2.15), therefore the equation
becomes
η − η∞ n−1
= [1 + (mγ̇ )2 ] 2 . (2.16)
η0 − η∞
The governing system of equations for two-phase flow involving Newtonian and
non-Newtonian fluids is solved using the finite volume method (FVM) described in
equation, we first describe the finite volume method for a general time-dependent
problems.
The finite volume method (FVM) is a popular method to solve numerically the governing
equations of fluid dynamics. In FVM, the computational domain is divided into a finite
21
number of control volumes (CVs) and the governing equations are integrated on the CV to
get the integral form for the equations. The description of the basic FVM below follows in
The boundary of a CV contains a number of faces and, it is assumed here that each face in
the domain share at most two CVs. Figure 2.4 shows a CV, where VP is the volume of the
CV, P is a computational point at the centroid of the CV, f is a computational point at the
center of a face, S f is the area of the face f , n f is the face outward unit normal vector, N is
a computational point of a neighboring CV, d f is the vector between P and N and rP is the
22
The coordinates of the centroid of the CV, xP , and the face, x f , are given by:
(x − xP )dV = 0, (2.17)
VP
(x − x f )dS = 0. (2.18)
f
∂ (ρ φ)
+ ∇ · (ρ vφ) = ∇ · (ρΓφ ∇φ) + qφ (φ) (2.19)
∂t
convective term diffusion term source term
temporal derivative
where φ is a general property and Γφ is the diffusion coefficient. The key step of FVM is
∂ (ρ φ)
dV + ∇ · (ρ vφ)dV = ∇ · (ρΓφ ∇φ)dV + qφ (φ)dV, (2.20)
VP ∂t VP VP VP
By applying the Gauss divergence theorem, Eq. (2.20) can be written as follows:
∂ (ρ φ)
dV + n · (ρ vφ)dS = n · (ρΓφ ∇φ)dS + qφ (φ)dV, (2.21)
VP ∂t ∂ VP ∂ VP VP
23
where n is the outward-pointing unit normal vector. By integrating Eq. (2.21) with respect
t+δ t
∂ (ρ φ)
dV + n · (ρ vφ)dS − n · (ρΓφ ∇φ)dS dt
t VP ∂t ∂ VP ∂ VP
t+δ t
= qφ (φ)dV dt. (2.22)
t VP
In the FVM discretization, the linear variation is used to approximate the function φ around
where φP = φ(xP ). In the below sections some of the discretization methods are described.
24
2.4.1.1 Discretization of Convection Term
(ρ vφ · n)dS = ∑ (ρ vφ · n f )dS . (2.24)
∂ VP f f
By using the assumption of linear variation for φ around the point f , the term ρ vφ is
written as:
(ρ vφ · n f )dS = (ρ vφ) f · n f dS + (∇(ρ vφ)) f : (x − x f )n f dS, (2.26)
f f f
where g f stands for the value of g at the center of the face f . Assuming n f is constant on
face f (i.e., that face is a plane surface) and using Eq. (2.18), Eq. (2.26) becomes
(ρ vφ · n)dS = (ρ vφ) f · n f dS = (ρ vφ) f · S, (2.27)
f f
25
where S = S f n f is the outward area vector of a face and S f is the face area. The right-hand
side of Eq. (2.24) can be approximated using Eq. (2.27), so that Eq. (2.24) becomes
∂ VP
(ρ vφ · n)dS = ∑(ρ vφ) f · S
f
= ∑ S · (ρ v) f φ f
f
= ∑ Fφ f , (2.28)
f
where
F = S · (ρ v) f (2.29)
is the convective mass flux through the face f . To find F, the values of ρ and v have to be
found at the faces by interpolating from the values at the centroids. A weighted average is
φ f = b f φP + (1 − b f )φN (2.30)
as illustrated in Figure 2.5. Different values for b f gives different methods. Three basic
26
φN
φf
φP
P f N
1. Central Differencing CD
fN
bf = (2.31)
PN
where f N is the distance between the face and the computational point N and PN is
the distance between the computational points P and N as shown shown in Figure 2.5.
makes the solution unbounded. More details are found in Chapter 14 of [43] and
Chapter 4 of [44].
27
2. Upwind Differencing UD
⎧
⎪
⎪
⎪
⎨1 if F ≥ 0
bf =
⎪
⎪
⎪
⎩0 if F < 0.
method because it depends on the flux direction. Also, it is bounded and stable but
[42]).
3. Blended Differencing BD
where (φ f )UD is the value from the UD, (φ f )CD is the value from CD and k f is a
blending factor between 0 and 1. This method attempts to preserve the accuracy and
boundedness.
28
S
.P d
.
f
>.N
Following the approach used for the convection term, we get the approximation for the
diffusion term
∂ VP
(ρΓφ ∇φ) · ndS = ∑(ρΓφ∇φ) f · S
f
If the mesh is orthogonal then the estimation for S · (∇φ) f can be defined as:
φN − φ P
S · (∇φ) f =| S | . (2.34)
|d|
29
If the mesh is non-orthogonal, as in Figure 2.6, then S · (∇φ) f can be written as:
where Δ is parallel to the vector d and S = Δ + K. The estimation in Eq. (2.34) can be
used to approximate the orthogonal contribution and the non-orthogonal contribution can
where b f is the same as in Eq. (2.31) and (∇φ)P can be approximated using the
∇φdV = φ · ndS (2.37)
VP ∂ VP
(∇φ)PVP = ∑ f
φ · n f dS (2.38)
f
1
VP ∑
(∇φ)P = Sφ f . (2.39)
f
The integral on the left in Eq. (2.37) is approximated by multiplying the value of the
function at the centroid of the CV by its volume. The integral on the face f is approximated
30
S ^
K
.P .f Δ
> >.N
d
are many ways to find the Δ and K vectors. Here, two methods are described.
d·S
Δ= d. (2.40)
d·d
2. Over-relaxed approach
d S ·S
Δ= | S |2 = d. (2.41)
d·S d·S
31
S ^
K
.P .f Δ
> >.N
d
Figure 2.8 shows the vectors Δ and K in the over-relaxed approach. In this
approach, the importance of the term in φP and φN is caused to increase with the
increase in non-orthogonality Δ.
However this will result in reducing the order of accuracy [42]. According to Jasak
[42], the over-relaxed approach is the best approach that treats the non-orthogonality
from the aspect of stability, convergence, and computational time. The converged
32
2.4.1.3 Discretization of Source Term
The source term qφ (φ) can be a function of φ and it is approximated by the linear
expression
qφ (φ) = qu + q p φ, (2.42)
where qu and q p can also depend on φ. This allows the implicit treatment of the source
term. The integral form of the source term can be approximated as follows
qφ (φ)dV = (qu + q p φ)PVP (2.43)
V
33
2.4.1.4 Temporal Discretization
Using the previous discretization for the convection, diffusion, and source term, Eq. (2.22)
can be written as
⎡ ⎤
t+δ t ⎢
⎢ ∂ ρφ
⎥
⎥ t+δ t
⎢ VP + ∑ Fφ f ⎥
− ∑(ρΓφ ) f S · (∇φ) f ⎥ dt = (quVP + q pVP φP ) dt
⎢ ∂t
t ⎣ P f f ⎦ t
source term
convection term diffusion term
(2.45)
∂ ρφ
where VP ∂ t dV is approximated by the one-point centroid such as in the other terms. To
∂ ρφ ρPn φnP − ρPo φoP
= (2.46)
∂t P δt
t+δ t
φ(t)dt = (wφo + (1 − w)φn )δ t, (2.47)
t
By using the previous equations, assuming the density and diffusivity do not change over
34
time and dividing by δ t, Eq. (2.45) becomes
ρP φnP − ρP φoP
δt
VP + ∑ (1 − w)Fφnf + wFφof
f
− ∑ (1 − w)(ρΓφ ) f S · (∇φ)nf + w(ρΓφ ) f S · (∇φ)of
f
For different w, various time integration methods can be obtained. For example, the
first-order explicit Euler method is obtained if w = 1, the first-order bounded Euler method
The values of φ f and (∇φ) f depend on the values of φ in the neighboring cells, therefore
The summation in Eq. (2.49) is over the neighboring cells of the cell with centroid P. From
Eq. (2.48), the coefficients a f and aN result from the coefficients of φP and φN and the
φN . For the whole geometry, this produces a linear system of algebraic equations of the
35
form
By = R (2.50)
where B is a sparse matrix with coefficients aP on the diagonal and aN off the diagonal, y
is the vector with the unknown values of φ on all CVs, and R is the source vector which
contains firstly, the values of the constant part of the source term and secondly, the parts
of convection term, diffusion term and temporal derivative at the old time level. Numerical
a source term. Therefore, it can be discretized using the same methods as in Sections
2.4.1.1–2.4.1.4. However, there are some additional complexities that must be addressed.
Some of those are: (1) there are multiple equations and multiple unknowns such as vx , vy ,
vz , and pressure P; (2) there are nonlinear terms such as the convection ∇ · (vv) and the
viscous stress tensor τ for a non-Newtonian fluid; and (3) the equations are coupled and
36
2.4.2 Pressure-Velocity Coupling
For incompressible non-Newtonian fluids, using the generalized Newtonian models (see
Section 2.3) the mass and momentum equations have the form
∇·v = 0 (2.51)
∂ (ρ v)
+ ∇ · (ρ vv) − ∇ · η (γ̇ )(∇v + ∇v T ) = −∇P (2.52)
∂t
where η is the viscosity and γ̇ is the shear rate. In the momentum equation, the nonlinear
linearization which is the chosen option to reduce the computational time. The non-linear
∇ · (ρ vv)dV = (ρ vv · n)dS
VP ∂ VP
= ∑ v f (ρ v)of · S
f
= ∑ F ov f
f
= aP vP + ∑ aN vN , (2.53)
N
37
where v o is the velocity from the previous time step and F o = S · (ρ v)of is the flux from
Another issue here is the incompressibility where the continuity equation does not involve
density because it is constant which thus results in no explicit equation for pressure. In
this system we have the same number of unknowns and equations. In the spirit of the
Rhie and Chow procedure [45], a pressure equation can be derived from the continuity
and momentum equations as follows. As in Section (2.4.1), the continuity equation can be
discretized as
0= ∇ · vdV = v · ndS = ∑ S · v f (2.54)
VP ∂ VP f
aP vP = H(v) − ∇P (2.55)
where
vo
H(v) = − ∑ aN vN + . (2.56)
N δt
H(v) 1
vP = − ∇P (2.57)
aP aP
38
and using interpolation, v f can be written as
H(v) 1
vf = ( ) f − ( ∇P) f . (2.58)
aP aP
H(v) 1 H(v) 1
0 = ∑S · ( ) f − ( ∇P) f = ∑ S · ( ) f − ∑ S · ( ∇P) f (2.59)
f aP aP f aP f aP
and hence
1 H(v)
∑ S · ( aP ∇P) f = ∑ S · ( aP
)f . (2.60)
f f
The pressure gradient can be found by interpolating the pressure field to the cell faces and
H(v) 1
F = S · (ρ ) f − (ρ ∇P) f . (2.62)
aP aP
Eqs. (2.60) and (2.61) are the discrete pressure and velocity equations. Both equations
have two unknowns (P, v) and the following three predictor-corrector methods are the
39
most commonly used to solve them.
algorithm
The SIMPLE [46] algorithm is a predictor-corrector procedure for calculating the pressure
P and velocity v. It is a solver for steady-state (no time derivative) incompressible single
phase fluid. The (implicit) under-relaxed form of the momentum equation, Eq. (2.61), can
be written as
aP n 1 − αv
vP + ∑ aN vNn = RP + aP vPo , (2.63)
αv N αv
where αv is the velocity under-relaxation factor (0 < αv ≤ 1) and v o is the velocity from
1. Start with a guessed value of pressure P∗ in the first step and afterwards the resulted
2. Solve the under-relaxed momentum Eq. (2.63) to find the velocity v ∗ by using the
∗)
3. Compute the mass fluxes at the cells faces F ∗ = S · (ρ H(v
aP ) f , which is needed in
40
the right hand side of the pressure Eq. (2.60).
4. Solve Eq. (2.60) to find the new value for the pressure P∗∗ .
5. Correct the mass fluxes at the cells faces Eq. (2.62) using the new value for the
6. Apply some explicit pressure under-relaxation factor 0 < αP ≤ 1 to find the new
7. Calculate the corrected velocity v new using Eq. (2.57) and the new pressure value
Pnew .
9. Test for convergence and repeat the steps from step 2 assuming the new pressure Pnew
one time. The recommended values for the under-relaxation factors according to [47]
αv = 0.7. The convergence is checked by the residual values of the velocity and pressure.
41
If each residual is below a specific tolerance then the solver will stop. In OpenFOAM
R
,
The PISO [48] algorithm was developed originally for a non-iterative computation of
unsteady compressible flows, but it was further developed for steady calculation and for
incompressible flow. The algorithm uses more than one corrector rather than one like in
1. Start with a guessed value of pressure P∗ in the first step and afterwards the resulted
Eq. (2.61), using the pressure from the previous time step.
∗)
3. Approximate the mass fluxes at the cell faces F ∗ = S · (ρ H(v
aP ) f , which is needed
4. Using the approximated velocity, solve the pressure equation Eq. (2.60).
5. Find the final flux correcting the approximated flux by the pressure effect using
42
Eq. (2.62).
6. Correct the velocity using the new pressure value, where this is an explicit correction
The last five steps (3-7) are iterated a fixed number of times before moving to the next
times step 4 should be repeated. Note that no under-relaxation is performed for pressure or
The PIMPLE algorithm uses the SIMPLE and PISO algorithms combined. It is a good
algorithm to use for transient calculations. At each time step, the algorithm combines the
SIMPLE algorithm and then uses the PISO algorithm to adjust the pressure correction. In
1. Calculate the velocity v ∗ using Eq. (2.63) and pressure P∗ from previous time step.
43
∗)
2. Approximate the face flux F ∗ = S · (ρ H(v
aP ) f , which is needed in the right hand
3. Calculate the corrected pressure P∗∗ using Eq. (2.60) and the approximated flux .
4. Correct the face fluxes using the new pressure value P∗∗ via Eq. (2.62).
Pnew = P∗ + αP (P∗∗ − P∗ ).
6. Correct the velocity from the new pressure value Pnew using Eq. (2.57).
9. Test for convergence using residual controls. If satisfied, move to next time step. If
the nOuterCorrectors is equal to one, then the PIMPLE algorithm will be operating
describes some of the iterative methods used to solve the linear systems encountered in
44
2.4.3 Linear Solvers
Each discretized momentum equation, pressure equation, and pressure correction equation
results in a linear system of the form By = R. There are many methods to solve these
The multi-grid method is a fast method. The idea is to accelerate the convergence of
an iterative method by correcting the solution from time to time. If the approximated
solution to the linear system is yh then the error is e = y − yh and the residual is
Be = B(y − yh ) (2.64)
= By − Byh (2.65)
= r. (2.66)
The multi-grid method solves the equation Be = r on a coarser grid and then
interpolates the solution to the fine grid. Then it adds the approximated error to the
• A restriction matrix T which transfers a vector from the fine grid to the coarse
45
grid
grid
In Step (c), Bc = T BP and the subscript c represents the coarse grid and the cell
size in c is twice of the cell size in the original grid. The above multi-grid method is
called v-cycle, meaning that we have only two grids, as shown in Figure 2.9 on the
left, where f denotes the fine grid. The multi-grid method can be applied on more
than two grids in the same way as in the v-cycle. Figure 2.9 on the right shows a
multi-grid method on four grids. Multi-grid method can be used to find a good initial
guess by finding the solution on the coarsest grid and interpolating it to the fine grid.
The geometric multi-grid method uses the geometry to find the restriction matrix T
and prolongation matrix P . Algebraic multi-grid constructs the matrices from the
46
f . .
c . .
f . . 2c
. .
.c .3c
Figure 2.9: v-cycle and V-cycle.
matrix B and does not use the geometry. For that reason, it is a good choice for
the diagonal entries of B, −U is the upper triangular part of B, and −L is the lower
(D − L)y = U y + R. (2.67)
47
The Gauss Seidel solves this linear system by using the value of y from the previous
iteration on the right hand side of Eq. (2.67). The new value for y can be written as:
yk+1 = yk + αk pk . (2.69)
The idea here is to start with an initial guess y0 and then, at each step, walk in
a direction such that f (yk+1 ) < f (yk ). The conjugate gradient method chooses
the set of search direction vectors {p0 , p1 , ..., pn } such that the set is B-conjugate
(pTi Bp j = 0, ∀i = j). The step length αk and search direction pk are defined as
rkT rk
αk = T (2.70)
pk Bpk
pk = rk + βk pk−1 (2.71)
rkT rk
where βk = rk−1 rk−1
T . The conjugate gradient method starts with an initial residual
r0 = R − By0 and calculates the initial guess for the search direction p0 = r0 . It
48
then repeats the following steps from k = 0 until the residual gets below a specified
tolerance:
rkT rk
(a) Calculate step length αk = pTk Bpk
rk+1
T r
(d) Calculate βk = k+1
rkT rk
both matrices B and B T . The method makes the two sets of search direction vectors
{p0 , p1 , ..., pn } for B and {q0 , q1 , ..., qn } for B T mutually orthogonal (qiT Bpi = 0).
As in the conjugate gradient method, the BiCG method starts with an initial guess
convergence:
sTk rk
(a) Calculate step length αk = qkT Bpk
sTk+1 rk+1
(e) Calculate βk = sTk rk
49
(f) Calculate the new direction pk+1 = rk+1 + βk pk
Preconditioners
solution. The preconditioner M of the matrix B is a matrix such that M −1 B has a smaller
This method can be used to find the preconditioner matrix M by using diagonal incomplete
Cholesky decomposition. For the matrix B, the diagonal incomplete Cholesky of a matrix
B has the form LDLT where L is a lower triangular matrix and D is a diagonal matrix.
D)D −1 (D + U ) where L is the lower part of the matrix B, U is the upper part of the
matrix B, and D is a diagonal matrix such that diagonal of M equal to the diagonal of B.
50
Chapter 3
OpenFOAM
R
. All meshes in OpenFOAM
R
are 3D Cartesian meshes, even for 2D
domain boundary in the other two directions are called empty patches. However, in the
axisymmetric calculations, they are called wedge patches. Each cell in the mesh is assigned
a designated number which contains a number of points and faces. There are two kinds of
faces: an internal face that connects two cells, an owner and a neighbor cell, and a boundary
face that belonging to one owner cell. Each face is also assigned a designated number where
an internal face has an owner cell with the lower number and a neighbor cell with the higher
51
number.
Dynamic mesh refinement allows us to refine the cells in a coarse mesh at specific
regions that requires smaller cells. It is a good way to get accurate results with reduced
computational time in comparison to a refined static mesh. The coarse mesh should be
refined enough to give an accurate result outside the region that requires small cells. In
two-phase flow, the refinement should be on the interface between the fluids because of the
steep gradients in the volume fraction function and potentially the material properties of the
fluid system. In the following section, the discretization of the volume fraction equation is
In this section, the discretization of the volume fraction Eq. (2.10) is described. Because the
conservation of the phase fraction is important to give accurate physical properties, such as
density, especially for the fluids with high density ratio, an artificial compression term is
added to Eq. (2.10) and the volume fraction equation becomes [49]
∂α
+ ∇ · (α v) + ∇ · ((α (1 − α )vr ) = 0 (3.1)
∂t
52
where vr = v2 − v1 and the subscripts represent the fluid phase. Note that the artificial
compression term is nonzero only in a thin region around the interface due to the factor
of α (1 − α ); therefore it does not affect the solution outside the interface region. The
compression term reduces the numerical diffusion, thus allowing sharp interface resolution.
(3.2)
t+δ t
∂α
dV + n · (α v)dS + n · ((α (1 − α )vr )dS dt = 0. (3.3)
t VP ∂ t ∂ VP ∂ VP
The discretization of the terms in Eq. (3.3) is done in the same way as the discretization
of the terms in the general convection-diffusion equation in Section 2.4.1. The discretized
αPn − αPo
δt
VP + ∑ (1 − w)ψα nf + wψα of
f
+ ∑ (1 − w)Ψ(α (1 − α ))nf + wΨ(α (1 − α ))of = 0 (3.4)
f
53
where S f is the face area, S = S f n f is the outward area vector, ψ = S · v f is the face flux
of the linear term, and Ψ is the face flux of the non-linear term and is calculated based on
the maximum velocity magnitude at the interface region and its direction as:
|φ| |φ|
Ψ = nf min Cα , max , (3.5)
|S| |S|
In the next two sections, the implementation of the governing equations for two-phase flow
After that, a brief comparison between them is presented for a 3D test problems before
The interFoam solver for two immiscible incompressible fluids uses a VOF (volume
of fluid) phase-fraction based interface capturing approach. It uses an adaptive time step
|v|δ t
depending on the Courant number Co = δx . To choose the new time step, a maximum
54
Courant number Coo is calculated from the flow conditions, using v and δ t from the
previous time step. The new time step δ t n is then calculated using the following expression
[50]
Comax o Comax o
δ t = min
n
δ t ; (1 + 0.1 )δ t ; 1.2δ t o ; δ tmax (3.6)
Coo Coo
where δ t o is the old time step, Comax is the pre-set maximum Courant number, and δ tmax
is the pre-set maximum time step. The values of Comax and δ tmax are specified in the
<case>/system/controlDict file.
It is critical to have the volume fraction α value accurate because it affects other physical
properties such as the density and viscosity, as well as the interface curvature. Therefore,
the volume fraction equation is solved in sub-cycles within each time step. The new
sub-cycle time step is calculated from the time step for the flow
δt
δ tsc = , (3.7)
nAl phaSubCycles
and the total flux, which is needed in the momentum equation, is calculated as F =
nAl phaSubCycles δ tsc
∑1 δ t Fsc . The use of sub-cycles speeds up the calculations by allowing
smaller time steps for the evolution of α , while retaining larger steps for solving the other
equations.
55
The specification of the pressure boundary conditions is simplified if the modified pressure
P is used which is obtained by removing the hydrostatic pressure from the pressure P. It
defined as
P = P − ρ g · x, (3.8)
where ρ is the density, g is the gravity, and x is the cell center. Using Eq. (3.8), the pressure
gradient is
this treatment enables efficient numerical treatment of the steep density jump at the
interface.
The pressure gradient in the momentum equation, Eq. (2.11), is replaced by the pressure
∂v
ρ (α )( + v · ∇v) = −∇P − g · x∇ρ + ∇ · η (γ̇ )(∇v + ∇v T ) + σ κ (α )∇α . (3.10)
∂t
Using the same technique as in Section 2.4.2, the pressure-velocity coupling equations are:
56
the pressure equation
1 H(v) g · x∇ρ σ κ ∇α
∑ S · ( aP ∇P) f = ∑ S · ( aP ) f − ( aP ) f + ( aP ) f , (3.12)
f f
H(v) g · x∇ρ σ κ ∇α 1
F =S· ( )f −( )f +( ) f − ( ∇P) f . (3.13)
aP aP aP aP
solver initiates the variables and then starts the time loop. Refer to
OpenFOAM/OpenFOAM2-1-0/application/solvers/multiphase/
1. Calculate the Courant number by calling the CourantNo.H library and adjust the
2. Correct the phase properties, such as density and viscosity, using the new volume
3. Solve the volume fraction equation (Eq. 3.4) as described in Section 3.1 to find α
using the fluxes from the previous time step by calling the alphaEqnSubCycle.H
library. The α value is iteratively corrected via Eq. (3.4) a number of times equal
57
The cAlpha keyword specified in the file <case>/system/fvSolution is
compression. After solving the volume fluid equation, the density and viscosity are
4. Start the PIMPLE loop to solve for the pressure and velocity as described in
Section 2.4.2.3. In this step, the volume fraction function α from the previous step is
The solver repeats these steps until a pre-set time which is specified in the
The interDyMFoam solver is the same as the interFoam solver but with the ability
of mesh motion and dynamic mesh refinement. In this study, we will concentrate on
the dynamic mesh refinement. The interDyMFoam solver can do the refinement only
for the 3D hexahedral cells by partitioning the cells equally in all three directions .
function is defined in the dynamicFvMesh library and can be found in the file
58
OpenFOAM/OpenFOAM2-1-0/src/dynamicFvMesh/dynamicRefineFvMesh
1. Reads the dynamicMeshDict file which is located in the constant folder of the
case directory. This file has some values that are needed to conduct the refinement,
First, a field is specified, which can be the magnitude of the velocity or the volume
The first and second bases are determined in the dynamicMeshDict file. Finally,
the cell must have an nAnchors value of 8. The nAnchors is defined in the
then the cell can not be refined. To find the value of nAnchors for a given cell, a
loop is taken over all the points of the cell and if the pointLevel is less than or
equal to cellLevel for a point, then this point is added to the nAnchors. In the
such that each cell has a cellLevel starting with 0 for the original cell and if the
cell is refined once then this number becomes 1 for each new cell and so on. The
59
3. Selects a subset of candidate cells for refinement by calling the function
file. The subset is chosen based on the maximum number of cells allowed, which is
OpenFOAM/OpenFOAM2-1-0/src/dynamicMesh/polyTopoChange/
(a) For each cell to be refined a point is added in the center of the cell as shown in
Figure 3.1.
(b) For each cell to be refined, a point is then added in the center of each face of
60
Figure 3.2: A point in the middle of a face
(c) For each cell to be refined, a point is added in the middle of each edge, as
(d) Each face is divided into four new faces as shown in Figure 3.4 and each new
61
(e) Internal faces are added to the cell by connecting the points in the center of two
neighboring faces, the point in the center of the edge that connects the faces,
and the point in the center of the cell, as shown in Figure 3.5. Therefore, a
(f) The fields are mapped from the old mesh to the new mesh as an initial condition
to speed up the computational process. The field value at the centroid of a cell
in the original mesh is transfered to the new cells by assigning them the same
values.
0, then the point can be unrefined. The nBufferLayers number will be discussed
62
6. The unrefinement can be done by calling the function unrefine()
OpenFOAM/OpenFOAM2-1-0/src/dynamicMesh/polyTopoChange/
7. Finally, the fields are mapped from the old to the new mesh. The values at the
centroid are mapped by taking the average for the small cells.
After the refinement is done, the fluxes are corrected in the solver using the new values of
the velocity. Figure 3.6 shows the dynamicMeshDict file. In this file, the refine interval
should be one or greater. This number indicates the time step occurrence of the refinement.
For example, if the refine interval is two, the refinement will be operated every second
time step. The field that is used to determine the cells requiring refinement is specified
to be alpha1. The lower and upper refine levels determine the range of the field such
that each cell having the field value in this range will be a candidate for the refinement.
The unrefinement level is the number that controls the points which can be unrefined, and
the number of buffer layers is used to find the buffer layers that should be extended for
unrefinement. Each cell can be refined up to the maximum refinement number and if the
total cells exceed the maximum number of cells, the refinement stops. The fluxes that needs
63
to be corrected is defined in this file as well. Finally, the dumpLevel is true to write the
refinement level.
!
" #
" #
"
$
$
% &
$
'( %&
$
'( ) %)&
&
*
In this section, we will compare the interFoam and interDyMFoam solvers from the
aspects of CPU time, mesh independence, and cell size around the interface. The test case
64
top wall
3 mm
inlet outlet
(0,0)
-3 mm
-15 mm bottom wall 15 mm
channel of length 30 mm, height 6 mm, and depth 6 mm. The origin of the coordinate
system is placed at the center of the domain, so that −15 ≤ x ≤ 15, −3 ≤ y ≤ 3, and
−3 ≤ z ≤ 3. The drop is a sphere of radius 1 mm and center at (0, 0, 0). At time t = 0, the
upper wall (at y = 3 mm) moves at a constant speed of u in the positive x-direction, and the
lower wall (at y = −3 mm) moves at a constant speed of u in the negative x-direction. The
side walls (at z = ±3 mm) remain stationary. The geometry is illustrated in Figure 3.7. The
continuous and disperse phases are taken to be Newtonian fluids. The transport properties
are as follows:
ρc = ρd = 103 kg/m3
σ = 0.0415N/m
where μ is the dynamic viscosity, ρ is the density, and σ is the interfacial tension. The
65
Figure 3.8: A droplet at steady-state for the 3D drop in shear flow test case
(Ca = 0.3).
μd ρd
viscosity ratio and density ratio are λ = μc = 1 and ρc = 1.
The capillary number is a dimensionless number that characterizes the ratio of viscous
aμc γ̇
Ca = , (3.14)
σ
where γ̇ is the shear rate, and a is the radius of the undeformed droplet. The subscripts,
c and d, denote the continuous and disperse phases respectively. The critical capillary
number Cacrit is the value of Ca above which drop breakup occurs (Ca > Cacrit) and below
which breakup does not occur (Ca < Cacrit). The critical capillary number in a given type
Table 3.1 shows the boundary conditions for the test case. The zeroGradient condition
means that the derivative normal to the boundary is zero. For example, the condition of the
66
Table 3.1
Boundary conditions for the 3D drop in shear flow test case, where Ca is
the capillary number
∂v
velocity on the inlet boundary means ∂x = 0 since x-direction is the normal for the inlet.
The velocities in the x-direction for the upper and lower wall boundaries are given in terms
of the capillary number. This dependence comes from the formula of the capillary number
bottom and top (here H = 3 mm). We take Ca = 0.3 which is a sub-critical capillary number
μd
for a viscosity ratio of λ = μc = 1. The end time for all cases is 1 s. The parameters used in
For this test case, steady-state is reached. The stationary drop shape (at time t = 0.99 s)
is shown in Figure 3.8. The steady-state results in the following sections are represented,
in part, by graphing data along the horizontal line that passes through the origin (y = 0) as
67
Table 3.2
DynamicMeshDict parameters for the 3D drop in shear flow test case
This section studies the mesh independence for the interFoam and interDyMFoam
solvers. The study is achieved by comparing the solutions of the velocity and pressure
on three different meshes, described in Table 3.3. Figure 3.9 shows the velocity along
the centerline (y = 0) for the three different meshes using interFoam. As the mesh
is refined, the difference between the velocity curves becomes smaller, and the velocity
curves become smoother. Similar results were found for the pressure shown in Figure 3.10.
Figures 3.11 and 3.12 show the velocity and pressure for the interDyMFoam solver on
the three different meshes and, for comparison, for the interFoam solver on the fine
mesh. The graphs for the velocity and pressure show almost identical results on the three
meshes where the difference between the curves is negligible. The interFoam results
on the fine mesh agree better with those from interDyMFoam in terms of velocity than
pressure.
The pressure graphs in Figures 3.10 and 3.12 show a jump in pressure within the droplet.
The jump in pressure is almost the same for the three meshes using interDyMFoam
68
solver. It is clear that the coarse mesh used with interFoam is insufficient since the
solution curves have a lot of oscillation and they are inaccurate compare to the solution
curves from the standard and fine meshes. Figures 3.9–3.12 show that interDyMFoam
results for this test case. As seen in Table 3.4, this is due in large part to the cell size around
the interface. The cell size around the interface using the coarse mesh of interDyMFoam
is smaller than the cell size using interFoam with fine mesh. More refinement around
the interface is needed to improve the results of interFoam. This would require a more
global refinement of the mesh compared to interDyMFoam, and would therefore increase
Table 3.3
Initial mesh and number of cells using interFoam and interDyMFoam for
the 3D drop in a shear flow test case
69
Coarse Mesh
0.02 Standard Mesh
Fine Mesh
0.01
Velocity [m/s]
-0.01
-0.02
-0.03
-0.004 -0.002 0 0.002 0.004
x-Coordinate [m]
Figure 3.9: Velocity at steady-state along line y = 0 using interFoam for
the 3D drop in shear flow test case Ca = 0.3. The vertical lines indicate the
boundary of the drop along y = 0.
Serial Calculations
This section compares the two solvers from the aspects of the CPU time, the number of
cells, and cell size around the interface. For the interFoam solver there are two cases.
In the first case, a uniform mesh is considered and in the second case (non-uniform),
the computational domain is divided into three blocks in the x-direction to have smaller
cells around the interface. The minimum and maximum x-coordinate for the blocks are
−15, −3; −3, 3; and 3, 15 started from block one to block three respectively. Table 3.4
shows the difference in CPU time, number of cells, and cell size around the interface. The
70
Coarse Mesh
2
90
Fine Mesh
60
30
0
-0.004 -0.002 0 0.002 0.004
x-Coordinate [m]
Figure 3.10: Pressure at steady-state along line y = 0 using interFoam for
the 3D drop in shear flow test case Ca = 0.3. The vertical lines indicate the
boundary of the drop along y = 0.
interDyMFoam has a lower overall CPU time, even when comparing its fine mesh with
interFoam’s standard and non-uniform meshes, keeping in mind that the cell size around
the interface is smaller for interDyMFoam. This is due in part to the fewer number of
cells in the fine mesh of interDyMFoam (maximum of 115000 cells) compared with the
standard and non-uniform meshes of interFoam (179685 cells). Note that although the
standard uniform mesh and non-uniform mesh of interFoam have the same number of
cells, the CPU time is almost doubled when using the non-uniform mesh. This is because
the cell size in the x-direction for the non-uniform mesh is δ = 0.09 mm which is half
of the cell size in the uniform mesh (0.18 mm), making the time step size smaller in the
|v|δ t
non-uniform mesh since it depends on the Courant number Co = δx . Specifically, if the
cell size (δ x) is decreased then the time step will decrease to have the Courant number
71
Coarse Mesh
0.02 Standard Mesh
Fine Mesh
interFoam Fine Mesh
0.01
Velocity [m/s]
-0.01
-0.02
-0.03
-0.004 -0.002 0 0.002 0.004
x-Coordinate [m]
Figure 3.11: Velocity at steady-state along line y = 0 using interDyMFoam
for the 3D drop in shear flow test case Ca = 0.3. The vertical lines indicate
the boundary of the drop along y = 0.
the typical time step was nearly doubled on the standard uniform mesh (2.7 × 10−4 s)
compared to the non-uniform mesh (1.4 × 10−4 s). The smaller cells on the non-uniform
mesh were located in the center part of the domain, where we know the drop remains. In
general, the location of the interface is unknown as time passes. Thus, when using a static
mesh, it is hard to refine the relevant region of the computational domain. Therefore, in
most cases, by using a static mesh, the whole mesh has to be refined, causing an increase in
the CPU time dramatically. Therefore, interDyMFoam will be a better option to do the
72
80
20
0
-0.004 -0.002 0 0.002 0.004
x-Coordinate [m]
Figure 3.12: Pressure at steady-state along line y = 0 using interDyMFoam
for the 3D drop in shear flow test case Ca = 0.3. The vertical lines indicate
the boundary of the drop along y = 0.
Table 3.4
CPU time and cell size around the interface using interFoam and
interDyMFoam for the 3D drop in a shear flow test case (Ca = 0.3)
73
Table 3.5
interDyMFoam in parallel for the 3D drop in a shear flow test case
(Ca = 0.3)
In general, to run a case in parallel, the decomposePar has to be run before running the
solver directly. When running the decomposePar, it chooses the number of processors
and the method of how to split the computational domain. For more information, refer
to the decomposeParDict file, located in the system folder of the case. Table 3.5
summarizes the CPU time and the cell size around the interface using interDyMFoam
solver in parallel on 8 processors and in serial on the standard mesh. There are four different
parallel cases using two different methods. In the first three cases, the simple method is
used, whereas, in the fourth case the scotch method is used. In the simple method, the
number of sub-domains in each direction must be specified. For example, (4 2 1) means that
the domain is divided into four sub-domains in x direction, two subdomains in y direction,
and one subdomain in z direction. In the scotch method, the solver chooses how to split
the domain in the best way to minimize the number of processor boundaries. As shown
in the table in our case, the best method to use is the simple method with directions (4
74
2 1) since the CPU time is lowest. This method divides the domain around the interface
into four small subdomains. Thus, the refined regions of the domain can be distributed onto
more processors while keeping the number of cells on the processor boundaries acceptable.
In general, if the interface is unknown, the scotch method will be the best option to use.
By comparing between the serial and parallel calculations, the CPU time increases by a
factor ranging 2.8 − 3.1 when the serial calculation is used. Therefore, using the parallel
calculation will be a good option to reduce the CPU time and get the same solution.
In this section, we will describe the modifications done for interDyMFoam to allow
functions that the 3D interDyMFoam uses. However, a cell is divided into four cells
instead of eight cells as the case in 3D. For the selected cells to be refined, the dynamic
1. A point is added to the center of each face that belongs to empty patches as shown in
Figure 3.13. In 2D, no point should be added to cell centroid because in one direction
the number of cells must remain one. Furthermore, no point is added to the center of
75
2. A point is added to the center of each edge that lies on the empty patches as shown
in Figure 3.13. The points should not be added to the other edges since this is a 2D
simulation.
Figure 3.13: The points in the center of the faces and edges
3. Each face that has a point added to its center is divided into four new faces as shown
in Figure 3.14. Each new face is assigned a new owner and neighbor cell. Therefore,
Figure 3.14: The faces are divided into four new faces
76
4. Each face that does not have a point added to its center is divided into two new faces
Figure 3.15: The faces are divided into two new faces
5. Finally, four new internal faces are added to the cell by connecting the points that
were added to the center of the faces and the points that were added to the center of
The rest of the process is similar to the interDyMFoam solver. The interDyMFoam
the empty patches with wedge patches. However, the cells on the center line should be
treated separately since they are wedges instead of hexahedral. Those cells have faces that
contains three vertices instead of four. Such triangular faces are divided into two faces, one
77
Figure 3.16: Internal faces are added to the cell
containing four vertices and the other containing three vertices. Also, we should add an
internal face that contains three vertices, where one of the vertices is the middle point of
the center line edge. The partition of a wedge is illustrated in Figure 3.17.
axisVal, and nBufferLayersR (see Figure 3.18). The axis and axisVal are the
numbers that controls the points which can be unrefined. If the empty or wedge faces
are perpendicular on the x-axis, then the axis number should be 0 and the axisVal
number should be between the minimum and maximum values of the x-component in
the geometry. If the empty or wedge faces are perpendicular on the y-axis, then the
axis number should be 1 and the axisVal number should be between the minimum
and maximum values of the y-component in the geometry. If the empty or wedge faces
are perpendicular on the z-axis, then the axis number should be 2 and the axisVal
number should be between the minimum and maximum values of the z-component in the
78
Figure 3.17: A cell with divided face and two internal faces added in
axisymmetric case
find the number of buffer layers that should be extended for the unrefinement, but for the
refinement instead of unrefinement. This value was added to extend the number of buffer
layers around the interface during the refinement step, since it was found that additional
resolution is often needed in this step, particularly when tracking small drops in a flow
field. If the resolution around the interface is extended, then the mass will be conserved for
a small droplet in a large geometry, whereas, without extending the resolution, the droplet
loses mass and may even vanish. The modifications are made via libraries, specifically,
are further explained in the Appendix B. To validate the modifications, three cases are
79
Figure 3.18: Example of a dynamicMeshDict for 2D simulations
80
3.6 Test of interFoam and interDyMFoam in 2D Planar
Geometry
In order to validate the modifications of the code for 2D planar simulations, the solutions
from the modified code are compared with the solutions from the interFoam solver for
two test problems: drop deformation and breakup in simple shear flow, and drop formation
In this section, we test interDyMFoam in 2D planar geometry for the test case of a
two-dimensional liquid drop in a simple shear flow. This is the two-dimensional version
of the 3D test case considered in Section 3.4. The computational domain is a channel of
length 30 mm and height 6 mm. The origin of the coordinates system is placed in the center
of the domain, such that −15 ≤ x ≤ 15 and −3 ≤ y ≤ 3. The drop is a circle of radius 1 mm
and center (0, 0) (see Figure 3.7). The boundary conditions are shown in Table 3.6. The
fluids are taken to be Newtonian and the material properties are μc = μd = 1.06×10−1 Pa.s,
ρc = ρd = 103 kg/m3 , and σ = 0.0415N/m. The coarse and fine meshes are produced by
decreasing and increasing the number of cells in the standard mesh by a factor of 1.5 in
each direction respectively (see Table 3.7). We first consider the case of Ca = 0.3, and then
81
the case of Ca = 0.4.
Table 3.6
Boundary conditions for the 2D drop in a shear flow test case where Ca is
the capillary number
Table 3.7
Initial mesh and number of cells for the 2D drop in a shear flow test case
Solver Initial Mesh Number of Cells
interFoam (Coarse) 300×60 18000
interFoam (Standard) 450×90 40500
interFoam (Fine) 675×135 91125
interDyMFoam (Coarse) 80×16 1280 − 2100
interDyMFoam (Standard) 120×24 2880 − 3900
interDyMFoam (Fine) 180×36 6480 − 8000
For Ca = 0.3, the drop reaches a stationary shape after a while and no break up occurs.
Figures 3.19 and 3.20 show the refinement around the interface. Figure 3.19 illustrates the
coarsest mesh (top figure), the refinement in the x, y directions at t = 0.005 s (middle
figure). Figure 3.20 shows the number of cells in the z-direction equal one. Note that
82
the refinements are shown as diagonals, although the cells are actually partitioned into
rectangles.
83
Figure 3.20: Dynamic refinement in 2D at t = 0.005 s for the 2D drop in a
shear flow test case
Figure 3.21: Drop at steady-state t = 0.99 s for the 2D drop in a shear flow
test case
84
Coarse Mesh
0.02 Standard Mesh
Fine Mesh
Ux [m/s] 0.01
-0.01
-0.02
-0.03
-0.01 -0.005 0 0.005 0.01
x-Coordinate [m]
Figure 3.22: Velocity using interFoam on three different meshes Ca = 0.3
for the 2D drop in a shear flow test case
Coarse Mesh
0.02 Standard Mesh
Fine Mesh
interFoam Fine Mesh
0.01
Ux [m/s]
-0.01
-0.02
-0.03
-0.01 -0.005 0 0.005 0.01
x-Coordintae [m]
Figure 3.23: Velocity using interDyMFoam on three different meshes Ca =
0.3 for the 2D drop in a shear flow test case
85
40
Coarse Mesh
Dynamic Pressure [kg/m.s ]
2 Standard Mesh
30 Fine Mesh
20
10
0
-0.01 -0.005 0 0.005 0.01
x-Coordinate [m]
Figure 3.24: Pressure using interFoam on three different meshes Ca = 0.3
for the 2D drop in a shear flow test case
The velocity and pressure from interFoam and interDyMFoam for this 2D problem
are compared along the horizontal line y = 0 at time t = 0.99 s, when a stationary drop
shape is reached (see Figure 3.21). Figure 3.22 shows the velocity graphs for the same
case with three different meshes: coarse, standard, and fine mesh using the interFoam
solver. The vertical lines indicate the boundary of the drop. The solutions are almost
identical outside the droplet and behave similarly inside the droplet. Also, the graphs show
a zero velocity outside the droplet which is expected since the top and bottom walls are
moving at the same speed in the x-component with opposite directions. Inside the droplet,
the velocity increased and then decreased. Similarly, in Figure 3.23, the same behavior
is found using the interDyMFoam solver. The velocities agree with the interFoam
solution on the refined mesh. Similarly, the pressure graphs, Figures 3.24 and 3.25, show
86
40
Coarse Mesh
20 Standard Mesh
Fine Mesh
interFoam Fine Mesh
10
0
-0.01 -0.005 0 0.005 0.01
x-Coordinate [m]
Figure 3.25: Pressure using interDyMFoam on three different meshes Ca =
0.3 for the 2D drop in a shear flow test case
the same convergence. They have the same behavior overall, as the jump in pressure is
decreasing by increasing the mesh resolution using interFoam solver. However, the
solutions from interDyMFoam solver are accurate even on the coarse mesh. Table 3.8
Table 3.8
CPU time, cell size around the interface, and relative change in radius for
the 2D drop in a shear flow test case (Ca = 0.3)
Cell CPU Initial Cell size around relative change
Solver
Time (s) Mesh the interface(mm) in R
interFoam (Coarse) 1164 300×60 0.1 × 0.1 0.034
interFoam (Standard) 6409 450×90 0.067 × 0.067 0.008
interFoam (Fine) 21611 675×135 0.044× 0.044 0.002
interDyMFoam (Coarse) 107 80×16 0.09× 0.09 0.030
interDyMFoam (Standard) 355 120×24 0.063× 0.063 0.008
interDyMFoam (Fine) 918 180×36 0.042× 0.042 0.003
shows the difference in CPU time, number of cells, cell size around the interface, and
87
the relative change in radius. Here, the radius is calculated by considering the drop as a
circle using the α = 0.05 contour, so if the volume fraction in a cell less than 0.05, then
the cell does not contribute to the calculation of the radius. The interDyMFoam has a
much lower overall CPU time, even when comparing its fine mesh with the interFoam’s
coarse mesh as the CPU time increased by a factor of 1.2, keeping in mind that the cell
size around the interface is almost the same between the two solvers. The relative change
R0 −R0.99
in the radius is calculated using the formula R0 , where R0 is the radius at t = 0 s and
R0.99 is the radius at t = 0.99 s. The relative change decreases with decreasing cell size
around the interface, however it is almost identical in comparison between the two solvers.
Furthermore, the numbers are small in all cases especially in the fine mesh which indicates
that the mass inaccuracy due to the mesh is negligible. As a result, the two solvers give
This section compares the two solvers on the 2D drop in shear flow for Ca = 0.4. This is a
super-critical Ca, where break up occurs. In the previous case using Ca = 0.3, the break up
does not occur. In this case, however, the droplet breaks up into two daughter droplets using
both solvers, interFoam and interDyMFoam. Figure 3.26 shows the daughter droplets
using interFoam (top) and interDyMFoam (bottom). The dynamic refinement in the
x, y directions is shown in Figure 3.27. In the figure, the refinement appears around the
88
Figure 3.26: Drop breakup in 2D using Ca = 0.4 at t = 0.99 s using
interFoam (top) and interDyMFoam (bottom) for the 2D drop in a shear
flow test case
interface and there is no refinement between the droplets. That is, after the initial droplet
break up and the droplets move apart, the unrefinement occurs for the refined cells far from
the interfaces. The number of cells in the z-direction is one as shown in Figure 3.28.
Table 3.9 summarizes the CPU time, cell size around the interface, the initial radius R0 ,
the radius of the first daughter droplet R1 , the radius of the second daughter droplet R2 , the
89
Table 3.9
CPU time, cell size around the interface, and relative change in radius for
the 2D drop in a shear flow test case (Ca = 0.4)
CPU Cell size around break up
R20 −(R21 +R22 )
Solver R0 (mm) R1 (mm) R2 (mm) R20
Time (s) the interface(mm) time (s)
interFoam 1578 0.1 × 0.1 1.003 0.667 0.688 0.09 0.115
interFoam 6811 0.067 × 0.067 1.006 0.715 0.688 0.03 0.21
interFoam 26068 0.044 × 0.044 1.002 0.703 0.708 0.008 0.36
interDyMFoam 242 0.09 × 0.09 1.036 0.695 0.694 0.1 0.15
interDyMFoam 661 0.063 × 0.063 1.017 0.699 0.719 0.03 0.225
interDyMFoam 1438 0.042 × 0.042 1.030 0.722 0.728 0.008 0.43
relative change in mass, and the breakup time. The efficiency of interDyMFoam relative
to interFoam increases with mesh refinement, i.e. with decreased cell size around the
interface. For the three interDyMFoam meshes, the CPU time for interDyMFoam
decreases by a factor of 6.5, 10.3, and 18.1 relative to the corresponding interFoam
mesh. The droplet is broken into two droplets, thus a refinement is needed around the
interface for each droplet, (see Figures 3.27 and 3.28). The radius of each droplet depends
90
Figure 3.28: Dynamic refinement in 2D with Ca = 0.4 at t = 0.99 s for the
2D drop in a shear flow test case
of the cell size around the interface and the initial radius of the droplet. The initial radius
depends on the initial mesh, especially for the interDyMFoam solver since the solver
starts with a coarse mesh compared to interFoam solver. As expected, each droplet
is broken into two daughter droplets with almost identical radius particularly on the fine
mesh. In principle, due to mass conservation, the area of the initial droplet must equal the
sum of the areas of the daughter drops. Mathematically, this can be written as
where R0 is the radius of the initial drop. From Eq. (3.15), we get R20 = R21 + R22 . Therefore,
R20 −(R21 +R22 )
the relative change in R can be calculated using the formula R20
. In the table, the
91
relative change is small for all cases especially on the refined mesh. Also, the relative
change is almost the same if we compare between the solvers. The break up time is
dependent on the mesh resolution as the droplet breaks up on the coarse mesh faster than on
the finer mesh. Physically, the breakup time should not differ. However, in the simulations,
breakup time depends on the cell size, thus the difference in breakup time using different
meshes.
interFoam on this 2D planar test problem. It produces similar results at much lower
CPU times.
micro T-channel. In particular, the performance of the modified code is compared with
The micro T-channel flow problem consists of a disperse phase fluid which is transported
through a pore and into a gap containing a continuous phase fluid. Drops of the disperse
phase are then detached by the shear flow field of the continuous phase. The domain
used for the pore is a channel of length 25 micrometers and height of 200 micrometers.
The domain used for the gap is a channel of length 2250 micrometers and height of 500
micrometers The origin of the coordinate system is placed such that −250 ≤ x ≤ 2000
92
and 0 ≤ y ≤ 500 for the gap and −25 ≤ x ≤ 25, −200 ≤ y ≤ 0 for the pore. The
geometry is divided into four blocks as shown in Figure 3.29. Table 3.10 summarizes
the number of cells in each block for the three meshes in both solvers. The coarse and fine
meshes are obtained from the standard mesh by decreasing and increasing the number of
cells in each direction by a factor of 1.4, respectively. Table 3.11 shows the boundary
pressure gradient is adjusted such that the flux is specified using the velocity boundary
and σl f (liquid-fluid) produces the equilibrium or static contact angle. The balance of these
surface tension can express in Young’s relation [51], σ f s − σls − σl f cos(θ ) = 0, where
θ is the angle between the tangent line of the liquid at the triple point, where the three
phases meet, and the solid from the liquid side. Wetting is the ability of liquid to maintain
contact with a solid surface, resulting from intermolecular interaction when the two are
brought together. Contact angle θ = 0 is a perfectly wetting case and θ = 180o is a perfect
non-wetting case. If the contact angle is larger than 90o then the surface is non-wetting.
On the other hand, if the angle is below than 90o the material is wetting the surface. In
the simulations, a non-wetting behavior is assumed by taking the static contact angle to be
180o . The end time for all cases is 0.1 s. The continuous and disperse phases are taken
to be Newtonian fluids. The velocity set to be 0.3m/s directed to the positive x-axis on the
inlet of the shear flow channel and about 0.01 m/s directed to the positive y-axis on the inlet
93
(-250,500) top wall
inlet 1 block 2
block 1 outlet
block 4
(2000,0)
(-250,0)
μd = 1 × 10−3 Pa.s
ρc = 960kg/m3
ρd = 103 kg/m3
σ = 0.0415kg/s2
Table 3.10
Number of cells in each block for a drop detachment from a micro
T-channel test case
number
Solver block 1 block 2 block 3 block 4
of cells
interFoam (Coarse) 56 × 125 13 × 125 13 × 50 494 × 125 71081
interFoam (Standard) 78 × 175 18 × 175 18 × 70 692 × 175 139160
interFoam (Fine) 109 × 245 25 × 245 25 × 98 969 × 245 272685
interDyMFoam (Coarse) 19 × 42 5 × 42 5 × 17 165 × 42 8023
interDyMFoam (Standard) 27 × 59 7 × 59 7 × 24 231 × 59 15803
interDyMFoam (Fine) 38 × 82 10 × 82 10 × 33 323 × 82 30752
94
Table 3.11
Boundary conditions for a drop detachment from a micro T-channel test
case
where μ is the dynamic viscosity, ρ is the density, σ is the interfacial tension, and the
subscripts c and d stands for continuous and disperse phases respectively. The capillary
μc u
number Ca = σ , where u is the characteristic velocity, is about 0.76 and viscosity ratio
μd
λ= μc is about 0.0095. The Reynolds number is the ratio of inertial forces to viscous
ρ uL
forces and mathematically defined as Re = μ , where L is the characteristic length and u
is the characteristic velocity. The Reynolds number for the continuous phase Rec is about
1.37 and for the disperse phase Red is about 0.55. Figures 3.30 and 3.31 show the first
simulations, several droplets are produced of nearly uniform size. The drop size reported
in the following is the average of those sizes. In both cases, the radius of the detached drops
are larger than the pore radius. The coarsest mesh and refinement around the interface after
95
Figure 3.30: Drop deformation and detachment at t = 0.01, 0.012, and
0.014 s using interDyMFoam for a drop detachment from a micro T-channel
test case
96
Figure 3.31: Drop deformation and detachment at t = 0.01, 0.012, and
0.014 s using interFoam for a drop detachment from a micro T-channel test
case
97
Figure 3.32: Dynamic refinement at t = 0, 0.004, and 0.014 s for a drop
detachment from a micro T-channel test case
98
3.6.2.1 Mesh Independence Study
This section compare the predictions of interFoam and the modified interDyMFoam,
each on three different meshes. In particular, we compare the pressure curves and drop
sizes. Figure 3.33 shows the pressure curves along a horizontal line through the center of
a detached droplet for three different meshes using interFoam. The graphs are almost
identical outside the droplet. The graphs indicate mesh independence for the standard
and fine meshes. The same behavior is noted in Figure 3.34, where the interDyMFoam
solver is used. The interDyMFoam appears to perform better than interFoam for this
case because the pressure does not undershoot close to the interface as observed in the
interFoam solution.
Next, we compare the detached drop size and the CPU time for the two solvers on the
Table 3.12
CPU time and ratio of a drop radius to the pore radius using maximum
refinement 1 for a drop detachment from a micro T-channel test case
different meshes. This is summerized in Table 3.12. The drop size is given as the ratio of
the radius of the detached drop to the pore radius. The table shows that for both solvers the
99
3000
Coarse Mesh
Standard Mesh
Fine Mesh
2500
Pressure [kg/m.s ]
2
2000
1500
1000
0.0003 0.0006 0.0009 0.0012
x-Coordinate [m]
Figure 3.33: Pressure using interFoam for a drop detachment from a micro
T-channel test case
drop size increases as the cell size around the interface decreases. However, the relative
change in drop size decreases with mesh refinement, and is smaller in interDyMFoam.
Moreover, the standard mesh of each solver produces nearly the same drop sizes (1.6903
vs 1.70793), as does the fine mesh of each solver (1.77856 vs 1.77832). In addition, the
CPU time using interDyMFoam is much smaller than the CPU time using interFoam
by a factor of 2.4 and 3.4 for the coarse and fine mesh respectively.
100
3000
2500
Pressure [kg/m.s ]
2
2000
times and drop sizes when using the interDyMFoam solver. The CPU time and
Table 3.13
CPU time and Ratio of a Droplet to the radius of the Pore with Different
Refine Interval Numbers using interDyMFoam solver with max.
refinement equal to 3 and buffer layer equal to one for a drop detachment
from a micro T-channel test case
normalized drop radius for different values of refineInterval is shown in Table 3.13.
Recall that the refine interval specifies how often the mesh should be refined, so that
refineInterval = n means that the mesh is dynamically refined every n time steps.
101
Assuming the solution is most accurate using refine interval equal to one, it will be used
as a standard to compare with other refine interval numbers. By comparing the refine
interval equal to 1 with the other refine interval numbers, the relative change in drop size
is negligible. Although there is a significant difference in the relative change in drop size
between refine interval equal to 7 and 9 compared to other refine interval numbers, the
relative change is still negligible. On the other hand, the time ratio is almost the same
using refine interval equal to 5, 7, and 9 which is around 0.3 but it is 0.5 when using refine
interval equal to 3. Thus, we suggest the refine interval to be between 5 and 9 because it
In Table 3.14, the effect of the maximum refinement number on the drop size and the
Table 3.14
CPU time and Ratio of a Droplet to the radius of the Pore with Different
Maximum Refinement Numbers using refine interval equal and buffer layer
equal to one for a drop detachment from a micro T-channel test case
CPU time is shown. Recall that the maximum refinement parameter, maxRefinement,
indicates how many times a given cell may be refined. The table shows that the CPU
However, the relative change in drop size is reduced from 0.074 to 0.052, which means
that the maximum refinement number has an effect on the CPU time and the drop size.
Table 3.15 outlines the effect of the number of buffer layers on the CPU time and drop
102
Table 3.15
CPU time and Ratio of a Droplet to the radius of the Pore with Different
Number of Buffer Layers using refine interval equal to one and max.
refinement equal to 2 and 4 for a drop detachment from a micro T-channel
test case
size for two different cases, one with maximum refinement 2 and the other with maximum
refinement 4. Recall that the number of buffer layers is used to find the buffer layers that
should be extended for unrefinement. Here, we take the number of buffer layers equal to 1
and 3. The table shows that for each value of maxRefinement (2 or 4), the CPU time
decreases slightly as the number of buffer layers increases from 1 to 3, while the drop sizes
remain essentially the same. Therefore, the results imply that the number of buffer layers
has little or insignificant effect on the CPU time and drop size.
103
3.7 Test of interFoam and interDyMFoam in 2D
Axisymmetric Geometry
axisymmetric geometry. Figure 3.35 shows the geometry used for the simulations. The
computational domain is a small wedge channel open into a large wedge channel. The
small channel has width of 1 mm and height of 5 mm and contains the disperse phase (air).
The large channel has width of 40 mm and height of 80 mm and contains the continuous
phase (water). The origin is placed such that 0 ≤ x ≤ 1, −5 ≤ y ≤ 0, −0.01 ≤ z ≤ 0.01 for
the small channel and 0 ≤ x ≤ 40, 0 ≤ y ≤ 80, −0.4 ≤ z ≤ 0.4 for the large channel. The
center line of the axisymmetric geometry is placed such that −5 ≤ y ≤ 80, x = 0, and z = 0.
The number of cells in each block for the all cases is outlined in Table 3.16. The coarse
and fine meshes are produced by decreasing and increasing the standard mesh by a factor
of 1.5, respectively . Also, the boundary conditions are summarized in Table 3.17. The end
time for all cases is 0.5 s. The two fluids in the simulation are Newtonian. The transport
μc = 1 × 10−3 Pa.s
ρc = 1000Kg/m3
ρd = 1Kg/m3
104
side upper
80mm
block 1
right wall
y-axis block 3
Table 3.16
Number of cells in each block for the standard mesh of a bubble rising in a
water axisymmetric case
σ = 0.072Kg/s2
where μ is the dynamic viscosity, ρ is the density, σ is the interfacial tension, and the
subscripts c and d stands for continuous and disperse phases respectively. The capillary
number Ca is 0.375 × 10−3 , viscosity ratio λ is 0.018, and Reynolds number Re for
the disperse phase is 1.5. Figures 3.36 and 3.37 show the bubble deformation and
105
Table 3.17
Boundary conditions of a bubble rising in a water axisymmetric test case
phase produced a bubble that is larger in size than the small channel length. The refinement
around the interface and unrefinement between the bubble and the inlet are shown in
Figure 3.38.
106
Figure 3.36: Drop deformation and detachment at t = 0.335, 0.34, and 0.35
s using interDyMFoam for a bubble rising in water test case
107
Figure 3.37: Drop deformation and detachment at t = 0.35, 0.355, and
0.365 s using interFoam for a bubble rising in water test case
108
Figure 3.38: Dynamic refinement around the interface for a bubble rising
in water test case
109
Figure 3.39 shows the pressure along the centerline predicted by interFoam. The jump
in the pressure decreases with mesh refinement, but the difference in pressure jump between
consecutive meshes decreases as well. This indicates the jump in pressure is converging
with mesh refinement. The mesh independence of the centerline pressure predicted by
the modified interDyMFoam is shown in Figure 3.40. This figure also shows that the
Finally, Table 3.18 presents the CPU time, bubble radius, and relative change in the
radius for the two solvers. The CPU time is much less using interDyMFoam. For
example, on the fine mesh, using interFoam, the CPU time increased by a factor of
4.6 compared to interDyMFoam. The table also shows that the bubble radius increases
by increasing the mesh resolution but the difference becomes smaller for both solvers.
Moreover, the drop sizes predicted by the two solvers compare well. As a result, the
modified interDyMFoam solver gives results similar to interFoam but for much less
CPU time.
Table 3.18
CPU time, bubble radius, and relative change using interFoam and
interDyMFoam for a bubble rising in a water axisymmetric test case
110
-150
Coarse Mesh
Standard Mesh
Fine Mesh
Pressure [kg/m.s ]
2 -200
-250
-300
0.018 0.021 0.024 0.027 0.03
y-coordinate [m]
Figure 3.39: Pressure using interFoam for a bubble rising in a water
axisymmetric test case
planar and axisymmetric geometries. Also, the solver is modified to allow for computing
the deformation and breakup of drops or bubbles that are very small relative to the mesh
of the flow domain. To validate the modified interDyMFoam, three test problems are
considered: two in 2D planar geometry and one in axisymmetric geometry. The solutions
from the modified interDyMFoam are compared with the solutions from interFoam
from the aspects of mass accuracy, CPU time, and cell size around the interface. The
111
-150
Coarse Mesh
Standard Mesh
Fine Mesh
interFoam Fine Mesh
Pressure [kg/m.s ]
2
-200
-250
-300
0.018 0.021 0.024 0.027 0.03
y-Coordinate [m]
Figure 3.40: Pressure using interDyMFoam for a bubble rising in a water
axisymmetric test case
112
Chapter 4
Nozzle
another. If the disperse phase itself contains drops of another liquid, then the emulsion
is called a double emulsion. The most common types of double emulsions are the
found in many industries, including the food and pharmaceutical industries. Hydrophilic
and lipophilic surfactants are encapsulated to produce a stable emulsion since they reduce
the interfacial tension between phases. It is desirable for emulsions and double emulsions
to have mechanical strength so they can stand against the mechanical forces generated by
the manufacturing process such as mixing and pumping. After production, they should be
113
weak enough to release their encapsulations in the desired manner, such as the controlled
release time during digestion and the release rate of flavor by chewing.
Double emulsions are inherently unstable due in part to coalescence and compositional
ripening [1], [2], [3]. Coalescence is the process by which droplets merge with each
other to form larger droplets, whereas, compositional ripening occurs by diffusion and/or
permeation of the surfactants components across the disperse phase. The solid powder
of emulsions produced by spraying is more stable than the liquids emulsions since the
coalescence and ripening are reduced [11], [52]. Therefore, emulsion powders tend to
have a longer shelf life which is desirable for economical reasons. In addition to these
It is important for double emulsions to retain their structure during and after the spray
processing. For example, drops should not break up since this would change the structure,
structure such as droplet size and droplet distribution. In their experiments, Dubey et al.
[53] produced solid particles by spraying and studied the influences of the spray process
parameters on the structure of double emulsions. Uddin et al. [54] investigated the effect of
insoluble surfactants on the breakup of rotating liquid jets. Drop breakup during spraying of
[55, 56] and emulsions with a good particle size distributions were produced.
114
In this chapter, the droplet breakup conditions inside a spray nozzle is analyzed for a
simple emulsion. The study is achieved by the simulation of two-phase flow where the
droplet is a Newtonian fluid and the outer phase is either Newtonian or non-Newtonian.
Specifically, drops of different sizes are tracked through the flow field of the continuous
phase fluid. The goal is to determine the effects of shear rate, capillary numbers, viscosity
particular interest is the critical drop size, that is, the largest drop that does not break up
within the nozzle. To determine these critical drop sizes, many drops of different sizes
must be tracked along different particle tracks for a given fluid system. Since this would
be computationally very expensive in three dimensions, even with the use of dynamic
meshing, the simulations are performed in two dimensions. This allows us to study
the qualitative behavior and functional relationships, and will help determine appropriate
three-dimensional simulations.
A first step, single phase flow calculations are performed to study the mesh independence
for the outer phase fluid. This allows us to determine a mesh suitable to describe the outer
phase flow field. Then, the two-phase flow is solved using dynamic refinement mesh to
have accurate resolution around the interface. Using dynamic meshing around the drop
interface as it moves through the flow field is necessary since the drops are most often very
small relative to the dimensions of the geometry. The refined mesh from the single phase
115
4.1 Problem Description
The geometry and material properties in the simulations are taken from the experiments
of Dubey et al. [11]. A cylindrical tapered die geometry is used in their experiments, see
Figure 4.1. The upstream cylinder had radius Ru = 3 mm and length Lu = 22.5 mm, and
the downstream cylinder had radius Rd = 0.5 mm and length Ld = 1.5 mm, giving the
contraction ratio, Ru /Rd , of 6:1. Also, the emulsion (which is non-Newtonian) is produced
from two Newtonian fluids. The transport properties of the fluids used to produce the
two dimensional version of the actual nozzle geometry, with symmetry assumed along
the centerplane. Moreover, in the simulations, the length of the downstream channel is
extended from 1.5 mm to 20 mm, which allows us to consider the effect of nozzle channel
length on drop breakup. The computational domain and coordinate system are also given
in Figure 4.1. The transport properties for the droplets are taken to be the same as above:
fluid. The non-Newtonian fluid has a slightly shear-thinning behavior, whose viscosity
η − η∞ n−1
= [1 + (mγ̇ )2 ] 2 (4.1)
η0 − η ∞
116
with parameters η0 = 0.113Pa.s, η∞ = 0.08Pa.s, ρ = 977Kg/m3 , m = 0.0049 s, and n =
viscosities, respectively, m is a time constant whose reciprocal gives the shear rate at which
the fluid begins to shear thin, and n is the dimensionless power-law index which controls
the rate at which the fluid shears thin. The values of ρ and η0 are used for the density
and viscosity of the Newtonian continuous phase fluid. Table 4.1 summarizes the material
parameters used in the simulations. The relation between the viscosity and shear rate for
the non-Newtonian continuous phase fluid, given by the Bird-Carreau model, is shown in
Figure 4.2. The viscosity ratio λ = ηd /ηc corresponding to the Newtonian continuous
phase was λ = 0.56, while λ ranged from 0.56 to 0.79 for the non-Newtonian continuous
phase. The boundary conditions are outlined in Table 4.2. The centerline boundary (y = 0)
Table 4.1
Fluid parameters used in the simulations. The parameters for the
non-Newtonian fluid correspond to the Bird-Carreau viscosity model,
Eq. (4.1).
Newtonian
Continuous ρc = 977 ηc = 0.113
Non-Newtonian
Continuous ρc = 977 η0 = 0.113
η∞ = 0.08
m = 0.0049 s
n = 0.01323 [-]
117
-22.5
6 mm
22.5 mm
5 mm
3
1 mm 0 y [mm]
2.5
1
4.5 mm
5.5
1.5 mm
25.5 0.5
1 mm
x [mm]
Figure 4.1: Schematic diagram of the nozzle geometry used in experiments
(left) and the computational domain used in the simulations (right).
.
is specified as symmetry boundary. The velocity is set to be zero on the walls, zero gradient
to one flow rate used in the experiments. The boundary conditions for the volume fraction
function α are taken to be zero gradient, where this function is used in the two-phase
calculations. Finally, the pressure is taken to be zero gradient along the inlet and walls, and
zero on the outlet. The Reynolds number for the Newtonian flow is Re = 0.76 and for the
118
0.14
0.12
0.08
0.06
0 1 2 3 4 5 6 7
10 10 10 10 10 10 10 10
Shear Rate [1/s]
Figure 4.2: Viscosity vs shear rate of the non-Newtonian continuous phase
fluid predicted by the Bird-Carreau model.
.
Table 4.2
Boundary conditions for the nozzle.
The computational domain is divided into five blocks as shown in Figure 4.3. Table 4.3
summarizes the number of cells in each block for the coarse, standard, and fine mesh. Note
119
that all meshes are non-uniform. The coarse and fine mesh are obtained by decreasing and
increasing the number of cells in the standard mesh by a factor of 1.5, respectively. The
single phase simulations are achieved using the simpleFoam solver of OpenFOAM
R
. In
this section, the mesh independence and the convergence are discussed for both continuous
phase fluids. In all graphs in this section, the dashed curves represent the non-Newtonian
fluid and the solid ones represent the Newtonian fluid. The residual convergence for the
fine mesh is illustrated in Figure 4.4 where the residualControl are 10−4 and 10−5
for the pressure and velocity respectively. That is, the velocity-pressure iterations terminate
when the current solution to each discrete system of equations for velocity components and
pressure produces a residual that meet these criteria simultaneous. The number of iterations
The velocity along the center line is shown in Figure 4.5. The figure shows mesh
independence for both fluids. By comparing the Newtonian and non-Newtonian graphs, the
figure also shows almost identical velocities until x = 5.5 mm and then in the small channel
(x ≥ 5.5 mm), the velocity is greater in the Newtonian case. This is due to the shear-thinning
behavior of the non-Newtonian fluid. The calculated pressure field for each fluid is also
mesh independent. This is illustrated in Figure 4.6 where the centerline pressure is plotted.
For both fluids, pressure decreases very slightly in the large channel, while the pressure
gradient is much larger in magnitude in the small channel. This is consistent with the
120
(0,3)
block 2 (1,2.5)
inlet
block 3
block 1
block 4
(5.5,0.5)
block 5 outlet
Figure 4.3: Computational domain and number of blocks for the nozzle.
dp −3 Q
H. Actually, for a Newtonian fluid dx = 2 μ H3
where Q is the flow rate, while for a
n
dp Q 1 1n +1 1
power-law, where η (γ̇ ) = K γ̇ n−1 , dx = −κ 2H ( H ) ( n + 2) . Figure 4.6 also shows
that the non-Newtonian fluid has lower pressure and lower pressure gradients. This is due
We choose to perform the two-phase calculations using the fine mesh which is the most
Table 4.3
Number of cells in each block for the nozzle.
121
1e+00
1e-01
Ux_0
Uy_0
1e-02 p_0
Residual
1e-03
1e-04
1e-05
1e-06
0 100 200 300 400
Number of Iterations
Figure 4.4: Residual using Newtonian (solid curves) and non-Newtonian
(dashed curves) fluids for the refined mesh for the nozzle.
Coarse Mesh
0.25 Standard Mesh
Fine Mesh
0.2
Velocity [m/s]
0.15
0.1
0.05
0
-0.02 -0.01 0 0.01 0.02
x-coordinate [m]
Figure 4.5: Velocity along the centerline for the single phase calculations
using Newtonian (solid curves) and non-Newtonian (dashed curves) for the
nozzle. The vertical dashed lines at x = 0 and x = 5.5 mm indicate the
contracting part of the domain.
122
6
Coarse Mesh
5 Standard Mesh
Kinematic pressure [m /s ]
2
Fine Mesh
2
0
-0.03 -0.02 -0.01 0 0.01 0.02
x-coordinate [m]
Figure 4.6: Pressure along the centerline for the single phase calculations
using Newtonian (solid curves) and non-Newtonian (dashed curves) for the
nozzle. The vertical dashed lines at x = 0 and x = 5.5 mm indicate the
contracting part of the domain.
123
4.3 Drop Tracking Along Streamlines
In this section, the break up investigations are performed for droplets moving along
different streamlines, see Figure 4.7. Each drop started in the fully developed flow in
the upstream channel, and the streamlines were labeled by the initial y-coordinate of the
drop’s center. The streamlines ranged from y = 0 (centerline) to y = 2.7 mm (close to the
upstream channel wall, located at y = 3 mm). Figure 4.8 shows the shear rates, γ̇ = |γ̇|
where γ̇ = ∇v + (∇v)T is the rate-of-strain tensor, along various streamlines for both
the Newtonian fluid (solid curves) and non-Newtonian fluid (dashed curves) as a function
of particle transit time along the streamline. For each streamline, t = 0 corresponds to
the beginning of the contraction section of the domain (at x = 1 mm). Characteristic of
shear-thinning fluids, their shear rates are smaller than those for the Newtonian fluid close
to the centerline and larger than those for the Newtonian fluid close to the wall.
Dynamic meshing is used in the simulations to have accurate resolution around the
Table 4.4
DynamicMeshDict parameters for the nozzle.
equal to one, field alpha α , lower refine interval equal to 0.1, upper refine interval equal
124
to 0.9, number of buffer layers for unrefinement equal to 1, number of buffer layers for
the refinement ranging between 1 − 2 where one is used for large drops and two is used
for small drops, and maximum refinement ranging between 3 − 6 to establish the mesh
independence of drop breakup. Table 4.4 summaries these parameters. Figure 4.9 shows
the mesh refinement around a drop in two regions of the domain: in the upstream portion
of the domain, where the shear rates are relatively low and the drop remains nearly circular,
and in the downstream portion of the domain, where the shear rates are high and the
drop elongates dramatically before breaking up. Recall that the refinements are shown
accomplished, keeping in mind that the axisymmetric simulation are valid only for droplets
along the center line (see Figure 4.10). From the simulation, break up did not occur along
the center line and the same results are observed in the 2D planar simulation. Moreover,
no breakup occurred on streamlines y < 0.75 in the 2D simulations since the maximum
drop radius that can be placed in the nozzle is 3 mm and larger drops are needed to get the
The critical drop size is defined to be either the largest drop size for which a drop does
not break up in the domain, or the smallest drop size for which breakup occurs. Figure 4.11
shows a drop deformation and breakup along the streamline y = 1.5 for the non-Newtonian
continuous phase fluid. Figure 4.12 is presented to show the critical breakup radius at
different streamlines (top) and shear rate in the downstream channel (bottom) for both
125
Figure 4.7: Nozzle streamlines at y equal to 0.75, 1, 1.5, 2, and 2.5
millimeter.
continuous phase fluids. Two curves are shown for each of these fluids. In each case,
the lower and upper curves correspond to no breakup and breakup, respectively, so that
the critical drop size lies somewhere between these two curves. For both fluids, the
critical breakup radius is smaller when the streamline is farther from the centerline until
about streamline y = 1.5 or y = 2.0 mm. Moreover, there is a rapid decreasing in the
critical breakup radius for streamlines less than or equal to y = 1.5, corresponding to the
downstream shear rate of γ̇ ≈ 500 1/s, while it slows down after that remaining almost the
same. Note that the critical radius agrees between the two fluids after streamline y = 1.5.
Therefore, the fluid rheology has an effect on the critical breakup radius along streamlines
close to the center line, i.e y < 1.5. This effect makes the critical breakup radius larger in
the case of Newtonian fluid where the opposite was expected since the shear rate is larger.
A possible theory that could explain the results is because the non-Newtonian fluid has
different viscosity ratios, affecting the critical breakup radius as will be discussed later. For
126
1000
800
0
-0.4 -0.2 0 0.2 0.4 0.6 0.8
Streamline Transit Time [s]
μd
example, for the non-Newtonian fluid, the viscosity ratio λ = μc ranges from λ = 0.62
along y = 0.75 mm to λ = 0.65 along y = 1.0 mm, while for the Newtonian continuous
The capillary number represents the ratio of viscous forces to interfacial forces and is
rγ̇ηc
calculated using the formula Ca = σ , where r is the radius of the droplet, γ̇ is the shear
rate of the continuous phase, ηc is the continuous phase viscosity, and σ is the interfacial
tension. The critical capillary number is a number for which the droplet breaks up if the
capillary number is greater than the critical one (Ca > Cacrit) and does not break up if
127
Figure 4.9: Mesh around the drop interface in the low-shear-rate upstream
(top) and high-shear-rate downstream (bottom) portions of the domain for
the nozzle.
the capillary number is less than the critical one (Ca < Cacrit). The general behavior seen
for the critical radius is also observed for the critical capillary number Cacrit as shown
in Figure 4.13, where the critical capillary number Cacrit is calculated using the constant
shear rate and viscosity values in the downstream channel. The critical capillary numbers
decrease with distance from the centerline before becoming approximately constant. Also,
the the critical capillary numbers for the Newtonian fluid are larger than those for the
128
Figure 4.10: Drop deformation at t = 0.01, 0.08, and 0.13 s for the nozzle.
The shear rate and drop breakup location along different streamlines for both fluids
is shown in Figure 4.14. The location is given by the x-coordinate of the center of
the elongated drop and is indicated by a circle along the streamline. The upper graph
129
Figure 4.11: Drop deformation and breakup for streamline y = 1.5 at t =
0.02, 0.42, and 0.5 s for the non-Newtonian continuous phase for the nozzle.
corresponds to the Newtonian continuous phase and the lower graph corresponds to the
indicate the contracting part of the domain (see Figure 4.1), while the vertical line at
130
0.4
Newtonian
0.2
0.1
0
0.5 1 1.5 2 2.5 3
Streamline Label Y [mm]
0.4
Newtonian
Critical Drop Radius [mm]
Non-Newtonian
0.3
0.2
0.1
0
0 200 400 600 800 1000 1200
Streamline Shear Rate in Die [1/s]
x = 7 mm indicates the end of the nozzle used in experiments. The breakup occurs near
the beginning of the downstream channel for streamlines far from the centerline y 2.25
mm, but it occurs closer to the end of the downstream channel for streamlines near the
centerline. The breakup position gives an idea on how long the nozzle should be to produce
break up along different streamlines. The simulations indicate that within the length of the
131
2.5
1.5
0.5
0
0.5 1 1.5 2 2.5 3
Streamline Label Y [mm]
Figure 4.13: Critical Capillary number as a function of the streamline
position for the Newtonian and non-Newtonian continuous phase for the
nozzle.
actual nozzle used in experiments breakup would occur only along streamlines close to the
wall y ≥ 2.25. Table 4.5 gives the breakup locations for super-critical drop sizes along
streamlines y = 1.5 and y = 2.0 for the non-Newtonian continuous phase. There appears to
be little effect of super-critical drop size on breakup location, for drop sizes relevant to this
geometry.
Grace [57] has constructed a plot of the critical capillary number as a function of the
μd
viscosity ratio λ = μc for Newtonian/Newtonian fluid systems in unbounded simple shear
flow as shown in Figure 4.15. In the graph, the droplet does not breakup if the capillary
number is under the curve and the breakup occurs when the capillary number is above the
132
1200
Y=2.7
1000 Y=2.5
Y=2.25
Y=2.0
400
200
0
-5 0 5 10 15 20 25
Axial Position x [mm]
1200
Y=2.7
1000 Y=2.5
Y=2.25
Y=2.0
Shear Rate [1/s]
800
Y=1.75
Y=1.5
600 Y=1.0
Y=0.75
400
200
0
-5 0 5 10 15 20 25
Axial Position x [mm]
curve. The droplet does not breakup if the viscosity ratio is greater than a number around 4.
Instead the large viscosity of the disperse phase relative to the continuous phase causes the
droplet to rotate. Moreover, the minimum critical capillary number is when the viscosity
ratio somewhere between about 0.6 and 1. This is because the viscosity of the disperse is
133
Table 4.5
Drops breakup location for streamlines y = 1.5 and y = 2 in the
non-Newtonian continuous phase for the nozzle.
less than the viscosity of the continuous phase which makes the deformed droplet horizontal
and aligned with the flow field. As a result, the viscosity ratio has an effect on the critical
capillary number which implies that it affects the droplet breakup radius.
To study the relation between the critical capillary number and viscosity ratio for the
are tracked along these streamlines with different viscosity ratios to get the curves. The
critical capillary number for each case is between the lower and upper curve for each case.
The shear rate used in the computation of the capillary number is the streamwise constant
shear rate in the downstream channel, namely γ̇ = 352 s−1 and 710 s−1 for streamline
y = 1.0 mm and 2.0 mm, respectively. The dashed vertical lines in the figure represent the
range of viscosity values reached for the original drop in the non-Newtonian continuous
phase fluid. The critical capillary number reaches the minimum when the viscosity ratio
134
Figure 4.15: Critical capillary number vs viscosity ratio (Grace curve).
is between 0.56 and 1 and they show a similar behavior to the Grace plot where small
changes are observed at streamline y = 2 due in part to small critical breakup radius. The
critical capillary number decreases when the viscosity ratio increases from 0.56 to 0.75
ratio has an effect on the critical capillary and radius numbers where low (λ ≤ 0.56) and
high (λ ≥ 1) viscosity ratio increase these numbers. The decrease in the critical capillary
number at streamline y = 1, helps explain why the critical drop radius (Figure 4.12) and
critical capillary number (Figure 4.13) are larger for the Newtonian continuous phase than
for the non-Newtonian continuous phase for streamlines closer to the centerline, such as
y = 1 mm, even though the shear rates are larger for the Newtonian case. Likewise, the
nearly constant value of Cacrit between λ = 0.56 and λ = 0.79 along streamline y = 2.0 mm
helps explain why there is little or no difference between the critical drop radius (Fig. 4.12)
135
and critical capillary number (Fig. 4.13) along streamlines farther from the centerline, such
as y = 2.0 mm.
3
y=1.0 mm
1.5
0.5
0
0 0.5 1 1.5 2
Viscosity Ratio λ
In summary, the droplet breakup conditions inside a spray nozzle is analyzed for a simple
emulsion. The study is achieved by the simulation of two-phase flow where the droplet is a
Newtonian fluid and the outer phase is either Newtonian or non-Newtonian. Because a large
number of drops must be tracked in order to determine breakup conditions, the simulations
were performed in two dimensions using the modified interDyMFoam solver. A first
136
step, single phase flow calculations are performed to study the mesh independence for the
outer phase fluid. Then, the two-phase flow is solved using dynamic refinement mesh
to have an accurate resolution around the interface. The simulations on a single phase
flow revealed a mesh independence after analyzing velocity and pressure on three different
meshes. The refined mesh is used as a basic mesh for the two-phase flow.
For both continuous phase fluids, there was an initial rapid decrease in critical drop size as
distance from the centerline of the nozzle increased, i.e., as the shear rates experienced by
the drop increased. Starting at approximately half-way between the centerline and the wall,
the critical drop radius became approximately constant or decreased only slightly.
By noting the location of breakup within the nozzle, it was determined that drops near
the centerline break up only for very long dies. Within the length of the nozzle used in
experiments, only drops closer to the wall broke up for the flow rate considered.
It was also found that close to the centerline of the nozzle, critical drop sizes were larger
for the Newtonian continuous phase than for the non-Newtonian continuous phase, even
though the shear rates were larger along these streamlines for the Newtonian fluid. The
explanation for this is partly due to the viscosity ratios reached in the simulations. This
was illustrated by determining critical capillary numbers for a range of viscosity ratios
along two streamlines in the Newtonian continuous phase. The resulting Cacrit -vs-λ curves
resembled the well-known Grace curve for steady simple shear flow.
From these simulations we can get general idea about the droplet breakup conditions inside
137
Chapter 5
In summary, this study focused on the dynamic meshing in a two-phase flow solver. The
3D solver has been modified to allow for dynamic meshing around fluid-fluid interfaces in
to allow for computing the deformation and breakup of drops or bubbles that are very small
relative to the mesh of the flow domain. This is necessary to avoid mass loss when tracking
To validate the modifications, the modified dynamic meshing code for two-dimensional
planar geometry was applied to two test problems: drop deformation and breakup in linear
shear flow, and drop formation and detachment from a micro T-channel. The modified
dynamic meshing code for axisymmetric geometry was applied to a bubble rising from
a pore into a static liquid. In these test problems, we studied computational time, mesh
139
independence, and mass accuracy. Comparisons were made with the two-phase flow solver
To investigate the validity of the modified code, simulation and performances have been
discussed in detail. It was found that the modified code produces accurate results with
much less CPU time in comparison to simulations without dynamic meshing. A summary
of the conclusions from the validation tests are given in Section 3.8.
The modified code was then applied to study the droplet breakup conditions inside a spray
nozzle for a single emulsion, where droplets of various sizes were tracked through the
flow field within the nozzle to determine the conditions under which they break up. The
goal was to determine the largest drop sizes for which the breakup does not occur. The
critical radius and capillary number at different streamlines with various shear rates were
found along with the breakup location for both Newtonian and non-Newtonian continuous
phase fluids. Furthermore, the effect of viscosity ratio on the critical capillary number in a
The simulations showed that the critical drop sizes decreased rapidly as distance from
the centerline increased, before becoming approximately constant. The simulations also
showed that the fluid rheology has an effect on the critical drop size at streamlines near
the centerline, however, there was no effect far from the centerline. This behavior was
attributed to the range of viscosity ratios reached in the simulations and the Grace curves
which where produced for this geometry. A summary of conclusions can be found in
Section 4.4.
140
Although the modified dynamic meshing procedure was applied to fluid-fluid interfaces in
two-phase flow problems, it can be adapted to other regions in the domain and for other
Future Work
This thesis provides a preliminary investigation into the breakup conditions of emulsion
droplets inside a spraying nozzle. The study used a nozzle with diameter 1 mm,
(0.03, 0, 0) m/s. To get more detailed information about the droplet breakup conditions
inside a spray nozzle, additional simulations are needed. The effect of different parameters
on the droplet breakup can be study in the future. Some of those parameters are:
1. Geometric parameters such as the nozzle diameter and length of the contraction
region.
An additional improvement to the code can be realized by replacing the volume of fluid
(VOF) method with the coupled level set-volume fluid method (CLSVOF). The coupled
level set-volume fluid method uses (1) the VOF method to calculate the volume fraction
function α since it is mass conservative and (2) the level set method to calculate the
141
curvature κ since it is smoother. Also, the breakup conditions can be further studied
when the droplet exits the nozzle. Finally, the breakup conditions can be investigated
using 3D simulations to get more realistic results but this will require significantly more
computational time, even when using dynamic meshing. However, the information
142
References
[1] A. Aserin, Multiple emulsions: technology and applications. Hoboken, New Jersery:
Wiley & Sons, Inc, 2007.
[8] R. Lutz, A. Aserin, L. Wicker, and N. Garti, “uble emulsions stabilized by a charged
complex of modified pectin and whey protein isolate,” Colloids and Surfaces B:
Biointerfaces, vol. 72, pp. 121–127, 2009.
143
[10] H. C. Carneiro, R. V. Tonon, C. R. Grosso, and M. D. Hubinger, “Encapsulation
efficiency and oxidative stability of flaxseed oil microencapsulated by spray drying
using different combinations of wall materials,” Journal of Food Engineering,
vol. 115, pp. 443–451, 2013.
[12] C. Tang and X. Li, “Microencapsulation properties of soy protein isolate and storage
stability of the correspondingly spray-dried emulsions,” Food Research International,
vol. 52, pp. 419–428, 2013.
[17] W. Kim, T. Yu, and W. Yoon, “Atomization characteristics of emulsified fuel oil
by instant emulsification,” Journal of Mechanical Science and Technology, vol. 26,
pp. 1781–1791, 2012.
[20] Y. Sun and C. Beckermann, “Sharp interface tracking using the phase-field equation,”
Journal of Computational Physics, vol. 220(1), pp. 626–653, 2007.
[21] J. Sethian and P. Smereka, “Level set methods for fluid interface,” Annual Review of
Fluid Mechanics, vol. 35(1), pp. 341–372, 2003.
144
[22] S. Osher and R. Fedkiw, Level Set Methods and Dynamic Implicit Surfaces. New
York: Springer-Verlag New York, Inc., 2003.
[24] W. Rider and D. Kothe, “Reconstructing volume tracking,” comput. Phys., vol. 141,
p. 112, 1998.
[25] M. J. Berger and J. Oliger, “Adaptive mesh refinement for hyperbolic partial
differential equations,” Comp. Phy., vol. 53, pp. 484–512, 1984.
[26] D. J. Mavriplis and A. D. Gosman, “Adaptive meshing techniques for viscous flow
calculations on mixed element unstructured meshes,” Int. J. Num. Meth. Fluids,
vol. 34, pp. 93–111, 2000.
[28] S. Z. Pizadeh, “An adaptive unstructured grid method by grid subdivision, local
remeshing and grid movement,” AIAA, vol. 99, p. 3255, 1999.
[30] W. J. Coirier, “An adaptively-refined, cartesian, cell-based scheme for the euler and
navier-stokes equations,” NASA Technical Memorandum, p. 106754, 1994.
[32] Q. Xue, Development of adaptive mesh refinement scheme and conjugate heat transfer
model for engine simulations. PhD thesis, Iowa State University, 2009.
[34] M. D. and M. R., Drops and bubbles in interfacial research. The Netherlands:
Elsevier, 1998.
145
[36] S. Popinet and S. Zaleski, “A front-tracking algorithm for accurate representation of
surface tension,” Int. J. Numer. Methods Fluids, vol. 30, pp. 775–793, 1999.
[37] L. X.-D., F. R.P., and K. M., “A boundary condition capturing method for
poissonâĂŹs equation on irregular domains,” Comput. Phys., vol. 160, pp. 151–178,
2000.
[38] K. M., F. R.P., and L. X.-D., “A boundary condition capturing method for multiphase
incompressible flow,” Sci. Comput., vol. 15, pp. 323–360, 2000.
[39] M. Meier, G. Yadigaroglu, and B. Smith, “A novel technique for including surface
tension in plic-vof methods,” Eur. J. Mech. B Fluids, vol. 21, pp. 61–73, 2002.
[40] M. Meier, Numerical and experimental study of large steam-air bubbles injected in a
water pool. PhD thesis, Swiss Federal Institute of Technology, 1999.
[42] H. Jasak, Error analysis and estimation in the Finite Volume method with appli-
cations to fluid flows. PhD thesis, Imperial College, University of London, 1996.
[43] J. D. Hoffman, Numerical Methods for Engineers and Scientists. New York:
McGrawHill, 1992.
[45] C. Rhie and W. Chow, “A numerical study of the turbulent Âřow past an isolated
airfoil with trailing edge separation,” in AIAA-82-0998, AIAA/ASME 3rd Joint
Thermophysics, Fluids, Plasma and Heat Transfer Conference, (St.Louis, Missouri),
1982.
[46] S. Patankar, Numerical heat transfer and fluid flow. Taylor & Francis, 1980.
[47] M. Peric, A finite volume method for the prediction of three-dimensional fluid flow in
complex ducts. PhD thesis, Imperial College London (University of London), 1985.
[50] S. M. Damián, An Extended Mixture Model for the Simultaneous Treatment of Short
and Long Scale Interfaces. PhD thesis, Universidad Nacional del Litoral, 2013.
146
[51] T. Young, “An essay on the cohesion of fluids,” Phil. Trans. R. Soc. Lond., vol. 65,
p. 95, 1805.
[52] B. Dubey, M. Duxxenneuner, C. Küchenmeister, P. Fischer, and E. Windhab,
“Influences of rheological behavior of emulsions on the spraying process,” in 24rd
Annual Conference on Liquid Atomization and Spray Systems, (Estoril, Portugal),
September 2011.
[53] B. Dubey, M. Duxenneuner, and E. Windhab, “Prilling process: an alternative for
atomization and producing solid particles of emulsions,” 23rd Annual Conference on
Liquid Atomization and Spray Systems, Brno, Czech Republic, 2010.
[54] J. Uddin, S. Decent, and M. Simmons, “The effect of surfactants on the instability of
a rotating liquid jet,” Fluid Dynammics Research, vol. 40, pp. 827–851, 2008.
[55] L. Broniarz-Press, M. Ochowiak, J. Rozanski, and S. Woziwodzki, “The atomization
of waterâĂŞoil emulsions,” Experimental Thermal and Fluid Science, vol. 33,
pp. 955–962, 2009.
[56] F. Tanner, S. Srinivasan, T. Althaus, K. Feigl, and E. Windhab, “Modeling and
validation of the crystallization process in food sprays,” 1th Triennial International
Conference on Liquid Atomization and Spray System, Vail, Colorado, USA, 2009.
[57] H. P. GRACE, “ispersion phenomena in high viscosity immiscible fluid systems
and application of static mixers as dispersion devices in such system,” Chemical
Engineering Communications, vol. 14, pp. 225–277, 1982.
[58] R. Barrett, M. Berry, T. F. Chan, J. Demmel, J. Donato, J. Dongarra, V. Eijkhout,
R. Pozo, C. Romine, and H. Van der Vorst, Templates for the solution of linear
systems: building blocks for iterative methods. No. 43, Society for Industrial and
Applied Mathematics, 1987.
[59] F. A. Morrison, Understanding Rheology. New York: Oxford University Press, Inc.,
2001.
[60] J.-D. Yu, S. Sakai, and J. A. Sethian, “A coupled level set projection method applied
to ink jet simulation,” Interface and Free Boundaries, vol. 5, p. 459, 2003.
[61] D. Wong, M. Simmons, S. Decent, E. Parau, and A. King, “Break-up dynamics and
drop size distributions created from spiralling liquid jets,” International Journal of
Multiphase Flow, vol. 30, pp. 499–520, 2004.
[62] R. B. Bird, R. C. Armstrong, and O. Hassager, Dynamics of Polymeric Liquids. New
York: John Wiley and Son Inc, 2nd ed., 1987.
[63] W. Shyy, Computational Modeling for Fluid Flow and Interfacial Transport.
Amsterdam: Elsevier, corrected ed., 1997.
147
[64] B. N. Datta, Numerical linear algebra and applications, vol. 116. Society for
Industrial and Applied Mathematics, 2010.
[65] I. Demirdžić and M. Perić, “Space conservation law in finite volume calculations
of fluid flow,” International journal for numerical methods in fluids, vol. 8, no. 9,
pp. 1037–1050, 1988.
[66] J. H. Ferziger and M. Perić, Computational methods for fluid dynamics, vol. 3.
Springer Berlin etc, 2001.
[67] L. Hogben, Handbook of linear algebra. Chapman & Hall, 2007.
[68] K. Hutter and K. Jöhnk, Continuum methods of physical modeling: continuum
mechanics, dimensional analysis, turbulence. Springer Verlag, 2004.
[69] H. Jasak, A. Jemcov, and J. Maruszewski, “Preconditioned linear solvers for large
eddy simulation,” in CFD 2007 Conference, CFD Society of Canada, 2007.
[70] H. Jasak and H. Rusche, “Dynamic mesh handling in openfoam,” in Proceeding of the
47th Aerospace Sciences Meeting Including The New Horizons Forum and Aerospace
Exposition, Orlando, Florida, 2009.
[71] H. Jasak and Z. Tuković, “Dynamic mesh handling in openfoam applied to
fluid-structure interaction simulations,” in Proceedings of the V European Conference
on Computational Fluid Dynamics (ECCOMAS CFD 2010)(Lisbon, Portugal, 14-17
June 2010), JCF Pereira AS, Pereira JMC,(Eds.).(27), 2010.
[72] C. Kleinstreuer, Biofluid dynamics: Principles and selected applications. CRC, 2006.
[73] A. Krishnamoorthy and D. Menon, “Matrix inversion using cholesky decomposition,”
arXiv preprint arXiv:1111.4144, 2011.
[74] T. Lucchini, “Running openfoam tutorials.”
[75] E. W. Merrill, “Rheology of blood,” Physiol Rev, vol. 49, no. 4, pp. 863–88, 1969.
[76] S. V. Patankar and D. B. Spalding, “A calculation procedure for heat, mass and
momentum transfer in three-dimensional parabolic flows,” International Journal of
Heat and Mass Transfer, vol. 15, no. 10, pp. 1787–1806, 1972.
[77] Y. Saad, Iterative methods for sparse linear systems. Society for Industrial and
Applied Mathematics, 2003.
[78] J. F. Steffe, Rheological methods in food process engineering. Freeman Press, 1996.
[79] M. Stranzinger, Numerical and Experimental Investigations of Newtonian and
Non-Newtonian Flow in Annular Gaps with Scraper Blades. PhD thesis, Swiss
Federal Institute of Technology (ETH), 1999.
148
[80] Y. Takeda, “Velocity profile measurement by ultrasound doppler shift method,”
International journal of heat and fluid flow, vol. 7, no. 4, pp. 313–318, 1986.
[81] L. N. Trefethen and D. Bau III, Numerical linear algebra. No. 50, Society for
Industrial and Applied Mathematics, 1997.
149
Appendix A
/*--------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open
\\ / O peration | Source CFD Toolbox
\\ / A nd | Copyright (C) 2011
\\/ M anipulation | OpenFOAM Foundation
---------------------------------------------------
License
This file is part of OpenFOAM.
151
Application
interFoam
Description
Solver for 2 incompressible, isothermal immiscible
fluids using a VOF (volume of fluid) phase-fraction
based interface capturing approach.
\*---------------------------------
#include "fvCFD.H"
#include "MULES.H"
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "interpolationTable.H"
#include "pimpleControl.H"
#include "ker.H"
// * * * * * * * * * * * * * * * *
pimpleControl pimple(mesh);
#include "initContinuityErrs.H"
#include "createFields.H"
#include "readTimeControls.H"
#include "correctPhi.H"
152
#include "CourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * *
while (runTime.run())
{
#include "readTimeControls.H"
#include "CourantNo.H"
#include "alphaCourantNo.H"
#include "setDeltaT.H"
runTime++;
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H"
while (pimple.loop())
{
#include "UEqn.H"
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();
153
Info<< "ExecutionTime = " <<
runTime.elapsedCpuTime() << " s"
<< " ClockTime = " <<
runTime.elapsedClockTime() << " s"
<< nl << endl;
}
return 0;
}
// ******************************************//
/*--------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open
\\ / | Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011
\\/ M anipulation | OpenFOAM Foundation
------------------------------------------------------
License
This file is part of OpenFOAM.
154
Application
interDyMFoam
Description
Solver for 2 incompressible, isothermal immiscible
fluids using a VOF (volume of fluid) phase-fraction
based interface capturing approach, with optional
mesh motion and mesh topology changes including
adaptive re-meshing.
\*----------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "MULES.H"
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * *//
pimpleControl pimple(mesh);
#include "correctPhi.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
155
while (runTime.run())
{
#include "readControls.H"
#include "alphaCourantNo.H"
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
scalar timeBeforeMeshUpdate =
runTime.elapsedCpuTime();
{
volVectorField Urel("Urel", U);
if (mesh.moving())
{
Urel -= fvc::reconstruct(fvc::meshPhi(U));
}
if (mesh.changing())
{
Info<< "Execution time for mesh.update() = "
<< runTime.elapsedCpuTime() -
timeBeforeMeshUpdate
<< " s" << endl;
gh = g & mesh.C();
ghf = g & mesh.Cf();
}
156
}
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H"
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();
return 0;
}
157
// ******************************** //
158
Appendix B
Modifications to interDyMFoam
In this section, if a new line is added to the code, then the initial “AB” is added to the right
of the line. If multiple consecutive lines are added, then the initial “AB....” is added to the
first line and “AB” to the last line.
159
selectRefineCandidates
(
lowerRefineLevel,
upperRefineLevel,
vFld,
refineCell
);
for (label i = 0; i < nBufferLayersR; i++) //AB ....
{
extendMarkedCells(refineCell)
} //AB
forAll(cellLabels, i)
{
label cellI = cellLabels[i];
cellMidPoint[cellI] = 1; //AB
}
(b) The empty faces and the edges on the empty faces are the only faces and
edges visible for partitioning
for (label faceI = mesh_.nInternalFaces();
faceI < mesh_.nFaces(); faceI++) //AB....
{
const label & patchID =
160
mesh_.boundaryMesh().whichPatch(faceI);
if (isA<emptyPolyPatch>(mesh_.
boundaryMesh()[patchID]))
{
isDivisibleFace[faceI] = true;
const labelList& fEdges = mesh_.faceEdges(faceI);
forAll(fEdges, i)
{
label edgeJ = fEdges[i];
isDivisibleEdge[edgeJ] = true;
}
}
} //AB
(c) Give the visible edges a number (1234 is used here)
forAll(cellMidPoint, cellI)
if (cellMidPoint[cellI] >= 0)
{
const labelList& cEdges = mesh_.cellEdges(cellI);
forAll(cEdges, i)
{
label edgeI = cEdges[i];
if
(
pointLevel_[e[0]] <= cellLevel_[cellI]
&& pointLevel_[e[1]] <= cellLevel_[cellI]
&& isDivisibleEdge[edgeI] //AB
)
{
edgeMidPoint[edgeI] = 12345;
}
161
}
}
(d) Add a point in the middle of the visible faces
forAll(faceMidPoint, faceI)
{
if (faceMidPoint[faceI] >= 0
&& isDivisibleFace[faceI]) //AB
{
const face& f = mesh_.faces()[faceI];
faceMidPoint[faceI] = meshMod.setAction
(
polyAddPoint
(
(
faceI < mesh_.nInternalFaces()
? mesh_.faceCentres()[faceI]
: bFaceMids[faceI-mesh_.nInternalFaces()]
), // point
f[0], // master point
-1, // zone for point
true // supports a cell
);
// Determine the level of the corner points
// and midpoint will be one higher.
newPointLevel(faceMidPoint[faceI])
= faceAnchorLevel[faceI]+1;
}
}
(e) The corner points
labelListList cellAnchorPoints(mesh_.nCells());
{
162
labelList nAnchorPoints(mesh_.nCells(), 0);
forAll(cellMidPoint, cellI)
{
if (cellMidPoint[cellI] >= 0)
{
cellAnchorPoints[cellI].setSize(8);
}
}
{
const cell& cFaces = mesh_.cells()[cellI];
forAll(cFaces, i)
{
label faceI = cFaces[i];
forAll(f, fp)
{
label pointI = f[fp];
if
(
isDivisibleFace[faceI] //AB
)
{
if (nAnchorPoints[cellI] == 8)
{
dumpCell(cellI);
163
FatalErrorIn
(
"hexRef82D::setRefinement(const labelList&"
", polyTopoChange&)"
<< abort(FatalError);
cellAnchorPoints[cellI][nAnchorPoints[cellI]++]
= pointI;
}
}
(f) Split the empty faces to four new faces and the other faces to two new faces
forAll(faceMidPoint, faceI)
{
if (faceMidPoint[faceI] >= 0
&& affectedFace.get(faceI))
{
// Face needs to be split and hasn’t yet been
//done in some way (affectedFace - is impossible
//since this is first change but just for
//completeness)
164
bool modifiedFace = false;
label anchorLevel = faceAnchorLevel[faceI];
if (isDivisibleFace[faceI]) //AB
{
face newFace(4);
forAll(f, fp)
{
label pointI = f[fp];
{
// point is anchor. Start collecting face.
DynamicList<label> faceVerts(4);
faceVerts.append(pointI);
walkFaceToMid
(
edgeMidPoint,
anchorLevel,
faceI,
fp,
faceVerts
);
faceVerts.append(faceMidPoint[faceI]);
walkFaceFromMid
(
edgeMidPoint,
anchorLevel,
165
faceI,
fp,
faceVerts
);
newFace.transfer(faceVerts);
getFaceNeighbours
(
cellAnchorPoints,
cellAddedCells,
faceI,
pointI, // Anchor point
own,
nei
);
if (debug)
{
if (mesh_.isInternalFace(faceI))
{
label oldOwn = mesh_.faceOwner()[faceI];
label oldNei = mesh_.faceNeighbour()[faceI];
checkInternalOrientation
(
meshMod,
oldOwn,
faceI,
mesh_.cellCentres()[oldOwn],
mesh_.cellCentres()[oldNei],
newFace
);
166
else
{
label oldOwn = mesh_.faceOwner()[faceI];
checkBoundaryOrientation
(
meshMod,
oldOwn,
faceI,
mesh_.cellCentres()[oldOwn],
mesh_.faceCentres()[faceI],
newFace
);
}
}
if (!modifiedFace)
{
modifiedFace = true;
modFace(meshMod, faceI, newFace, own, nei);
}
else
{
addFace(meshMod, faceI, newFace, own, nei);
}
}
}
}
else //AB....
{
face newFace(2);
forAll(f,fp)
{
label pointI = f[fp];
167
if (edgeMidPoint[edgeI] >=0)
{
DynamicList<label> faceVerts(4);
faceVerts.append(pointI);
walkFaceToMid
(
edgeMidPoint,
anchorLevel,
faceI,
fp,
faceVerts
);
walkFaceFromMid
(
edgeMidPoint,
anchorLevel,
faceI,
f.rcIndex(fp),
faceVerts
);
faceVerts.append(pointJ);
newFace.transfer(faceVerts);
getFaceNeighbours
(
cellAnchorPoints,
cellAddedCells,
faceI,
pointI,
own,
nei
);
168
if (debug)
{
if (mesh_.isInternalFace(faceI))
{
label oldOwn = mesh_.faceOwner()[faceI];
label oldNei = mesh_.faceNeighbour()[faceI];
checkInternalOrientation
(
meshMod,
oldOwn,
faceI,
mesh_.cellCentres()[oldOwn],
mesh_.cellCentres()[oldNei],
newFace
);
}
else
{
label oldOwn = mesh_.faceOwner()[faceI];
checkBoundaryOrientation
(
meshMod,
oldOwn,
faceI,
mesh_.cellCentres()[oldOwn],
mesh_.faceCentres()[faceI],
newFace
);
}
}
if (!modifiedFace)
{
modifiedFace = true;
169
}
else
{
addFace(meshMod, faceI, newFace, own, nei);
}
}
}
} //AB
affectedFace.unset(faceI);
}
(g) Get the anchor cell in 2D case where the corresponding vertices on the
empty faces have the same anchor cell
Foam::label Foam::hexRef82D::getAnchorCell
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const label cellI,
const label faceI,
const label pointI
) const
{
if (cellAnchorPoints[cellI].size())
{
label index = findIndex(cellAnchorPoints
[cellI], pointI);
if (index != -1)
{
if (index >= 4) //AB....
{
if (index == 4)
{
index = 8;
}
index = 8 - index;
} //AB
170
return cellAddedCells[cellI][ index];
}
// pointI is not an anchor cell.
// Maybe we are already a refined face so
// check all the face vertices.
if (index != -1)
{
if (index >= 4) //AB....
{
if (index == 4)
{
index = 8;
}
index = 8 - index;
} //AB
return cellAddedCells[cellI][index];
}
}
// Problem.
dumpCell(cellI);
Perr<< "cell:" << cellI << " anchorPoints:"
<< cellAnchorPoints[cellI] << endl;
FatalErrorIn("hexRef82D::getAnchorCell(..)")
<< "Could not find point " << pointI
<< " in the anchorPoints for cell "
<< cellI << end
<< "Does your original mesh obey the 2:1
constraint and"
<< " did you use consistentRefinement to
make your cells to refine"
<< " obey this constraint as well?"
<< abort(FatalError);
171
return -1;
}
else
{
return cellI;
}
}
(h) Add internal faces
if (faceMidFnd == midPointToFaceMids.end())
{
midPointToFaceMids.insert(edgeMidPointI,
edge(faceMidPointI, -1));
}
else
{
edge& e = faceMidFnd();
if (faceMidPointI != e[0])
{
if (e[1] == -1)
{
e[1] = faceMidPointI;
changed = true;
}
}
if (e[0] != -1 && e[1] != -1)
{
haveTwoFaceMids = true;
}
172
{
const cell& cFaces = mesh_.cells()[cellI];
forAll(cFaces, i)
{
label faceJ = cFaces[i];
if (cellMidPoint[faceJ] != faceMidPointI
{
face1 = faceJ;
}
}
if (findIndex(cellAnchorPoints[cellI],
anchorPointJ) == 0)
{
index = 4;
}
if (findIndex(cellAnchorPoints[cellI],
anchorPointJ) == 4)
{
index = 8;
}
173
const face& f = mesh_.faces()[face1];
DynamicList<label> newFaceVerts(4);
if (faceOrder == (mesh_.faceOwner()[faceI]
== cellI))
{
label anch = findIndex(f, point1);
if (pointLevel_[f[f.rcIndex(anch)]]
<= cellLevel_[cellI])
{
label edgeJ = fEdges[f.rcIndex(anch)];
edgeMidPointJ = edgeMidPoint[edgeJ];
else
{
label edgeMid = findLevel(face1, f, f.rcIn
dex(anch), false, cellLevel_[cellI] +1);
edgeMidPointJ = f[edgeMid];
} //AB
newFaceVerts.append(faceMidPointI);
insertEdgeSplit
(
edgeMidPoint,
faceMidPointI, // edge between faceMid
edgeMidPointI, // and edgeMid
174
newFaceVerts
);
newFaceVerts.append(edgeMidPointI);
insertEdgeSplit
(
edgeMidPoint,
edgeMidPointI,
edgeMidPointJ, //AB
newFaceVerts
);
newFaceVerts.append(edgeMidPointJ);
newFaceVerts.append(cellMidPoint[face1]);
else
{
label anch = findIndex(f, point1);
if (pointLevel_[f[f.fcIndex(anch)]]
<= cellLevel_[cellI])
{
label edgeJ = fEdges[anch];
edgeMidPointJ = edgeMidPoint[edgeJ];
}
else
{
label edgeMid = findLevel(face1, f, f.fcIn
dex(anch), true, cellLevel_[cellI] + 1);
edgeMidPointJ = f[edgeMid];
newFaceVerts.append(edgeMidPointJ);
insertEdgeSplit
(
175
edgeMidPoint,
edgeMidPointJ, //AB
edgeMidPointI,
newFaceVerts
);
newFaceVerts.append(edgeMidPointI);
insertEdgeSplit
(
edgeMidPoint,
edgeMidPointI,
faceMidPointI,
newFaceVerts
);
newFaceVerts.append(faceMidPointI);
newFaceVerts.append(cellMidPoint[face1]);
face newFace;
newFace.transfer(newFaceVerts);
(i) get the points that can be unrefined
Foam::labelList Foam::hexRef82D::
getSplitPoints(
const label axis, const scalar axisVal)//AB
const
{
if (debug)
checkRefinementLevels(-1, labelList(0));
if (debug)
176
{
if (!history_.active())
FatalErrorIn("hexRef82D::
getSplitPoints()")<< "Only call if
constructed with history capability"
<< abort(FatalError);
// Master cell
// -1 undetermined
177
{
const labelList& pCells =
mesh_.pointCells(pointI);
if (pCells.size()!=4||
coord[axis]>axisVal) //AB
{
splitMaster[pointI] = -2;
forAll(visibleCells, cellI)
if (visibleCells[cellI] != -1 &&
history_.parentIndex(cellI) >= 0)
label parentIndex =
history_.parentIndex(cellI);
178
// Check same master.
forAll(cPoints, i)
if (masterCellI == -1)
splitMaster[pointI] = parentIndex;
splitMasterLevel[pointI] =
cellLevel_[cellI] - 1;
else if
(masterCellI != parentIndex)
|| (splitMasterLevel[pointI] !=
cellLevel_[cellI] - 1)
179
{
splitMaster[pointI] = -2;
else
forAll(cPoints, i)
splitMaster[pointI] = -2;
After the modifications are done, run wmake libso to compile the dynamicMesh and
dynamicFvMesh libraries.
The modifications for axisymmetric geometry will be the same but by replacing
dynamicFvMesh2D with dynamicFvMeshAxi and hexRef82D with
hexRef8axi. The cells on the centerline should have special treatment as follows;
1. Split the empty faces to four new faces and the other faces to two new faces
forAll(faceMidPoint, faceI)
180
{
if (faceMidPoint[faceI] >= 0 &&
affectedFace.get(faceI))
{
const face& f = mesh_.faces()[faceI];
if (isDivisibleFace[faceI]) //AB
{
face newFace(4);
forAll(f, fp)
{
label pointI = f[fp];
DynamicList<label> faceVerts(4);
faceVerts.append(pointI);
walkFaceToMid
(
edgeMidPoint,
anchorLevel,
faceI,
fp,
faceVerts
);
faceVerts.append(faceMidPoint[faceI]);
181
walkFaceFromMid
(
edgeMidPoint,
anchorLevel,
faceI,
fp,
faceVerts
);
newFace.transfer(faceVerts);
getFaceNeighbours
(
cellAnchorPoints,
cellAddedCells,
faceI,
pointI, // Anchor point
own,
nei
);
if (debug)
{
if (mesh_.isInternalFace(faceI))
{
label oldOwn = mesh_.faceOwner()[faceI];
checkInternalOrientation
(
meshMod,
oldOwn,
faceI,
mesh_.cellCentres()[oldOwn],
mesh_.cellCentres()[oldNei],
newFace
182
);
}
else
{
label oldOwn = mesh_.faceOwner()[faceI];
checkBoundaryOrientation
(
meshMod,
oldOwn,
faceI,
mesh_.cellCentres()[oldOwn],
mesh_.faceCentres()[faceI],
newFace
);
}
}
if (!modifiedFace)
{
modifiedFace = true;
else
{
addFace(meshMod, faceI, newFace, own, nei);
}
}
}
}
else //AB....
{
face newFace(2);
forAll(f,fp)
{
label pointI = f[fp];
label nextpointI = f[f.fcIndex(fp)];
183
label edgeI = meshTools::findEdge(mesh_,
pointI, nextpointI);
if (edgeMidPoint[edgeI] >=0)
{
label pointJ = f[f.rcIndex(fp)];
label prevpointJ = f[f.rcIndex
(f.rcIndex(fp))];
label edgep = meshTools::findEdge(mesh_,
pointI, pointJ);
if (edgeMidPoint[edgep] >=0)
{
DynamicList<label> faceVerts(3);
faceVerts.append(pointI);
walkFaceToMid
(
edgeMidPoint,
anchorLevel,
faceI,
fp,
faceVerts
);
walkFaceFromMid
(
edgeMidPoint,
anchorLevel,
faceI,
fp,
faceVerts
);
newFace.transfer(faceVerts);
}
else
{
DynamicList<label> faceVerts(4);
faceVerts.append(pointI);
184
walkFaceToMid
(
edgeMidPoint,
anchorLevel,
faceI,
fp,
faceVerts
);
walkFaceFromMid
(
edgeMidPoint,
anchorLevel,
faceI,
f.rcIndex(fp),
faceVerts
);
faceVerts.append(pointJ);
newFace.transfer(faceVerts);
}
getFaceNeighbours
(
cellAnchorPoints,
cellAddedCells,
faceI,
pointI,
own,
nei
);
if (debug)
{
if (mesh_.isInternalFace(faceI))
{
label oldOwn = mesh_.faceOwner()[faceI];
185
checkInternalOrientation
(
meshMod,
oldOwn,
faceI,
mesh_.cellCentres()[oldOwn],
mesh_.cellCentres()[oldNei],
newFace
);
}
else
{
label oldOwn = mesh_.faceOwner()[faceI];
checkBoundaryOrientation
(
meshMod,
oldOwn,
faceI,
mesh_.cellCentres()[oldOwn],
mesh_.faceCentres()[faceI],
newFace
);
}
}
if (!modifiedFace)
{
modifiedFace = true;
else
{
addFace(meshMod, faceI, newFace, own, nei);
}
}
}
} //AB
186
affectedFace.unset(faceI);
}
}
forAll(cFaces, i)
{
label faceJ = cFaces[i];
if (cellMidPoint[faceJ] != faceMidPointI
{
face1 = faceJ;
}
}
if (findIndex(cellAnchorPoints[cellI],
anchorPointJ) == 0)
{
index = 4;
}
if (findIndex(cellAnchorPoints[cellI],
anchorPointJ) == 4)
{
index = 8;
}
187
label point1 = cellAnchorPoints[cellI]
[8 - index];
DynamicList<label> newFaceVerts(4);
if (faceOrder == (mesh_.faceOwner()[faceI]
== cellI))
{
label anch = findIndex(f, point1);
if (pointLevel_[f[f.rcIndex(anch)]]
<= cellLevel_[cellI])
{
label edgeJ = fEdges[f.rcIndex(anch)];
edgeMidPointJ = edgeMidPoint[edgeJ];
}
else
{
label edgeMid = findLevel(face1, f, f.rcIn
dex(anch), false, cellLevel_[cellI] +1);
edgeMidPointJ = f[edgeMid];
} //AB
newFaceVerts.append(faceMidPointI);
insertEdgeSplit
(
edgeMidPoint,
faceMidPointI, // edge between faceMid
edgeMidPointI, // and edgeMid
newFaceVerts
);
188
newFaceVerts.append(edgeMidPointI);
if (edgeMidPointI!=edgeMidPointJ)
{
insertEdgeSplit
(
edgeMidPoint,
edgeMidPointI,
edgeMidPointJ, //AB
newFaceVerts
);
newFaceVerts.append(edgeMidPointJ);
}
newFaceVerts.append(cellMidPoint[face1]);
}
else
{
label anch = findIndex(f, point1);
if (pointLevel_[f[f.fcIndex(anch)]]
<= cellLevel_[cellI])
{
label edgeJ = fEdges[anch];
edgeMidPointJ = edgeMidPoint[edgeJ];
}
else
{
label edgeMid = findLevel(face1, f, f.fcIn
dex(anch), true, cellLevel_[cellI] + 1);
if (edgeMidPointI!=edgeMidPointJ)
{
newFaceVerts.append(edgeMidPointJ);
189
insertEdgeSplit
(
edgeMidPoint,
edgeMidPointJ, //AB
edgeMidPointI,
newFaceVerts
);
}
newFaceVerts.append(edgeMidPointI);
insertEdgeSplit
(
edgeMidPoint,
edgeMidPointI,
faceMidPointI,
newFaceVerts
);
newFaceVerts.append(faceMidPointI);
newFaceVerts.append(cellMidPoint[face1]);
}
face newFace;
newFace.transfer(newFaceVerts);
190
Appendix C
nozzle
Table C.1
Critical breakup radius, capillary number, viscosity ratio, and the breakup
position in the nozzle for the non-Newtonian fluid
viscosity break up
y MaxRef drop radius(mm) ca
ratio position (mm)
0.75 3,4 0.2950-0.3300 1.224-1.37 0.623 15-23
1.00 3,4 0.1460-0.1810 0.808-1.00 0.649 20-26
1.50 5,6 0.0155-0.0408 0.129-0.34 0.686 17-20
1.75 5,6 0.0107-0.0313 0.104-0.31 0.700 12-14
2.00 5,6 0.0085-0.0170 0.094-0.19 0.709 08-10
2.25 5,6 0.0057-0.0159 0.071-0.20 0.718 07-09
2.50 5,6 0.0057-0.0159 0.079-0.22 0.725 05-07
2.70 5,6 0.0063-0.0159 0.094-0.24 0.729 05-07
191
Table C.2
Critical breakup radius, capillary number, viscosity ratio, and the breakup
position in the nozzle for the Newtonian fluid
viscosity break up
y MaxRef drop radius (mm) ca
ratio position (mm)
0.75 3,4 0.3570-0.3990 1.851-2.07 0.56 24-26
1.00 3,4 0.1876-0.1960 1.300-1.36 0.56 20-25
1.50 5,6 0.0190-0.0300 0.198-0.31 0.56 09-11
2.00 5,6 0.0083-0.0146 0.116-0.21 0.56 09-11
2.25 5,6 0.0059-0.0110 0.088-0.17 0.56 06-08
2.50 5,6 0.0033-0.0100 0.060-0.17 0.56 05-07
2.70 5,6 0.0065-0.0135 0.123-0.25 0.56 05-07
Table C.3
Critical breakup radius, capillary number, viscosity ratio, and the breakup
position in the nozzle for the Newtonian fluid at stream line y = 1
viscosity break up
y MaxRef drop radius (mm) ca
ratio position (mm)
1.00 3,4 0.3543-0.4120 2.454-2.85 0.25 12-17
1.00 3,4 0.2446-0.2811 1.694-1.95 0.4 16-22
1.00 3,4 0.1876-0.1960 1.300-1.36 0.56 20-25
1.00 3,4 0.1640-0.1875 1.136-1.30 0.725 20-25
1.00 3,4 0.1640-0.1875 1.136-1.30 1 16-22
1.00 3,4 0.3345-0.3780 2.317-2.62 2 22-25.5
192
Table C.4
Critical breakup radius, capillary number, viscosity ratio, and the breakup
position in the nozzle for the Newtonian fluid at stream line y = 2
viscosity break up
y MaxRef drop radius(mm) ca
ratio position (mm)
2.00 5,6 0.0145-0.0295 0.202-0.41 0.25 09-11
2.00 5,6 0.0083-0.0146 0.116-0.21 0.56 09-11
2.00 5,6 0.0083-0.0146 0.116-0.21 0.725 09-11
2.00 5,6 0.0083-0.0146 0.116-0.21 1 11-13
2.00 5,6 0.0141-0.0294 0.197-0.41 2 09-11
193