0% found this document useful (0 votes)
72 views

Free Surface Handling PDF

1. The document discusses numerical methods for simulating free surfaces in fluid flow, using surface waves as an example problem. It describes modeling the free surface as either a moving boundary or a fluid-fluid interface. 2. Common surface capturing and surface tracking methods are outlined, including the volume of fluid, level set, particle tracking, and mesh deformation approaches. 3. The level set method represents the interface as the zero level set of a smooth level set function, allowing complicated shapes and topological changes to be represented.

Uploaded by

Anonymous dDTRvV
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views

Free Surface Handling PDF

1. The document discusses numerical methods for simulating free surfaces in fluid flow, using surface waves as an example problem. It describes modeling the free surface as either a moving boundary or a fluid-fluid interface. 2. Common surface capturing and surface tracking methods are outlined, including the volume of fluid, level set, particle tracking, and mesh deformation approaches. 3. The level set method represents the interface as the zero level set of a smooth level set function, allowing complicated shapes and topological changes to be represented.

Uploaded by

Anonymous dDTRvV
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Free surface handling in FVM - MEK4470/MEK9470

Tormod Landet and Johanna Ridder

October 2014

These lecture notes give an overview over what we discussed in class. They are meant to serve as an
introduction to the topic, and are hence not very rigorous. Please excuse spelling errors and handmade
figures.

1 Physics

We will look at a common example for a flow with a free surface, water waves. In addition to the
velocity and pressure field in the water, and maybe in the air, we want to calculate how the free surface
evolves with time. This problem can be approached in two ways: One can set the compuational domain
to the volume covered by water so that the free surface becomes a moving boundary. A disadvantage
of this approach is that the boundary conditions must be imposed at an unknown position. Another
option is to view the problem as a multi phase flow problem. Then the free surface becomes the
interface between the two phases air and water and the boundaries remain fixed.

Figure 1: Our example physics: surface gravity waves on the ocean

If we assume that the fluids are incompressible, viscous, Newtonian, and immiscible (non-mixable),
then the governing equations in each subdomain, as usual, the continuity equation and the Navier-
Stokes equations. At the surface, we need to impose boundary or jump conditions (depending on the
perspective) for the velocity and the pressure.
For the velocity, one can derive that it must be continuous across the surface. To see this, note first
that if the normal velocity of the water at the interface was larger than the normal velocity of the
interface itself, this would imply a mass flux across the surface. Physically, this can be interpreted
as phase change, which is important, for example, when modelling boiling water or cavitation on a
ship propeller (low pressure causes gas bubbles to appear and then disappear with a burst that may
damage the propeller). However, we will assume that no phase change occurs and hence the normal
velocity is continuous across the surface. Second, because we assume the fluids to be viscous, friction
at the interface implies that also the tangential velocity must be continuous, in the same manner as
at a no-slip boundary.
The pressure must satisfy a dynamic surface condition, which is derived from a force balance. The

1
normal stresses and the surface tension should cancel, leading to

σκn = (T1 − T2 ) · n ,

where σ is the surface tension coefficient, κ is the curvature of the surface, n is the unit normal vector
(pointing out of the water), and T1 and T2 are the stress tensors of water and air, given by

Ti = −pi I + µi (∇u + (∇u)T ) .

