Modelling Multi-Phase Flows in...

28
Modelling Multi-Phase Flows in OpenFOAM Hrvoje Jasak [email protected] Wikki Ltd. United Kingdom 15/Apr/2005 Modelling Multi-Phase Flows in OpenFOAM – p.1/28

Transcript of Modelling Multi-Phase Flows in...

Page 1: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Modelling Multi-PhaseFlows in OpenFOAM

Hrvoje Jasak

[email protected]

Wikki Ltd. United Kingdom

15/Apr/2005

Modelling Multi-Phase Flows in OpenFOAM – p.1/28

Page 2: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Outline

Objective

• Present a novel way of handling softwareimplementation in numerical mechanics

Topics

• Representing physical models in software

• Object-oriented approach in ComputationalContinuum Mechanics

• Multi-phase flow modelling in OpenFOAM

Modelling Multi-Phase Flows in OpenFOAM – p.2/28

Page 3: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Background

State of the Art

• Numerical modelling part of product design◦ Improvements in computer performance◦ Improved physical modelling and numerics◦ Sufficient validation and experience

• Two-fold requirements◦ Quick and reliable model implementation◦ Complex geometry, high-performance

computing, automatic meshing etc.

Modelling Multi-Phase Flows in OpenFOAM – p.3/28

Page 4: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Numerics for CCM

How to handle complex models in software?

• Natural language of continuum mechanics:partial differential equations

∂k

∂t+ ∇•(uk) −∇•[(ν + νt)∇k] =

νt

[

1

2(∇u + ∇u

T )

]2

−εo

ko

k

Modelling Multi-Phase Flows in OpenFOAM – p.4/28

Page 5: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

FOAM: CCM in C++

FOAM (Field Operation and Manipulation):Represent equations in their natural language

solve

(

fvm::ddt(k)

+ fvm::div(phi, k)

- fvm::laplacian(nu() + nut, k)

== nut*magSqr(symm(fvc::grad(U)))

- fvm::Sp(epsilon/k, k)

);

Modelling Multi-Phase Flows in OpenFOAM – p.5/28

Page 6: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Object Orientation

Recognise main objects from the numericalmodelling viewpoint

• Computational domainObject Software representation C++ Class

Time Time steps (database) time

Tensor (List of) numbers + algebra vector, tensor

Mesh primitives Point, face, cell Point, face, cell

Space Computational mesh polyMesh

Modelling Multi-Phase Flows in OpenFOAM – p.6/28

Page 7: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Object Orientation

• Field algebraObject Software representation C++ Class

Field List of values Field

Boundary condition Values + condition patchField

Dimensions Dimension Set dimensionSet

Geometric field Field + boundary conditions geometricField

Field algebra + − ∗ / tr(), sin(), exp() . . . field operators

• Matrix and solversObject Software representation C++ Class

Linear equation matrix Matrix coefficients lduMatrix

Solvers Iterative solvers lduMatrix::solver

Modelling Multi-Phase Flows in OpenFOAM – p.7/28

Page 8: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Object Orientation

• NumericsObject Software representation C++ Class

Interpolation Differencing schemes interpolation

Differentiation ddt, div, grad, curl fvc, fec

Discretisation ddt, d2dt2, div, laplacian fvm, fem, fam

Implemented Methods: Finite Volume, FiniteElement, Finite Area and Lagrangian tracking

• Top-level organisationObject Software representation C++ Class

Model library Library turbulenceModel

Application main() –

Modelling Multi-Phase Flows in OpenFOAM – p.8/28

Page 9: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Model Interaction

Common interface for related models

class turbulenceModel

{

virtual volTensorField R() const = 0;

virtual fvVectorMatrix divR

(

volVectorField& U

) const = 0;

virtual void correct() = 0;

};

class SpalartAllmaras : public turbulenceModel{};

Modelling Multi-Phase Flows in OpenFOAM – p.9/28

Page 10: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Run-Time Selection

• Model-to-model interaction through commoninterfaces (virtual base classes)

• New components do not disturb existing code

• Run-time selection tables: dynamic binding

• Used for every implementation: “user-coding”◦ Convection differencing schemes

◦ Gradient calculation

◦ Boundary conditions

◦ Linear equation solvers

◦ Physical modelling, e.g. non-Newtonian viscosity laws, etc.

Modelling Multi-Phase Flows in OpenFOAM – p.10/28

Page 11: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Geometry Handling

Complex geometry, mesh motion and morphing

• Complex geometry is a rule, not exception

• Polyhedral cell support◦ Cell is a polyhedron bounded by polygons◦ Consistent handling of all cell types◦ More freedom in mesh generation

• Integrated mesh motion and topo changes

• Automatic motion solver + morph engine

Modelling Multi-Phase Flows in OpenFOAM – p.11/28

Page 12: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Geometry Handling

-341 -244 -148 -51 45 142 238

Modelling Multi-Phase Flows in OpenFOAM – p.12/28

Page 13: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Layered Development

• Design encourages code re-use: shared tools

