Maki Slides

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Ship Resistance Simulations with OpenFOAM

Kevin Maki

University of Michigan
Ann Arbor, MI USA

6th OpenFOAM Workshop


13 - 16 June 2011
The Pennsylvania State University
State College, PA, USA

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 1 / 22


Introduction

simulate flow around ship moving steadily in calm water


high Reynolds number 106 model scale, 109 full scale
longest wave is 2πF 2 L
in deep water the Kelvin angle is approximately 19 deg
seek primarily the force on the body, also position of body

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 2 / 22


Outline

1 Introduction

2 Governing Equations
Volume of Fluid
Momentum and Continuity Equations

3 Numerics
interFoam solver

4 Solution Settings

5 Wigley Hull Tutorial

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 3 / 22


Interface tracking versus interface capturing

OpenFOAM has both interface


capturing and interface
tracking solvers
most ship hydrodynamics
solvers use interface
capturing, volume-of-fluid,
level set, or a combination, to
solve ship hydrodynamics
problems.
Can a ship move (at model or
full scale) and not generate a
breaking wave?

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 4 / 22


Volume of Fluid
use scalar indicator function to represent
the phase of the fluid in each cell (was γ
in versions ≤ 1.5, is α in versions ≥ 1.6).

α = α(x, t) (1)
µ(x, t) = µwater α + µair (1 − α) (2)
ρ(x, t) = ρwater α + ρair (1 − α) (3)

The density and viscosity are material


properties of the fluids.


= 0 (4)
Dt
∂α
+ u · ∇α = 0 (5)
∂t
∂α
+ ∇ · uα = 0 (6)
∂t
Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 5 / 22
Volume-of-fluid with compression
the α function transitions from 1 to 0 over an infinitesimal
thickness. This leads to difficulty in approximating the gradient of
α, and results in smearing of the interface.
One remedy, is to use a modified governing equation. The
modification should return solutions of the original equation for the
time evolution of the interface, but help by keeping the interface
crisp.
∂α
+ ∇ · uα + ∇ · wα = 0
∂t
u is the physical velocity field, and w is an artificial velocity field
that is directed normal to and towards the interface.
∂α
+ ∇ · uα + ∇ · w(α(1 − α)) = 0
∂t
the user can specify the relative magnitude of the artificial velocity
(using cAlpha)
Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 6 / 22
Momentum, dynamic pressure
Full Reynolds-averaged momentum equations for the velocity U
and pressure P in a fluid with density ρ and dynamic viscosity µ

∂ρU h i
+ ∇ · UU = −∇P + ρg + ∇ · (µ + µt )(∇U + ∇U> )
∂t
Express the pressure in terms of a hydrostatic component, and
the remainder or that due to dynamic or non-zero velocity p

P= ρg · x + p
| {z } |{z}
hydrostatic dynamic

Governing equation in terms of dynamic pressure

∂ρU h i
+ ∇ · UU = −∇p − g · x∇ρ + ∇ · (µ + µt )(∇U + ∇U> )
∂t

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 7 / 22


Momentum, viscous stress

See Henrik Rusche’s Thesis, pg 156


h i
∇ · µeff (∇U + ∇U> ) = ∇ · (µeff ∇U) + ∇ · (µeff ∇U> )
= ∇ · (µeff ∇U) + ∇U · ∇µeff + µeff ∇(∇ · U)
= ∇ · (µeff ∇U) + ∇U · ∇µeff

Final form of the momentum equation:

∂ρU
+ ∇ · UU = −∇p − g · x∇ρ + ∇ · (µeff ∇U) + ∇U · ∇µeff
∂t
Note, ∇ρ is zero away from the interface, and VERY large along
the interface.

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 8 / 22


Boundary conditions
Body

U = 0
∂p/∂n = 0
∂α/∂n = 0

Inlet

U = U∞
Centerplane: ∂p/∂n = 0
symmetryPlane 
1 if z < 0
Top α =
0 otherwise
∂U/∂n = 0 Outlet
p = 0
∂U/∂n = 0
α = 0
p = 0
∂α/∂n = 0
Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 9 / 22
simulation.

interFoam
VOF for interface capturing
PISO for pressure velocity coupling
unknowns: z
p_rgh p dynamic pressure
y
p P total pressure (P = p + ρg · x)
Space domain
alpha1 α volume
x fraction
U U velocity vector
phi Sf · Uf velocity flux
rhoPhi Sf · ρf Uf mass flux ∆t t

gh g · xP hydrostaticTime pressure
domain over density at cell center
ghf g · xf Figurehydrostatic
2.1: Discretisationpressure
of the solution over
domain density at face center

P Sf

d N

Maki (UofM) Figure 2.2: Parameters


Training in finite
Session: Ship volume discretisation 6th OpenFOAM Workshop
Resistance 10 / 22
interFoam algorithm

1 solve transport equation for volume fraction


2 generate linear systems for momentum components U, V , W ,
using convection and viscous terms only
3 (optional) solve for momentum components using old values of
pressure gradient and density gradient
4 form the pressure Poisson equation, and solve (may loop over this
for non-orthogonal correction update)
5 update velocity with pressure gradient
6 update face flux with pressure contribution
7 update turbulence quantities

