Twophaseintertrackfoam: An Openfoam Module For Arbitrary Lagrangian/Eulerian Interface Tracking With Surfactants and Subgrid-Scale Modeling
Twophaseintertrackfoam: An Openfoam Module For Arbitrary Lagrangian/Eulerian Interface Tracking With Surfactants and Subgrid-Scale Modeling
Moritz Schwarzmeiera , Suraj Rajua , Željko Tukovićb , Mathis Frickea , Dieter Bothea ,
arXiv:2403.19523v1 [physics.comp-ph] 28 Mar 2024
Abstract
We provide an implementation of the unstructured Finite-Volume Arbitrary Lagrangian / Eule-
rian (ALE) Interface-Tracking method for simulating incompressible, immiscible two-phase flows as
an OpenFOAM module. In addition to interface-tracking capabilities that include tracking of two
fluid phases, an implementation of a Subgrid-Scale (SGS) modeling framework for increased accu-
racy when simulating sharp boundary layers is enclosed. The SGS modeling framework simplifies
embedding subgrid-scale profiles into the unstructured Finite Volume discretization. Our design of
the SGS model library significantly simplifies adding new SGS models and applying SGS modeling
to Partial Differential Equations (PDEs) in OpenFOAM.
Keywords:
finite volume, interface tracking, ALE, unstructured mesh, subgrid-scale
PROGRAM SUMMARY
Program Title: twoPhaseInterTrackFoam
CPC Library link to program files: (to be added by Technical Editor)
Developer’s repository link: https://gitlab.com/interface-tracking/twophaseintertrackfoamrelease
Code Ocean capsule: (to be added by Technical Editor)
Licensing provisions: GPLv3
Programming language: C++
Nature of problem:
Two-phase flow problems involving surface-active agents (surfactants), variable surface tension force and
very sharp boundary layers.
Solution method:
An OpenFOAM implementation of the Arbitrary Lagrangian / Eulerian Interface Tracking method.
∗ Corresponding author
Email addresses: schwarzmeier@mma.tu-darmstadt.de (Moritz Schwarzmeier), raju@mma.tu-darmstadt.de
(Suraj Raju), zeljko.tukovic@fsb.unizg.hr (Željko Tuković), fricke@mma.tu-darmstadt.de (Mathis Fricke),
bothe@mma.tu-darmstadt.de (Dieter Bothe), maric@mma.tu-darmstadt.de (Tomislav Marić )
1. Introduction
The unstructured Finite Volume Arbitrary Lagrangian / Eulerian Interface Tracking method in
OpenFOAM (ALE-IT) [31, 29] is a highly accurate method that tracks fluid phases as deforming
solution domains separated by domain boundaries, making it possible to accurate account for
jump conditions at moving domain boundaries shared by two fluid phases, as well as to solve
Partial Differential Equations (PDEs) on moving domain boundaries. The ALE-IT method has
been successfully applied to challenging two-phase flow problems, involving, e.g., two-phase flows
with soluble surfactant [9, 10, 22] and two-phase flows with interfacial mass transfer [33, 23].
The Subgrid-Scale (SGS) modeling [1, 4, 34] employs an analytical solution to enhance the com-
putation of passive scalar transport in interfacial boundary layers, saving multiple local refinement
levels of Finite Volume mesh. This can accordingly speed up simulations, enable them in the first
place or save (computing) resources, while delivering results with high accuracy.
With this publication, we provide an open-source implementation of our ALE-IT method as an
OpenFOAM module. The version used to generate results from this manuscript is v1.0, available
in the GitLab repository [25] and archived as [30]. Results reported in this paper are archived as
[26]. The following sections cover the details of the mathematical model, equation discretization,
and subgrid-scale modeling implemented in the version 1.0 of our ALE-IT OpenFOAM module, as
well as the results for some showcases.
2. Mathematical model
Sg g Vg
nΣ
Σ(t) σ
Sl
Interface
Vl
We model isothermal flow of two immiscible incompressible fluids, schematically shown in fig. 1,
e.g. as a liquid and a gas phase separated by a sharp interface Σ(t). Appropriate boundary conditions
2
are then enforced at the fluid interface Σ(t), see [31]. We only briefly outline the model, the reader
is additionally referred to [15] for more details.
Isothermal flow of an incompressible Newtonian fluid inside an arbitrary moving control vol-
ume V bounded by a closed surface S := ∂V , i.e. S is the boundary of the finite volume, moving
with the boundary velocity vs is governed by the mass and linear momentum conservation laws:
I
ρn · v dS = 0, (1)
S
Z I I Z
∂
ρv dV + n · ρ(v − vs )v dS = n · τ dS − ∇p dV, (2)
∂t
V S S V
where n is the outward pointing unit normal on S, ρ is the fluid density, v is the fluid velocity, vs is
the velocity of surface S, and τ is the viscous stress tensor which together with the thermodynamic
pressure p′ makes the Cauchy stress tensor T = −p′ I + τ . The dynamic pressure in Eq. (2) is
defined as
p = p′ − ρg · r, (3)
where g is the gravitational acceleration vector and r is the position vector. Furthermore, the
viscous stress tensor of the Newtonian fluid is given by
vl = vg , (6)
where vl and vg are the fluid velocities at the two sides (e.g. liquid and gas) of the fluid interface.
The dynamic condition follows from the momentum conservation law and states that forces
acting on the fluid at the interface are in equilibrium:
where nΣ is the unit normal vector on the interface, which points from the liquid phase to the gas
phase, κ = −∇s •nΣ is twice the mean curvature of the interface, σ is the surface tension coefficient
3
and ∇s σ is the gradient of the surface tension coefficient, where ∇s = ∇(I − nΣ nΣ ) is the surface
gradient operator. The last term on the right-hand side of eq. (7) appears due to transformation
of the thermodynamic pressure to the dynamic pressure at the interface. The pressure jump across
the interface is obtained by taking the normal component of the force balance (eq. (7)):
The second term on the right-hand side of eq. (8) represents the jump of the normal viscous force
across the interface, expressed through the surface divergence of the interface velocity. For example,
the normal viscous force at the interface can be expressed as (see [6]):
where the following identity, being valid for an incompressible fluid flow (∇ · v = 0), is used:
By taking the tangential component of the force balance (eq. (7)) one obtains a relation between
the normal derivative of the tangential velocity on the two sides of the interface:
where it is taken into account that the tangential component of the viscous force at the interface
can be expressed as follows:
where vt = (I−nΣ nΣ )·v is the tangential velocity component and vn = nΣ ·v is the normal velocity
component at the interface. A non-zero gradient ∇s σ of the surface tension coefficient can occur
for example due to a nonuniform distribution of surfactant at the interface or due to the presence
of a temperature gradient.
where c is the volume-averaged bulk surfactant concentration and D is the bulk surfactant diffusion
concentration.
The governing equation for surfactant transport along a surface patch S attached to the fluid
interface (S ⊂ Σ(t)) and bounded by a closed curve ∂S which can move along the interface reads:
Z I I Z
∂
Γ dS + m · (v − b) Γ dL − m · (DΓ ∇s Γ) dL = sΓ dS, (14)
∂t S ∂S ∂S S
4
where Γ is the surfactant concentration at the interface, Γ∞ is the saturated surfactant concentration
under the given thermodynamic conditions, m is the outward pointing unit bi-normal on ∂S, b is
the velocity at which the curve ∂S moves along the interface, L is the arc length measured along
∂S, Ds is the diffusion coefficient of the surfactant along the interface and sΓ is the source/sink of
surfactants per unit area due to adsorption and desorption.
For the sake of simplicity, we focus in this paper on the prominent Langmuir’s kinetics law
[16, 5, 22] for the transfer of surfactant between the bulk and the interface due to adsorption and
desorption:
where βs = RTσΓ0 ∞ is the elasticity number. For the test case described in section 6.3 we added a
linear equation of state:
Γ
σ = σ 0 1 + βs . (19)
Γ∞
5
N
nf
Sf df
f
rP
z
y VP
x
Figure 2: Polyhedral control volume (cell) and the notation used (adopted from [31])
.
equation over a fixed or moving control volume/area. The discretisation procedure is divided into
two parts: discretisation of the computational domain and the equation discretisation. Here we
provide a brief description of both discretisation methods together with a description of the interface
tracking method, while more details can be found in [31, 29, 28].
The time interval is split into a finite number of time-steps ∆t and the equations are solved in
a time-marching manner. The computational space is divided into a finite number of polyhedral
control volumes (CV) or cells bounded by polygons. The cells do not overlap and fill the spatial
domain completely. Figure 2 shows a polyhedral control volume VP around the computational
point P located in its centroid, face f with area Sf , face unit normal vector nf and the centroid
N of a neighboring CV sharing the face f . The geometry of the CV is fully determined by the
position of its vertices.
In case the solution domain is changing in time, e.g., when the fluid interface deforms, the finite
volume mesh is adjusted to the time-varying position or shape of the solution domain boundaries
using a deforming mesh approach. The internal CV-vertices are moved based on the prescribed
motion of the boundary vertices, while the topology of the mesh stays unchanged. In the imple-
mented moving mesh interface tracking solver, a finite-volume automatic mesh motion solver is
applied, where the Laplace equation is solved for mesh-point displacements with variable diffusion
coefficient, using the polyhedral unstructured cell-centered FVM.
The polygonal cell-faces which coincide with the interface constitute the finite area mesh on
which the surfactant transport equation is discretised. Figure 3 shows a sample polygonal control
area SP around the computational point P located in its centroid, the edge e, the edge length Le ,
the edge unit bi-normal vector me and the centroid N of the neighbouring control area sharing the
edge e. The bi-normal me is perpendicular to the edge normal ne and to the edge vector e.
6
ne j
nP
e nN
e me
P Le
SP i de N
∂ (vP VP ) X
+ (V̇f − V̇s,f ) vf
∂t
f
X (20)
= νf [n · (∇v)]f Sf + (∇p)P VP ,
f
where the subscripts P and f represent the cell-center and face-center values. The volume flow
rate due to fluid flow through the cell-face, V̇fn+1 = (n · vS)n+1
f must satisfy the discretised mass
conservation law, where the superscript n+1 represents the new time-step, while the volume flux due
n+1
to grid motion, V̇s,f , must satisfy the discretised GCL, eq. (5). The evaluation of the mesh-face
volume fluxes is described in [11, 29].
The face-center values of all dependent variables are calculated using linear interpolation of the
neighbouring cell-center values. The exception is the face value of the dependent variable in the
convection term [vf in eq. (20)] which must be calculated using some of the bounded convection
discretisation schemes available in OpenFOAM.
The face-normal derivative of the velocity [n · ∇v]f is discretised using the linear scheme with
non-orthogonal and skewness correction (see fig. 2):
vN − vP kN · (∇v)N − kP · (∇v)P
(n · ∇v)f = + , (21)
dn,f dn,f
7
correction in eq. (21), is obtained by using the least-squares fit [7]. This method produces a second-
order accurate gradient irrespective of the mesh quality.
The temporal discretisation of all equations is performed by using the second-order accurate
implicit three time level scheme [11] referred to as the backward scheme in OpenFOAM. All terms
of eq. (20) are evaluated at the new time instance tn+1 = tn + ∆t and the temporal derivative is
discretised by using two old-time levels:
n+1
∂v 3vn+1 − 4vn + vn−1
= , (22)
∂t 2∆t
where vn+1 = v(tn + ∆t), vn = v(tn ) and vn−1 = v(tn − ∆t). One can also use other temporal
discretisation schemes available in OpenFOAM.
When eqs. (21) and (22) are substituted into eq. (20) and the convection discretisation scheme
is applied, the discretised form of the momentum eq. (2) can be written in the form of a linear
algebraic equation, which for cell P reads:
X
n+1 n+1
aP vP + aN vN = rP + (∇p)P , (23)
N
where the diagonal coefficient aP , the off-diagonal coefficients aN and the source term rP can be
found in [29].
The mathematical model of fluid flow is solved using a segregated solution procedure where
the discretised momentum equation is solved decoupled from the discretised pressure equation.
The discretised pressure Poisson equation, obtained by combining the discretised momentum and
continuity equations, reads:
X1 X
H
(n · ∇p)n+1
f Sf
n+1
= n n+1
f · S n+1 , (24)
a f a f f
f f
where the (1/a)f and (H/a)f terms are calculated by using the temporally consistent Rhie-Chow
interpolation procedure proposed in [29].
The face normal derivative of the pressure at the left hand side of eq. (24) is discretised using
eq. (21) applied on the pressure field. The absolute volume fluid flux V̇fn+1 through the cell face f
is calculated as follows:
" #
H 1
V̇fn+1 = nfn+1 · − (∇p)n+1
f Sfn+1 . (25)
a f a f
Volume flux calculated in this manner will satisfy the discretised continuity equation if the pressure
field satisfies the pressure eq. (24).
∂ (ΓP SP ) X X
+ (m · v)e Le Γe = DΓ,e (m · ∇s Γ)e Le + (sΓ )P SP , (26)
∂t e e
8
nN
ne
nP
te N
e tN
tP
′
tN
lf ≡ P t′e
t′P
Slf
Figure 4: Edge-based local orthogonal coordinate system whose axis are aligned with the orthogonal unit vectors n,
t and t′ , where vector t is tangential to the geodetic line P eN
where the subscripts P and e represent the face-center and edge-center values, and it is assumed
that finite-area points move in normal direction which means that (m · b)e = 0.
The edge-center tangential velocity vt is calculated using following linear interpolation formula:
where ex is the interpolation factor which is calculated as the ratio of the geodetic distances eN
and P eN (see fig. 3):
eN
ex = , (28)
P eN
and TP , TN and Te are the tensors of transformation from the global Cartesian coordinate system
to the (t′e , te , ne ) edge-based local coordinate system defined in fig. 3. The convection term in
eq. (26) is discretised using the linear upwind discretisation scheme by taking into account geodetic
distances between the neighbouring control area centers. The diffusion term is discretised using the
central differencing scheme with non-orthogonal correction [14]:
ψN − ψP
(m · ∇s ψ)e = |∆e | + ke · (∇s ψ)e , (29)
LP N ´¹¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¸ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¶
´¹¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¸¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¶ Non-orthogonal correction
Orthogonal contribution
where ke = me − ∆e , ∆e = tet·m e
e
, LP N is the geodetic distance LeP and te is the unit tangential
vector to the geodetic line P eN at the point e (see fig. 4).
9
nf
Phase g
gf
lf
Phase l
Coupling of flow equations between fluid phases is performed by applying adequate boundary
conditions at the boundary faces which define the side l and g of the interface. At the side l the
pressure pl and normal velocity derivative (n · ∇v)l are specified, while at the side g the velocity vg
is specified and normal derivative of dynamic pressure is set to zero, (n · ∇p)g = 0. The boundary
conditions are calculated using the kinematic and dynamic conditions as follows:
1. The value of dynamic pressure specified on the face lf (see fig. 5) is calculated from the
dynamic pressure at the face gf using eq. (8) as follows:
plf = pgf − (ρl − ρg ) g · rlf
(30)
− (σκ)lf − 2 (ηl − ηg ) (∇s · v)lf ,
where pgf is the dynamic pressure at the face gf calculated by extrapolation from the fluid g,
and rlf is the position vector of the face center lf . The surface divergence of the velocity vec-
tor (∇s · v)lf at lf is calculated using the surface Gauss integral theorem [32]. The procedure
for calculating the surface force (σκ)lf is described later in this section.
2. The normal velocity derivative specified at lf is calculated from the normal velocity gradient
at gf using eq. (11), as follows:
ηg h i
(n · ∇v)lf = (I − nlf nlf ) · nlf · (∇v)gf
ηl
1
+ (∇s σ)lf − nlf (∇s · v)lf (31)
ηl
(ηg − ηl )
+ (∇s vn )lf ,
ηl
where nlf = −ngf is the unit normal of the face lf . Equation (31) is derived using the
identity n · ∇v + n (∇s · v) = (I − nn) · (n · ∇v). The surface gradient of the normal velocity
component (∇s vn )lf at lf is calculated using the surface Gauss integral theorem. Calculating
the tangential surface force (∇s σ)lf is described later in this section.
3. According to the kinematic condition (6), the tangential velocity component specified on gf
is transferred from lf :
(vt )gf = (vt )lf . (32)
The normal velocity component specified on gf is calculated from the condition of zero net
mass flux, (V̇gf − V̇gf ) = 0, i.e.
V̇gf
(vn )gf = − nlf , (33)
Sgf
10
where V̇gf is the volume flux of the face gf . Since the displacement of mesh points on the
side g is equal to the displacement on the side l of the interface, ugi = ułi , the same is valid
for the volume fluxes of the faces lf and gf :
fli nli
flc nlf
li lc
lf
interface points
control points
The specification of interface boundary conditions using the above procedure is done at the
beginning of each outer iteration. In general, at the end of an outer iteration, the net volume flux
through the boundary side l is different from zero, i.e.
where V̇lfp is the fluid volume flux through the face lf and (V̇s )plf is the cell-face volume flux through
the same face, both obtained in the previous outer iteration. In order to correct the net volume
flux, the interface points must be moved to accomplish the following volume flux corrections:
The displacement of the interface points is calculated based on the procedure proposed by [21],
where a control point lc is attached to the each face lf at the side l of the interface as is shown in
fig. 6. The corrected position of the interface points is calculated using the following procedure:
1. Calculate the volume δVlf′ which face lf sweeps on the way from the current to the corrected
position in order to cancel the net mass flux:
2 ′
δVlf′ = V̇ ∆t, (37)
3 lf
where V̇lf′ is the volume flux correction for face lf , eq. (36).
2. Using the above, the displacement of control points in the direction flc is:
δVlf′
h′lc = p p , (38)
Slf nlf · flc
11
p p
where Slf and nlf are the area and unit normal of the face lf in the previous iteration and flc
is the control point displacement direction. The new corrected positions of the control points
are calculated according to the following expression:
rnlc = rplc + h′lc flc , (39)
where rplc
is the position vector of the control point lc before the correction.
3. The new position of the interface mesh point li is obtained by projection to the plane which
is laid over the corresponding control points using the least square method.
where σe and me are the surface tension and bi-normal unit vector at the center of the edge e and
Le is the length of the edge e. If the total surface tension force for each control area in the mesh is
calculated using eq. (40), then the total surface tension force for a closed surface will be exactly zero
if the unit bi-normals me for two control areas sharing the edge e are parallel and have opposite
direction.
ni
nlf
ne
i
lf
nj ê
e me
Slf Le
j
It remains to decompose the surface tension force Fσlf into the tangential component (∇s σ)lf
used in eq. (31), and the normal component (κσ)lf nlf used in eq. (30). Using the surface Gauss
integral theorem, the surface tension force acting on the control area Slf can be expressed by the
following equation: Z Z
Fσlf = ∇s σ dS + κσn dS. (41)
Slf Slf
12
When the right hand side of eq. (41) is approximated by the mid-point role and the result of the
discretisation is equalised with the right hand side of eq. (40), the following expression is obtained:
1 X
(∇s σ)lf + (κσ)lf nlf = σe me Le . (42)
Slf e
Hence, the tangential component of the surface tension force acting on the control area Slf is equal
to the tangential component of the right hand side of eq. (42):
1 X
(∇s σ)lf = (I − nlf nlf ) · σe me Le (43)
Slf e
If the surface tension coefficient is constant (σ = const.), eq. (43) will give a tangential component
of the surface tension force equal to zero if the normal unit vector of the control area Slf satisfies
the following equation:
1 X
κlf nlf = me Le (45)
Slf e
or, if κlf , 0: P
me Le
e
nlf = P . (46)
| me Le |
e
With eqs. (43) to (45) we shall formulate a procedure for the calculation of the surface tension
force which ensures that the total surface tension force on a closed surface will be exactly zero.
Unfortunately, the fulfilment of this condition is not sufficient for successful application of surface
tension forces in the calculation. Specifically, unphysical fluid flow near the interface arises due to
local (rather than global) inaccuracy in the calculation of surface tension forces.
From eq. (40) one can see that the accuracy of surface tension force calculation depends on
the accuracy of calculation of the bi-normal unit vector me which is calculated using the following
expression:
ni + nj
me = ê × , (47)
2
where ê is the unit vector parallel with edge e and ni and nj are the interface normal unit vectors
in points i and j (see fig. 7). Using eqs. (45) and (47) one obtains the exact value of curvature of
the control area Slf if the points of the control area lie on the surface of the sphere.
13
2. Define the displacement directions for the interface mesh points and the control points;
3. Start of outer iteration loop:
(a) Update pressure and velocity boundary conditions at the interface;
(b) Assemble and solve the discretised momentum equation eq. (20) on the mesh with the
current shape of the interface. The pressure field, face mass fluxes and volume fluxes are
used from the previous (outer) iteration;
(c) The velocity field obtained in the previous step is used for the assembly of the discretised
pressure eq. (24). After the pressure equation is solved, new absolute mass fluxes through
the cell faces are calculated. The net mass flux through an interface is generally different
from zero;
(d) In order to compensate the net mass flux obtained in the previous step, the interface
displacement is calculated using the interface points displacement procedure defined in
the previous section;
(e) The interface points displacement is used as a boundary condition for the solution of
the mesh motion problem. After mesh displacement, the new face volume fluxes are
calculated using the current points positions and the position from the previous time
instance;
(f) Convergence is checked and if the residual levels and the net mass flux through the
interface do not satisfy the prescribed accuracy, the procedure is returned to step (a).
4. If the final time instance is not reached, return to step 1.
4. Subgrid-Scale Model
4.1. Motivation
The simulation of realistic gas-liquid systems is still a huge challenge, e.g. when one would like
to simulate an industrial scale bubble column reactor. The nature of this application is multi-scale.
One of the smallest scales occurring is that of concentration boundary layers of the rising bubbles
at realistic, i.e. high, Schmidt numbers. With conventional FV-methods these scales have to be
resolved, what is still unfeasible for an application as the one mentioned above. This motivated the
first paper to discuss SGS modeling [1]. In SGS modeling, an analytical function is used to describe
the profile of a scalar field inside its boundary layer and to use this SGS information for improved
flux computation.
The method has been developed further since and has been applied in the context of Volume of
Fluid [34, 13, 4] as well as in interface tracking frameworks [22, 23, 33]. An overview on the state of
subgrid-scale modeling was also given by [35]. Recently, the approach was taken up in [12], where
local curvature and tangential convection effects have been included.
14
Figure 8: The simplified model for species transfer across a bubble surface. [34] adapted from [4]
The velocity in the substitute model problem is parallel to the interface. No velocity gradient
normal to the boundary exists in the model problem (∂v/∂x = 0). There could be a non-zero
gradient in the boundary-parallel direction, in which case the boundary layer thickness δ in eq. (49)
would change accordingly. There is no velocity component normal to the boundary.
In the application within ALE-IT, the boundary geometry and the velocity field have to be
resolved. In a co-moving reference frame, the interface neighbouring cell’s velocity should be nearly
parallel to the interface and with the assumption of zero interface-normal velocity gradient the next
cells velocity should be nearly identical to it. When a thin scalar boundary layer exists, the SGS
can model the scalar fluxes normal to the boundary without resolving the scalar boundary layer
itself.
Further assumptions of the substitute problem are a given, constant value (e.g. zero concen-
tration) upstream (y < 0) of the domain and far away from the boundary (x → ∞) as well as
negligible diffusion in streamwise direction. We also assume quasi-steadiness and the transported
scalar being passively transported.
Applying these assumptions to the advection-diffusion eq. (13) with the sorption term
sΣ + [[j · nΣ ]] = 0 on Σ(t) and Fick’s law j = −D∇c and ν being the boundary-parallel velocity,
lead to the expression
∂c ∂2c
ν =D 2 for x > 0 and y > 0 (48)
∂y ∂x
with the boundary conditions
The boundary layer thickness δ is considered a free parameter, which in IT will be fitted for each
interface attached cell individually as described in section 4.3.2. The fitting selects the locally best
approximation from the family of given error-functions in eq. (49).
15
From the analytical solution for the fitted parameter, we can approximate a more accurate
boundary-normal gradient of the scalar concentration at the interface as well as at the first cell
faces normal to the boundary, xf in fig. 9. These gradients are used to scale the convective and
diffusive scalar fluxes in the Finite Volume discretization, keeping the discretization of convective
and diffusive operators implicit. Scaling is only applied in interface normal direction and described
in detail in sections 4.3.3 and 4.3.4.
Without the SGS, the maximally second-order unstructured Finite Volume convective and dif-
fusive fluxes are underestimated at the interface and overestimated at the first cell faces normal to
the boundary. Figure 9 visualizes the linear gradient calculation in red and the actual gradients at
the interface and the first cell faces normal to the boundary with the dashed blue lines.
Figure 9: The concentration profile and linear/corrected gradient next to a boundary. Adapted from [34].
Note that in the algorithm the concentration in the first cell is not altered by the SGS. Instead the
gradients are used to scale the diffusivities at the respective locations, as described in sections 4.3.3
and 4.3.4.
Details of the SGS model can be found in [4, 34, 23]. It has been applied to VoF by [34], where
the implementation becomes more complicated.
4.3. Algorithm
4.3.1. Equation discretization in finite volume solvers
The species transport eq. (13) is discretised using the unstructured Finite Volume Method, e.g.
using the backward scheme as described above for Navier-Stokes equations,
3cn+1
P VP
n+1
− 4cnP VPn + cn−1 VPn−1 X X
P
+ Φf cn+1
f = Df (∇c)n+1
f · Sf , (50)
∆t
f f
where VP is a control volume/cell, Φf = S f · (v − w)f is the face flux and the superscripts
n+1 n
, and n−1 symbolize the new, current and preceding timestep. The formula is written for a
constant time step size. The subscript P and f represent the value at the cell centers, respectively
the face centers.
16
For the SGS model to take effect in the computation, we will modify the diffusivity coefficient
and the face fluxes in the equation above.
with
c(x, y) − c|Σ
η(x, y) = = erf(x/δ(y)). (52)
c∞ − c|Σ
Using the derivative of ηSGS with respect to δ, as described in [23], we use a Newton-bisection
method until eq. (51) is fulfilled within a given tolerance. For details like the initial value and the
algorithm in detail the reader is referred to the previously cited article.
For both, the advective and diffusive flux, the same idea is utilized: the scaling of the fluxes
according to the boundary layer thickness and therefore the theoretical values given by the SGS.
F D = −D · S · ∂n c. (53)
In the following, we will use the superscript SGS to indicate the value is obtained from or modified
by the SGS model. The SGS model solves the analytical model for the actual surface normal
gradient of c, which will be (∂n c)SGS . However, to stay implicit and increase numerical stability,
the diffusion coefficient is scaled. Therefore, we state that the flux must be equal if computed with
the actual gradient or a scaled diffusion coefficient, meaning
!
F D = −D · S · (∂n c)SGS = DSGS · S · ∂n c (54a)
where DSGS is a scaled diffusivity value that leads to the same flux, as a calculation with (∂n c)SGS
would. This scaling is applied to the cell faces at the boundary as well as on the first cell faces normal
to the boundary. For both respective locations the diffusivity parameter needs to be modified at
the corresponding position, xΣ and xf in fig. 9. There are exceptions, when the correction is not
employed, the details of this can be found in [23].
17
4.3.4. Computation of advective fluxes
In similar manner to the diffusion, the advective flux is given by
where Ffc is the volumetric flux of the concentration c at the face f , and Ff := vf · Sf is the
volumetric flux. Since no convection of the species normal to the interface can take place, the scaling
for advective fluxes is only applied to the first cell faces normal to the boundary. Equation (55)
analogously to our procedure for the diffusive flux, leads to
cSGS
ΦSGS = Φ. (56)
c
Again, an exception handling takes places, of which the details can be found in [23].
5. Software design
18
baseSubGridScaleModel
+ declareRunTimeSelectionTable()
+ baseSubGridScaleModel()
+ ~baseSubGridScaleModel()
+ update()
+ writeDebugData()
+ scaledFlux()
+ scaledDiffCoeff()
subGridScaleModel newSubGridScaleModel
+ subGridScaleModel() + newSubGridScaleModel()
+ ~subGridScaleModel() + ~newSubGridScaleModel()
+ scaledFlux() + ...()
+ scaledDiffCoeff()
+ calcPatchFaceLabels()
+ calcAdjacentCellLabels()
+ ...()
Figure 10: Class diagram of the Subgrid-Scale model, also showing a potential new model
19
An exemplified code for the modification of the PDE in an OpenFOAM solver for applying an
SGS model from our model library is shown in listing 1:
Listing 1: A minimal example of the application of the SGS model to a PDE solver in OpenFOAM.
# include " b a s e S u b G r i d S c a l e M o d e l . H "
int main ( int argc , char * argv [])
{
...
20
Listing 2: transportProperties sub-dictionary for the SGS model
SGS
{
// Choose the SGS model : " SubGridScale " or " inactive "
type SubGridScale ;
21
Figure 11: Upstream CI pipeline
Another feature of the CI pipeline is the addition of a test, that checks the OpenFOAM log-files
for warnings and errors, where tutorials added to the repository are automatically detected and run
for a single timestep. This almost ensures, that there are no errors in the set-up of test cases and
would also uncover some of errors in the code, that can only be detected, when OpenFOAM is run.
The automatisation of this test in finding and running all simulation cases is especially valuable.
Since running all of the simulations for only one timestep needs a very limited amount of time it
can be checked, that changes in the code don’t corrupt any case before commiting and pushing to
the central repository. The automated finding of cases also prevents forgetting to add a simulation
case to the CI (to this testing method) and the automated execution and error finding gently forces
all participants of the repository to set up their cases to run flawlessly and fully automatised, e.g.
they need to include everything needed to run a case in the Allrun script. This ensures all the cases
provided with the code can be run without debugging.
Another topic not covered in the previously mentioned references is that for repetitive tasks, like
reading dictionary entries, reading files or calculating error norms needed for the evaluation a set
of python functions is provided. This set of functions is also tested automatically with the testing
framework pytest as part of the CI pipeline and precedes the more computationally expensive
OpenFOAM-specific jobs, as can be seen in fig. 11.
6. Results
22
boundary layer or velocity gradient. Initially and in the inflow, the concentration is set to zero, the
length of the plate is 0.005 m and the fluid velocity is 0.1 m/s. The timestep of 0.0002 s is used for
a physical duration of 0.1 s, which is double the time the fluid needs to be transported through the
domain. Figure 13 visualizes the setting.
Figure 13: Set-up of the flat plate test. Figure taken from [23].
With the possibilities described in section 5.1, it can be verified that fundamental parts of the
algorithm as described in section 4.3 are implemented correctly, like the boundary layer thickness δ
and the diffusion correction. Beneficially, there is an analytical solution to this model for compar-
ison. For these reasons the test enables insights into the capabilities of the SGS model and the
implementation thereof. This simple test case does circumvent most of the error-handling and also
convective flux correction must not have an effect on the outcome.
In fig. 14 the local Sherwood numbers of a parameter study along the boundary surface are
displayed. The parameter study has four levels of mesh refinement, where the cell size halves
between each execution from 40 µm to 5 µm, four different diffusivity levels spanning four orders of
magnitude from 5 × 10−8 m2 /s to 5 × 10−11 m2 /s and every of these setups is run with and without
active SGS model. Taking the length of the plate as reference length L, the Peclet number is within
the interval [104 , 107 ].
It is apparent, how without the SGS model, the Sherwood number cannot be computed in cases
with a boundary layer that is small in comparison to the cell size, i.e. when the cell size is big and
the diffusivity is small. In contrast to the linear interpolation with the SGS model the Sherwood
number is captured reasonably well in all cases. Note in fig. 14, that at some locations the Sherwood
number with the application of the SGS model is actually smaller than without it.
23
Figure 14: Results for the parameter study over of the flat plate test case
24
and initial concentration is set to 0 mol/m3 and the interface is set to have a constant concentration
of 1 mol/m3 . The simulated physical duration is 0.6 s and the results shown here represent the final
state.
To see the best results with the SGS, it is important to set the interpolation schemes to
limitedLinear phi 1.0 for the concentration c and to linear for the interpolation of the scaled
diffusion coefficient as well as for the flux of U in the fvSchemes-file.
We run a parameter study consisting of four different diffusivities from
1 × 10−8 m2 /s to 1 × 10−11 m2 /s, four different mesh resolutions with the meshing parame-
ter N = [62, 124, 248, 496] as the number of faces along the half-circled interface. Every study is
run with and without employing the SGS and with a constant timestep of 0.0002 s. The bubble
diameter of 2 mm serves as reference length for the Sherwood number. It can be observed from
fig. 15 that without deploying the SGS, the local Sherwood number is almost constant and except
for the rear part of the bubble too low in case of small diffusivities and coarse meshes. When the
mesh resolution is fine and the diffusivity is high, the boundary layer is not as thin (in comparison
to the mesh cell size), and therefore the results of linear modeling and SGS modeling are similar.
In fig. 16 the diffusion coefficient after scaling with the SGS is displayed. In the cell layer
adjacent to the interface, the diffusion coefficient at the interface is visible, whilst in the next outer
cell layer the scaled diffusion coefficient at the faces between interface-adjacent cells and that same
cell is visualized. The third row of cells represents the uncorrected diffusion coefficient for reference.
The biggest correction is applied in the front part of the bubble, where the flow impinges
onto the interface and the boundary layer is very thin, therefore the derivative in surface normal
direction of the concentration is very big. In the rear part of the bubble the boundary layer has
grown and the main direction of the flow is no longer parallel to the surface, making the surface
concentration gradient in interface-normal direction much smaller and reasonable good represented
by linear interpolation. Therefore less correction is needed. To understand what is happening, we
would like to point the reader to fig. 9 again.
T 2 R ∂σ ∂T
vb,YBG = , (57)
λi µi µo ∂T ∂z
2+ 2+3
λo µo
where R is the radius of the bubble, T is the fluid temperature, σ is the surface tension coefficient,
µi is the dynamic viscosity of the internal fluid, µo is the dynamic viscosity of the outside fluid and
λ is the thermal conductivity of the fluid.
In the case the Marangoni convection is caused by a specified fixed gradient of surfactant con-
centration along the interface, the bubble migration velocity can be expressed based on eq. (57) as
follows, see [20]:
Γ 2 R ∂σ ∂Γ
vb,YBG = , (58)
µi µo ∂Γ ∂z
3 2+3
µo
where Γ is the concentration of surfactants at the interface.
25
Figure 15: Local Sherwodd numbers of a parameter study for Schmidt-numbers from 1 × 104 to 1 × 107
Figure 16: Visualization of corrected diffusion coefficients for the coarsest mesh with a diffusivity of 1 × 10−9 m2 /s
26
ρ, kg/m3 µ, Pas σ, N/m
Air 1.8 × 10−5 1.2 0.02
Oil 955 0.191 0.02
where ϕi,f is the volume flow rate of the fluid through the face f at the interface, Si,f is the area
vector of the face f at the interface and k is the unit direction vector of bubble motion. The bubble
velocity calculated using eq. (61) based on simulation results amounts to vb = 0.001 325 m/s, while
Γ
the corresponding analytical (eq. (58)) gives the migration velocity as vb,YBG = 0.001 329 5 m/s.
The velocity field inside and around the bubble along the plane y = 0 is shown in fig. 17.
27
Figure 17: Velocity field inside and around the bubble along the plane y = 0 for the bubble marangoni migration
case.
28
follows the test done by [3, 2]. We prescribe the initial concentration distribution and the velocity.
For the evaluation we compute one rotation, what equals one second with our prescribed velocity
referring to an angular velocity ω = 1/s.
The initial distribution is given by
cos θ + 1
Γ(θ, τ = 0) = Γ0 , (62)
2
where Γ is the surface concentration, τ is the time, θ is the angle and Γ0 is the maximum initial
concentration. After a time τ the expected distribution from an analytical approach is given by
e−DI τ cos(θ − ωτ ) + 1
Γ(θ, τ ) = Γ0 , (63)
2
where DI is the diffusion in interface tangential direction.
0.8
0.6
0.4
0.2 N: 10
Concentration
N: 20
N: 30
0.0 reference solution for Diffusivity: 0
2 N: 10
N: 20
N: 30
reference solution for Diffusivity: 0.1
For proper evaluation a mesh refinement study with a parameter variation of the diffusivity is
conducted. The results are visualized in fig. 18. We use a meshing parameter N = [10, 20, 30],
which correspond to 40, 80 and 160 surface cells along the interface. The timestep is set to 0.0005 s
regardless of the mesh size. The surface diffusivity is varied between 0 m2 /s and 0.1 m2 /s.
Visually it is hard to see a difference between the discretizations in fig. 18. In fig. 19 the error
norms and their rate of convergence are shown. The infinity norm and L1-norm are close to 1
29
Error norms Rate of convergence
1.5
1.4
Rate of convergence
10 10 1.3 L1, Diffusivity: 0
L2, Diffusivity: 0
L_inf, Diffusivity: 0
Error
and the L2-norm is around 1.5 for the resolutions analyzed. With the low error norms and their
respective rate of convergence we deduct, that our framework is well able to handle transport along
an interface.
cos θ + 1 r2
Γ(θ, r(τ )) = Γ0 0 2 , (64)
2 r(τ )
p
where r(τ ) = 3 3V0 (τ + τ0 ), where τ0 = 1/3s and r is the radius, respectively r0 is the initial
radius.
Figure 20 shows, how the species concentration per area at the interface has decreased after
2.5 s of bubble growth. The concentration precisely matches the expected result for all mesh res-
olutions tested. We conclude, that our framework is fit to simulate phenomena involving surface
expansion/shrinking.
7. Conclusions
30
1e 8 Surface concentration at time 2.5 [s]
2.5 N=40
N=60
N=80
reference solution from N=80
1.5
1.0
0.5
0.0
0 20 40 60 80 100 120 140 160 180
Position on interface [°]
Figure 20: Surface concentration after 0.5 s for different mesh resolutions
output parameters for in-depth analysis. The SGS model’s ability to accurately capture thin bound-
ary layers and steep gradients was demonstrated, alongside the critical need for flux correction not
only at the interfaces but also across adjacent cell boundaries. Furthermore, the Interface Tracking
module’s proficiency in accurately simulating surfactants on moving fluid interfaces interfaces and
their impact on surface tension and Marangoni flow was demonstrated.
8. Acknowledgments
Moritz Schwarzmeier and Tomislav Marić would like to thank the Federal Government and the
Heads of Government of the Länder, as well as the Joint Science Conference (GWK), for their
funding and support within the framework of the NFDI4Ing consortium. Funded by the German
Research Foundation (DFG) - project number 442146713.
Funded by the German Research Foundation (DFG) – Project-ID 265191195 – SFB 1194.
Part of this work was funded by the Hessian Ministry of Higher Education, Research, Science
and the Arts - cluster project Clean Circles.
References
[1] A. Alke, D. Bothe, M. Kröger, B. Weigand, Dominik Weirich, and H. Weking. Direct numerical
simulation of high schmidt number mass transfer from air bubbles rising in liquids using the
volume-of-fluid-method. Ercoftac Bulletin, 82:5–10, 2010.
[2] T. Antritter, T. Josyula, T. Marić, D. Bothe, P. Hachmann, B. Buck, T. Gambaryan-Roisman,
and P. Stephan. A two-field formulation for surfactant transport within the algebraic volume
of fluid method. Computers & Fluids, page 106231, March 2024. ISSN 0045-7930. doi:
10.1016/j.compfluid.2024.106231.
[3] Thomas Antritter. Numerical Simulation of Coupled Wetting and Transport Phenomena
in Inkjet Printing. PhD thesis, Technische Universität Darmstadt, Darmstadt, 2022. doi:
10.26083/tuprints-00021326.
31
[4] Dieter Bothe and Stefan Fleckenstein. A volume-of-fluid-based method for mass transfer pro-
cesses at fluid particles. Chemical Engineering Science, 101:283–302, 2013. ISSN 0009-2509.
doi: 10.1016/j.ces.2013.05.029.
[5] H. Brenner. Interfacial Transport Processes and Rheology. Butterworth-Heinemann series in
chemical engineering. Elsevier Science, 2013. ISBN 9781483292274.
[6] K. P. Chen, W. Saric, and H. A. Stone. On the deviatoric normal stress on a slip surface.
Physics of fluids A, 12(12):3280–3281, 2000.
[7] I. Demirdžić and S. Muzaferija. Numerical method for coupled fluid flow, heat transfer and
stress analysis using unstructured moving meshes with cells of arbitrary topology. Computer
methods in applied mechanics and engineering, 125:235–255, 1995.
[8] I. Demirdžić and M. Perić. Space conservation law in finite volume calculations of fluid flow.
International journal for numerical methods in fluids, 8:1037–1050, 1988.
[9] Kathrin Dieter-Kissling, Mohsen Karbaschi, Holger Marschaldenl, Aliyar Javadi, Reinhard
Miller, and Dieter Bothe. On the applicability of drop profile analysis tensiometry at high
flow rates using an interface tracking method. Colloids and Surfaces A: Physicochemical and
Engineering Aspects, 441:837–845, 2014. doi: 10.1016/j.colsurfa.2012.10.047.
[10] Kathrin Dieter-Kissling, Holger Marschall, and Dieter Bothe. Direct numerical simulation of
droplet formation processes under the influence of soluble surfactant mixtures. Computers &
Fluids, 113:93–105, 2015. doi: 10.1016/j.compfluid.2015.01.017.
[11] J. H. Ferziger and M. Perić. Computational methods for fluid dynamics. Springer Verlag,
Berlin-New York, 1995.
[12] Mathis Grosso, Guillaume Bois, and Adrien Toutant. Thermal boundary layer modelling
for heat flux prediction of bubbles at saturation: A priori analysis based on fully-resolved
simulations. International Journal of Heat and Mass Transfer, 222:124980, May 2024. ISSN
00179310. doi: 10.1016/j.ijheatmasstransfer.2023.124980.
[13] Dirk Gründing, Stefan Fleckenstein, and Dieter Bothe. A subgrid-scale model for reactive con-
centration boundary layers for 3D mass transfer simulations with deformable fluid interfaces.
International Journal of Heat and Mass Transfer, 101:476–487, October 2016. ISSN 0017-9310.
doi: 10.1016/j.ijheatmasstransfer.2016.04.119.
[14] H. Jasak. Error analysis and estimation for finite volume method with applications to fluid
flows. PhD thesis, Imperial College, University of London, 1996.
[15] John C. Slattery, Leonard Sagis, and Eun-Suok Oh. Interfacial Transport Phenomena. Springer
US, Boston, MA, 2007. ISBN 978-0-387-38438-2. doi: 10.1007/978-0-387-38442-9.
[16] Peter A. Kralchevsky, Krassimir D. Danov, and Nikolai D. Denkov. Chemical Physics of Colloid
Systems and Interfaces. In K. S. Birdi, editor, Handbook of Surface and Colloid Chemistry,
page 208. CRC Press, New York, second expanded and updated edition edition, 2002. ISBN
978-0-429-12509-6.
32
[17] Tomislav Marić, Jens Höpken, and Kyle G. Mooney. The OpenFOAM technology primer.
March 2021. doi: 10.5281/zenodo.4630596. Version OpenFOAM-v2012.1.
[18] Tomislav Marić, Dennis Gläser, Jan-Patrick Lehr, Ioannis Papagiannidis, Benjamin Lambie,
Christian Bischof, and Dieter Bothe. A Research Software Engineering Workflow for Compu-
tational Science and Engineering. August 2022. doi: 10.48550/arXiv.2208.07460.
[19] Tomislav Marić, Dennis Gläser, Jan-Patrick Lehr, Ioannis Papagiannidis, Benjamin Lambie,
Christian Bischof, and Dieter Bothe. A pragmatic workflow for research software engineering
in computational science. 2023. doi: 10.48550/ARXIV.2310.00960.
[20] Metin Muradoglu and Gretar Tryggvason. A front-tracking method for computation of in-
terfacial flows with soluble surfactants. Journal of Computational Physics, 227(4):2238–2262,
February 2008. doi: 10.1016/j.jcp.2007.10.003.
[21] S. Muzaferija and M. Perić. Computation of free-surface flows using the finite-volume method
and moving grids. Numerical heat transfer, Part B, 32:369–384, 1997.
[22] Chiara Pesci, Holger Marschall, Talmira Kairaliyeva, Vamseekrishna Ulaganathan, Reinhard
Miller, and Dieter Bothe. Experimental and Computational Analysis of Fluid Interfaces Influ-
enced by Soluble Surfactant. In Dieter Bothe and Arnold Reusken, editors, Transport Processes
at Fluidic Interfaces, pages 395–444. Springer International Publishing, Cham, 2017. ISBN
978-3-319-56602-3. doi: 10.1007/978-3-319-56602-3 15.
[23] Chiara Pesci, Andre Weiner, Holger Marschall, and Dieter Bothe. Computational analysis of
single rising bubbles influenced by soluble surfactant. Journal of Fluid Mechanics, 856:709–763,
2018. ISSN 0022-1120, 1469-7645. doi: 10.1017/jfm.2018.723.
[24] R. Satapathy and W. Smith. The motion of single immiscible drops through a liquid.
Journal of Fluid Mechanics, 10(4):561, 1961. ISSN 0022-1120, 1469-7645. doi: 10.1017/
S0022112061000366.
[27] P. D. Thomas and C. K. Lombard. Geometric conservation law and its application to flow
computations on movining grids. AIAA Journal, 17:1030–1037, 1979.
[28] Željko Tuković and Hrvoje Jasak. Simulation of free-rising bubble with soluble surfactant using
moving mesh finite volume/area method. In Proceedings of 6th International Conference on
CFD in Oil & Gas, Metallurgical and Process Industries, no. CFD08-072, 2008.
[29] Željko Tuković, Milovan Perić, and Hrvoje Jasak. Consistent second-order time-accurate
non-iterative PISO-algorithm. Computers & Fluids, 166:78–85, April 2018. doi: 10.1016/j.
compfluid.2018.01.041.
33
[30] Zeljko Tuković, Moritz Schwarzmeier, Suraj Raju, and Tomislav Marić. twophaseintertrack-
foam - code, 2024-03-24. doi: 10.48328/tudatalib-1395.
[31] Željko Tuković and Hrvoje Jasak. A moving mesh finite volume interface tracking method for
surface tension dominated interfacial fluid flow. Computers & Fluids, 55:70–84, February 2012.
doi: 10.1016/j.compfluid.2011.11.003.
[34] Andre Weiner and Dieter Bothe. Advanced subgrid-scale modeling for convection-dominated
species transport at fluid interfaces with application to mass transfer from rising bubbles.
Journal of Computational Physics, 347:261–289, 2017. ISSN 00219991. doi: 10.1016/j.jcp.
2017.06.040.
[35] Andre Weiner, Dirk Gründing, and Dieter Bothe. Computing Mass Transfer at Deformable
Bubbles for High Schmidt Numbers. Chemie Ingenieur Technik, 93(1-2):81–90, 2021. ISSN
1522-2640. doi: 10.1002/cite.202000214.
[36] N. O. Young, J. S. Goldstein, and M. J. Block. The motion of bubbles in a verti-
cal temperature gradient. Journal of Fluid Mechanics, 6(03):350, October 1959. doi:
10.1017/s0022112059000684.
34