• Code developed and tested in isolation◦ Vectors, tensors and field algebra◦ Mesh handling, refinement, topo changes◦ Discretisation, boundary conditions◦ Matrices and solver technology◦ Physics by segment◦ Custom applications

• Ultimate user-coding capabilities!

Modelling Multi-Phase Flows in OpenFOAM – p.13/28

Page 14: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Multi-Phase Modelling

Examples of FOAM library in use

• Multi-phase Eulerian models

• Free surface flows◦ Surface capturing method◦ Surface tracking method

• Lagrangian particle model

Extensions and integration benefits:

poly mesh, motion/topo changes, multi-physics,

other CFD/CCM: LES, combustion, (nuclear?)Modelling Multi-Phase Flows in OpenFOAM – p.14/28

Page 15: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Eulerian Multi-Phase

Bubbly flow in water

• Bubble column:Gomes et al. 1998

• Air bubbles areinjected at bottomplate

• Includes free surface:γ = 0, γ = 1

Modelling Multi-Phase Flows in OpenFOAM – p.15/28

Page 16: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Surface Capturing

Droplet impact into a wall film, 1.3 million cells

Modelling Multi-Phase Flows in OpenFOAM – p.16/28

Page 17: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

LES Surface Capturing

LES of a Diesel Injector

• d = 0.2mm, high velocity and surface tension

• Mean injection velocity: 460m/s

• Diesel fuel injected into air, 5.2MPa, 900K

• Turbulent and subsonic flow, no cavitation◦ 1-equation LES model with no free surface

correction◦ Fully developed pipe flow inlet

Modelling Multi-Phase Flows in OpenFOAM – p.17/28

Page 18: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

LES Surface Capturing

• Mesh size: 1.2 to 8 million CVs, aggressivelocal refinement, 50k time-steps

• 6µs initiation time, 20µs averaging time

Modelling Multi-Phase Flows in OpenFOAM – p.18/28

Page 19: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Surface Tracking

rF

vF

vb = −vF

y

x

y′

x′

aF

o′SA

SB

o

Free

surface

Free surface tracking

• 2 phases = 2 meshes

• Mesh adjusted forinterface motion

• Surfactant transport

Air-water system

• 2-D: rb = 0.75 mm

• 3-D: rb = 1 mm

Modelling Multi-Phase Flows in OpenFOAM – p.19/28

Page 20: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Surface Tracking

Clean surface

Pollution by surfactant chemicals

Modelling Multi-Phase Flows in OpenFOAM – p.20/28

Page 21: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Surface Tracking

Complex coupling problem: FVM flow solver +

FEM mesh motion + FAM surfactant transportModelling Multi-Phase Flows in OpenFOAM – p.21/28

Page 22: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Lagrangian Particles

Hour-glass simulation

Modelling Multi-Phase Flows in OpenFOAM – p.22/28

Page 23: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Lagrangian Particles

Diesel Combustion in Scania D-12 Engine

• 1/8 sector with 75 % load and n-heptane fuel

• RANS, k − ε turbulence model, simplified5-species chemistry and 1 reaction,Chalmers PaSR combustion model

• Temperature on the cutting plane

• Spray droplets coloured with temperature

Modelling Multi-Phase Flows in OpenFOAM – p.23/28

Page 24: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Lagrangian Particles

Diesel Combustion in Scania D-12 Engine

Modelling Multi-Phase Flows in OpenFOAM – p.24/28

Page 25: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Fluid-Solid Coupling

Pipeline failure: crack propagation and leakage

Modelling Multi-Phase Flows in OpenFOAM – p.25/28

Page 26: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Fluid-Solid Coupling

Enlarged deformation of the pipe

Modelling Multi-Phase Flows in OpenFOAM – p.26/28

Page 27: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

Summary

• Object-oriented approach facilitates modelimplementation: layered design + re-use

• Equation mimicking opens new CCM grounds

• Extensive capabilities already implemented

• Open design for easy user customisation

Acknowledgements

• Henrik Rusche and Eugene de Villiers, Imperial College

• Željko Tukovic, University of Zagreb; Niklas Nordin, Chalmers University

• Vlado Tropša (Imperial College), Alojz Ivankovic, UC Dublin

• OpenFOAM: http://openfoamcfd.sourceforge.net, http://www.openfoam.org

Modelling Multi-Phase Flows in OpenFOAM – p.27/28

Page 28: Modelling Multi-Phase Flows in OpenFOAMpowerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/USDeptOfEnergyNETL_15Apr... · Modelling Multi-Phase Flows in OpenFOAM – p.10/28. Geometry Handling

FOAM: CCM in C++

Main characteristics

• Wide area of applications: all of CCM!

• Shared tools and code re-use

Versatility

• Unstructured meshes, automatic meshmotion + topological changes

• Finite Volume, Finite Element, Lagrangiantracking and Finite Area methods

• Efficiency through massive parallelism

Modelling Multi-Phase Flows in OpenFOAM – p.28/28