PISO loop over steps 4-6.

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 11 / 22


Momentum prediction
Total momentum equation:

∂ρU
+ ∇ · UU = −∇p − g · x∇ρ + ∇ · (µeff ∇U) + ∇U · ∇µeff
∂t
in prediction, form linear systems using convection and viscous terms
only:

∂ρU
+ ∇ · UU − ∇ · (µeff ∇U) − ∇U · ∇µeff = 0
∂t

[A]U {U} = {bU }
[A]V {V } = {bV }
[A]W {W } = {bW }

if you “solve” for momentum prediction:


−1
{U} = [A]U · [{bU } − ∇p · i − g · x∇ρ · i]

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 12 / 22


Pressure correction
start with semi-discrete momentum equation

[A]U {U} = [{bU } − ∇p · i − g · x∇ρ · i]


look at equation for a single cell
X
a P UP + aN UN = bP − ∇p − g · x∇ρ

calculate the velocity without ∇ρ and ∇p


X
U?P = aP−1 (bP − aN UN )

interpolation of gradients is bad! (Rhie-Chow). Face flux using starred


velocity
φ? = U?f · Sf
now the flux with the density gradient:

∂ρ −1
φ0 = φ? − g · xf a |Sf |
∂n P,f

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 13 / 22


Pressure correction, cont.
use the continuity equation to find pressure that makes the velocity
discretely divergence free.
X X
∇·U= Uf · Sf = φ=0

φ0 will not satisfy continuity because it is a numerical approximation, and


it does not contain the pressure gradient term. Return to the momentum
equation for a single cell, and note the use of the starred velocity.

UP = U? − aP−1 ∇p − aP−1 g · x∇ρ


insert into continuity X
∇ · aP−1 ∇p = φ0
after solving for p, then update the face flux and velocity
−1
φ = φ? − ∇ · aP,f ∇pf
U = U? − g · xf − ∇p

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 14 / 22


Time-step size

Courant number in simple terms:

∆t
Co = U
∆x
For arbitrary polyhedral finite volume:

U · Sf
Co = ∆t
d · Sf

d is the vector from pole center to neighbor center


if we solve implicit equations, what is an acceptable time step size
based on the Courant number?

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 15 / 22


PISO-settings
momentumPredictor: relatively small additional expense →
recommended
nCorrectors: this is to loop over pressure system, also known as
PISO loops. For strict time accuracy, minimum of 2. Calm-water
resistance, 1 should do.
nNonOrthogonalCorrectors: due to small time step, and use of
nCorrectors, this may be set to 0 in most cases. Perhaps for initial
time steps on bad grids a few may help.
nAlphaCorr: loop over α equation. For time-dependent flows 1-2. For
steady flow like calm-water resistance, 0.
nAlphaSubCycles: this reduces the time-step size for the explicit
integration of the α transport equation. As you increase the time-step
size for the total system of equations, and if you need time accuracy
(maybe retain stability), increase the number of sub-cycles according.
cAlpha: the compression term in the advection of α is scaled by this
parameter. Set to zero to deactivate compression. Set to 1 as a nominal
value.

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 16 / 22


Discretization Settings

time: Euler, Courant number restriction leads to small time steps, first
order accuracy is fine for calm-water resistance.
gradient: linear
divergence: upwind to aid in convergence. vanLeer is second-order
away from extrema. limitedLinearV may be less diffusive than
vanLeer
Laplacian: Gauss linear corrected. Second-order, with correction
for non-orthogonal part.

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 17 / 22


Wigley Hull Experiments

Well used test data. Body fixed and free to sink and trim. SRI
0.08 < F < 0.40
2 × 106 < R < 1 × 107

Item Symbol Value Unit


Length L 4.0 m
Beam B 0.4 m
Draft T 0.25 m
Wetted Surface S 2.3796 m2

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 18 / 22


+08$ *0++45+2$ 10-97$ :$ 7066*$

Wigley Hull Computations:


Table 5: Resistance coefficients Time Integration
results for experimental values

As it can be seen from Table 4 and 5, the numerical approximations using the CFD solver are in agreement with the
experimental results. Especially the Fine grid computations for Fr# = 0.316 caught 100% convergence with experimental
value.
144K cell coarse grid (Pointwise)

Figure 2: Comparison of Total Resistancecourtesy


Coefficient Results
of Mert with Experimental Value for Fr# = 0.316
Türkol

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 19 / 22


Wigley Hull Computations: Convergence

courtesy of Ensign William Garland

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 20 / 22


Wigley Hull Computations: Full Scale
400 m Ship

courtesy of Ensign William Garland


Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 21 / 22
Hull Force Library

control over quantity calculated and the write syntax

Z
Fp = pndS
ZS
Mp = (xf − xo ) × pndS
ZS
Fv = τ̄¯ · ndS
S
Z
Mv = (xf − xo ) × τ̄¯ · ndS
S

column 1:time, 2-4: Fp , 5-7: Fp , 8-10: Mv , 11-13: Mv

Maki (UofM) Training Session: Ship Resistance 6th OpenFOAM Workshop 22 / 22

You might also like