The surface tension only becomes important if the curvature is of about the same order as the water
depth or larger, therefore it is negligible in our example. Note also that taking µ1 = µ2 = 0 would
yield the surface pressure condition p1 = p2 for inviscous flow.
If one views the problem as a two-phase flow, the Navier-Stokes equations need to be solved in both
subdomains. Since the domain of the water and the air do not overlap, one can instead solve the
equations for an imaginary fluid that fills the whole domain and changes its viscosity and density
abruptly at the interface. Then, the governing equations will be
du 1 1
+ (u · ∇)u = ∇ · µ(∇u + (∇u)T ) − p + f , and ∇ · u = 0 ,
dt ρ ρ
where (
ρ(x) = ρ2 + (ρ1 − ρ2 )H(x) , 1, if x ∈ Ωwater ,
and H(x) =
µ(x) = µ2 + (µ1 − µ2 )H(x) , 0, if x ∈ Ωair .

2
2 Overview over available methods

The below table shows the most common methods for handling the free surface in a computer code.
Only the Eulerian methods will be discussed in depth. The symbol χ in the Lagrangian methods
refer to the coordinate of the paricle or mesh node. The symbol C/ φ is the colour function/distance
function which will be discussed further below.

Surface Capturing Surface Tracking


DC ∂C ∂χ
Eulerian: Dt = ∂t + u · ∇C = 0 Lagrangian: ∂t = u(χ)

Volume Of Fluid Level Set Particle tracking Mesh deformation


(VOF)

Heavyside function Distance function Only vertical movem. All nodes follow u
C = 1 in water φ > 0 in water ⇒ height function ⇒ Pure Lagrangian
C = 0 in air φ = 0 on FS
φ < 0 in air Internal nodes follow
surface nodes
⇒ ALE (Arbitrary
Lagrangian Eulerian)

The easiest method is the height function approach on a regular grid. From the fact that h(x, t)−z = 0
on the surface and that the surface moves with the fluid velocity, one can derive the kinematic boundary
condition

(∂/∂t + u · ∇)(h(x, t) − z) = 0 , i.e.,


∂h ∂h ∂h
+u +v − w = 0.
∂t ∂x ∂y
This equation is coupled with the Navier-Stokes equations. In each time step, new values of the height
function at the grid points are calculated, which then can be used to impose the correct boundary
conditions for the Navier-Stokes solver. The problem with the height function method is that it cannot
deal with overturning waves, since these would result in multivalued functions.
Moving grid methods use grid points that follow the deformation of the surface so that boundary
conditions can be applied more accurately. An example is the ALE (Arbitrary Lagrangian Eulerian)
method, where the grid points on the surface follow the fluid velocity (Lagrangian), the grid points
on the bottom are fixed (Eulerian) and the grid points inbetween move such that the grid becomes as
regular as possible (“arbitrary” velocity). Also these methods are not suitable for overturning waves.

3
Figure 2: ALE mesh — the nodes move with the free surface, linearly interpolated to 0 movement at the bottom

The first type of methods that was developed to compute more general waves were the “particle
methods”. These can be divided into interface tracking and volume tracking methods. Both use a
large number of massless particles which is distributed on the interface or within the fluid volume
and then convected with the fluid velocity by solving a simple ODE for each particle. This is a
Lagrangian approach, i.e., the frame of reference moves with the particles. From time to time, it
might be necessary to redistribute the particles to ensure that the interface or fluid volume is evenly
covered. In case of the interface tracking methods, complicated waves can make this redistribution
process difficult. Especially changes in the topology (e.g., a drop seperating into two), which require
a new parametrization of the interface, are difficult to compute without manual adjustments. The
volume tracking particle methods can handle such situations better, but are computationally more
costly, since a larger number of particles must be tracked.

Figure 3: Particle tracking method

The Eulerian methods use a fixed grid and a function that is defined on the whole domain to capture
the position of the interface, instead of tracking it directly. The most prominent examples for such
methods are the VOF (Volume of Fluid) method and the Level Set method. The VOF method uses
the Heaviside function, which is 1 on the subdomain covered by water and 0 in the air, which is called
“color function” in this context. On each grid cell, the integral of the color function is approximated,
which corresponds to the fraction of the cell that is covered by water. The level set method uses
instead an implicit representation of the interface through functions with zero level set equal to the

4
interface. The value of such a “level set function” is approximated at each grid point and the interface
can be constructed from these by interpolation. Since the interface is moving with the fluid velocity,
both the color function and the level set function need to satisfy the standard transport equation.

Figure 4: VOF with SLIC method

Figure 5: Level Set method

5
3 Level set

The basic idea of the level set method is to describe the interface between the two phases, in our case
water and air, implicitly in terms of a level set function φ that is negative in one phase, positive in
the other, and zero on the interface, i.e., the interface is the zero level set of φ. This description of the
boundary has the advantage that complicated shapes and topological changes like merging or pinching
can be represented by the level set of smooth level set functions, see, e.g., Figure 6.

Figure 6: Interface seperation represented by a smooth implicit function

A common choice for φ is the signed distance function, given by


(
−d(x, ∂Ω) if x ∈ Ωair ,
φ(x) = where d(x, ∂Ω) = min |x − xs | .
d(x, ∂Ω) if x ∈ Ωwater , xs ∈∂Ω

The signed distance function has the property that it satisfies |∇φ| = 1 (the Eikonal equation) almost
everywhere in the domain (except for points that have the same distance to more than one point on
the boundary), which is useful also because it simplifies the formulas for the local unit normal to
n = ∇φ and for the curvature to κ = ∆φ. Moreover, the fact that it has neither very steep nor flat
gradients, reduces errors and oscillations when applying numerical methods.
To recover the interface from the function values of φ at the grid points, one can interpolate φ and
then calculate the zero level set of the interpolant. This will result in a sharp interface, which is an
advantage of the level set method over the VOF method, which, as we will see below, needs more
sophisticated methods to reconstruct a sharp interface from the approximated discrete values. Also
other information that depends on the shape of the interface can be obtained relatively easily. This
becomes important, for example, when taking into account surface tension, which depends on the
curvature of the interface.
To calculate the evolution of the interface over time, one applies standard, preferably higher order,
finite volume methods to

φt + u · ∇φ = 0 , (1)

where u is the velocity of the water and the air at the interface. This equation is solved wherever φ
is defined, i.e., generally on the whole domain, or in case of local level set methods, within a band
about the interface. In order to apply a numerical scheme, the velocity u must be known throughout
the computational domain. One straight-forward option is to use the real velocity of the fluids within
the subdomains. However, here only the velocity on the interface itself is important and unnessecary
variations in normal direction can lead to inaccuracies in the numerical scheme. Hence, another option
is to use an artificial velocity which corresponds to the velocity at the nearest point on the interface.

6
Depending on the flow field, the level set function can become strongly distorted. Since very steep
or flat gradients of φ can render the numerical methods less accurate, one needs to adjust the level
set function in such situations. This can be done, for example, by setting φ back to a signed distance
function. Computationally, this requires calculating the interface and then calulating all distances
at the grid points, which can be expensive. Methods like the “fast marching methods” optimize the
updating procedure. Local level set methods reduce the cost of the reinitialization step by calculating
only values on the grid points close to the interface and instead reinitialize more often.
A serious problem when applying level set methods to fluid mechanics is that they do not conserve
mass. Even if a conservative scheme is used to discretize the transport equation for the level set
function, only the integral over the distances within each subdomain is conserved, not the volume.
The reinitialization step can lead to additional errors. Therefore, several adaptions of the level set
method have been suggested. One can, for example, couple it with a volume conserving method like the
particle volume tracking methods or the VOF method. More specifically, one can distribute massless
particles near the interface and then convect them with the fluid velocity just like in the classical
particle methods. When a particle crosses the interface that is computed by the level set method,
mass loss is detected and the level set function adapted correspondingly. Many other variants of the
level set method exist, see for example the books [1] and [2].

7
4 Volume of Fluid (VOF)

We can try to solve the transport equation for the colour function, DC Dt = 0, with a normal finite
volume discretization scheme. It will do something like this close to the interface:

Figure 7: Example of numerical problems related to the sharp jump in the colour function

Here the low order schemes cause the surface to become overly diffusive while the higher order schemes
causes the colour function C to take on unphysical values. Overall mass conservation can be kept, but
some cells may get negative amounts of water or more water that the cell volume allows.

4.1 Geometrical reconstruction

We may use pure geometrical means to flux the surface. As an example, consider the fact that a cell
in 1D must fully fill up before the next cell can get any fluid:

Figure 8: Geometric reconstruction in 1D

In 2D and 3D there are two popular choices:


• SLIC: Simple Line Interface Calculation
• PLIC: Piecewise Linear Interface Construction
In the SLIC method the direction of the surface normal is established first, typically based on the
value of the colour function in the neighbouring cells. There are 4 options for the configuration in 2D
if we round the normal direction to the closest 90 degrees on a rectangle cell:

Figure 9: SLIC configurations with a four face cell

8
If we take the normal direction into account when we advect the colour function field C then we can
avoid numerical diffusion in many cases, since we can avoid fluxing through faces that are not wetted.

Figure 10: Example of 2D flux of C using SLIC. Figures a and b shows the real position of the interface in two
subsequent time steps. The gray fields in figures c and d are two possible discretisations of the figure a. The
green fields in figures c and d shows the volumes that will be fluxed right between the two time steps. Figure
d will cause numerical difusion, a ”drop” wil break away from the surface.

In the SLIC method the free surface will be staircased, this is the price we pay for simplicity. The
more advanced PLIC method identifies the most wetted corner. For a quadrilateral element we can
identify four cases for each corner, examplified for the lower right corner here:

We can then flux based on the surface angle and a bit of trigonometry (this can get a bit messy in 3D
with irregular meshes as you can imagine):

Example of 2D flux of C using PLIC. The dark area is the volume that will be advected.

The geometrical reconstruction methods are not perfect. First of all the surface is not really staircased
or piecewice linear. It is also a problem to advect in multiple directions at once. With a regular grid
this can be solved by advecting and reconstructing twice, one time in each coordinate direction, the
so called direction split scheme. With unstructured meshes this is harder. Typical problems are lack
of mass conservation, numerical diffusion and drops that tear free from the surface.

9
4.2 Algebraic reconstruction

Geometrical reconstruction becomes difficult on unstructured meshes and especially in 3D. Ensuring
mass conservation and obtaining a smooth interface may be hard. The geometrical schemes must also
be explicit which causes small time steps and slow simulations.
If instead we can solve an equation for the C-field just like for the velocity and pressure then it becomes
much easier to implement, but we need a special compressive scheme to make sure the interface stays
sharp. The following schemes are most used:
• HRIC: High Resolution Interface Capturing
• CICSAM: Compressive Interface Capturing Scheme for Arbitrary Meshes
• MULES: MUlti-dimensionsal Limiter for Explicit Solution
The MULES algorithm is badly documented in literature and will not be described here. It is only
used in OpenFOAM as far as the authors are aware. CICSAM and HRIC are similar algorithms and
better documentation of these can be found in litterature. See for example the comparison paper:
Waclawcyk and Koronowicz, 2008, Comparison of CICSAM and HRIC high-resolution schemes
for interface capturing, Theoretical and Applied Mechanics, Warsaw, http://www.ptmts.org.
pl/Waclaw-Koron-2-08.pdf
Both CICSAM and HRIC uses a combination of the first order upwind differencing scheme (UDS) and
the first order downwind differencing scheme (DDS). UDS is diffusive and smears the interface, but
is unconditionally stable. DDS is compressive, but unstable. Both the CICSAM and HRIC schemes
uses a normalised variable diagram for the value of the colour function at centre of the cell, CP , and
the colour function at the downwind face, Cf , to decide the blending factor between UDS and DDS
to use on each face.

Normalised variable diagram used to select the blending of UDS and DDS in CICSAM/HRIC.
The line C̃P = C̃f corresponds to UDS, while C̃f = 1 corresponds to DDS.

The normalization used in the diagram is C̃ = (C − CD )/(CD − CU ). The yellow line is HRIC for
the case where the interface aligns with the flow direction. In general the DDS will tend to align the
interface with the gridlines. This is not wanted, so the blendning between UDS and DDS used in
CICSAM and HRIC is dependent on the interface angle.
Common for all the algebraic reconstruction schemes is that there is some smearing of the interface,
but typically not more than 2–3 cells. For many applications this is good enough to get realistic results
and good agreements with model tests and analytical solutions.
It should be noted that the MULES algorithm in OpenFOAM was explicit until recently (with strict
requirements to keep the CFL number well below 1.0). In version 2.3.0 a semi-implicit version of
MULES was introduced which allows for significantly larger time steps making OpenFOAM competi-
tive in terms of CPU usage. For some types of free surface flow problems it now performs approximately
as good as typical commercial programs. This semi implicit mode must be turned on to be active, see
the release notes for version 2.3.0 for details.

10
4.3 What methods are used in practice?

It may be interesting to know what the most common CFD programs use in practice for interface
capturing. The major comercial codes support a wealth of specialized models (like special particles
for thin films on walls), but they also support VOF and many of the schemes mentioned above. Some
example programs are:
• OpenFOAM: uses MULES by default, but both CICSAM and HRIC have been implemented
by various people, but not in the main source code repository. The OpenFOAM extend project
has a CICSAM implementation.
• Fluent: implements CICSAM in an explicit scheme and a modified HRIC in an implict scheme.
Also implements geometrical reconstruction.
• Ansys CFX: implements CICSAM in an explicit scheme and a modified HRIC in both implicit
and explicit schemes. Also implements geometrical reconstruction.
• Star CCM+: uses HRIC

Selecting a scheme

As an example the Fluent version 6.3 Users’s Guide gives some guidance in selecting a scheme (Choos-
ing a VOF Formulation, http://aerojet.engr.ucdavis.edu/fluenthelp/html/ug/node935.htm):
• jet breakup — Use the explicit scheme (time-dependent with the geometric reconstruction scheme
or the donor-acceptor) if problems occur with the geometric reconstruction scheme.
• shape of the liquid interface in a centrifuge – Use the time-dependent with the implicit interpo-
lation scheme.
• flow around a ship’s hull – Use the steady-state with the implicit interpolation scheme.
The implicit scheme in Fluent is HRIC. For ocean waves it is normally recommended to use an implicit
algebraic scheme and not PLIC or similar. It is also possible to test other schemes, some people have
made a geometric reconstruction using splines for example.

11
5 Some common problems in one-fluid formulations

The Eulerian methods described above are typically one-fluid methods. We only solve one set of
Navier-Stokes equations per cell. The density and viscosity of water and air are weighted with the
colour function. There also exists other methods where in each cell two Navier-Stokes equations are
solved, one for each fluid. We will then need some interaction equations. This is called an Euler-Euler
type method.
In a normal one-fluid formulation a typical challenge can be that a half-full cell will have a density
that is halfway between water and air and a viscosity that is also halfway between. Since the viscosity
of water is much less than that of air it can introduce artefacts related to the half-full cells where a
medium high viscosity is coupled to a medium high density. This can cause more viscous effects in
the free surface than what is actually present.
Any scheme that discretises across the free surface will have issues related to the fact that high
velocities in the air due to the low density can increase the velocities in the water due to coupling of
the velocities accross the interface in the numerical scheme. Idealy no differentiation should happen
across the interface and the density of all components should be considered when the components are
taken into the discretised equations. In reality there will be errors made here in most programs.
Some topics, such as wave generation by wind, requires good handling of the physics and momentum
transfer in the free surface region. Good results can be had if the wetted fraction of each face is taken
into account in the discretisation. An example can be found in:
Wen, 2013, Wet/dry areas method for interfacial (free surface) flow, Numerical Methods in Fluids,
http://onlinelibrary.wiley.com/doi/10.1002/fld.3661/abstract

12
Appendix: Domain decomposition

This topic is not directly related to free surface capturing/tracking, but more on challenges caused by
having gravity waves in a finite numerical domain.
If we want to study a ship in a storm we need a huge domain to avoid reflected waves from the
boundaries. With a sufficiently large wave damping zone, a so called numerical beach, we can limit
the size of the domain, but still it will be large since we have to damp the waves all the way to flat
water before the outlet to avoid reflections.

One way coupling

If we try to damp only the disturbances caused by the presence of the ship and not the incoming waves
themselves we can have a much smaller domain and damping zone. This is a domain decomposition
approach with one way coupling.
We assume that we have a fast way to calculate the undisturbed wave field variables and we use
this near the inlet and outlet. This could be a potential theory solver or analytical expressions from
linearised wave theories for example. If we define a local distance ξ as 1 at the end of the coupling
zone close to the ship and 0 at the near the inlet/outlet we can define a weighting factor:

exp(ξ β ) − 1
χ(ξ) = 1 − (2)
exp(1) − 1

Weighting factor for a 2D domain by Paulsen et al. 2014

This choice of weighting function comes from the following paper where they use β = 3.5.
Paulsen, Bredmose, Bingham, 2014, An efficient domain decomposition strategy for wave loads
on surface piercing circular cylinders, Coastal Engineering, http://www.sciencedirect.com/
science/article/pii/S0378383914000155
Now we can weight our calculated variables inside the FVM solver time loop:

T u = χuouter + (1 − χ)uFVM (3)

The solver for the finite volume method, FVM, runs in the inner domain and the fast undisturbed
wave solver runs in the outer domain. Since the disturbances can be much smaller than the incoming
waves themselves this method can be much faster since the FVM domain can be quite small.

Two way coupling

Two way coupling can for example done by coupling the pressure in Navier-Stokes directly to the
velocity potential in a potential flow solver. This is done without a weighting factor zone and is quite
a bit more involved, but can very useful for cases where it is hard to predict the main wave field
without knowing what goes on in the inner domain.

13
References

[1] S. Osher, R. Fedkiw, Level Set Methods and Dynamic Implicit Surfaces. Springer, 2003.
[2] J.A. Sethian, Level Set Methods and Fast Marching Methods. Cambridge University Press, 1999.

14

You might also like