current development work in · pdf file• provide basic information about openfoam...

27
Current Development Work in OpenFOAM Hrvoje Jasak [email protected], [email protected] Wikki, United Kingdom and Germany Faculty of Mechanical Engineering and Naval Architecture University of Zagreb, Croatia Dutch OpenFOAM Day, TU Delft, 4 November 2010 Current Development Work in OpenFOAM – p. 1

Upload: truongnhi

Post on 06-Mar-2018

216 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Current Development Work inOpenFOAM

Hrvoje Jasak

[email protected], [email protected]

Wikki, United Kingdom and Germany

Faculty of Mechanical Engineering and Naval Architecture

University of Zagreb, Croatia

Dutch OpenFOAM Day, TU Delft, 4 November 2010

Current Development Work in OpenFOAM – p. 1

Page 2: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Outline

Objective

• Provide basic information about OpenFOAM software from User’s viewpoint

◦ What is it? How do I run it? What capabilities does it have?

• Present an overview of current and future developments

Topics

1. OpenFOAM: Executive Overview

2. Running OpenFOAM

3. Points of interest: why consider OpenFOAM

4. Examples of capabilities• Radial Basis Function in mesh motion and morphing

• CFD in shape optimisation with RBF morphing

• Vehicle soiling: Lagrangian tracking, finite area and liquid film

• Turbomachinery examples• Dynamic remeshing with tetrahedral edge swapping

• Overset grid in OpenFOAM

5. Summary and Outlook

Current Development Work in OpenFOAM – p. 2

Page 3: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

OpenFOAM: Executive Overview

What is OpenFOAM?

• OpenFOAM is a free-to-use Open Source numerical simulation software withextensive CFD and multi-physics capabilities

• Free-to-use means using the software without paying for license and support,including massively parallel computers: free multi-1000-CPU CFD license!

• Software under active development, capabilities mirror those of commercial CFD

• Substantial installed user base in industry, academia and research labs

• Possibility of extension to non-traditional, complex or coupled physics:Fluid-Structure Interaction, complex heat/mass transfer, internal combustionengines, nuclear

Main Components

• Discretisation: Polyhedral Finite Volume Method, second order in space and time

• Lagrangian particle tracking, Finite Area Method (2-D FVM on curved surface)

• Massive parallelism in domain decomposition mode

• Automatic mesh motion (FEM), support for topological changes

• All components implemented in library form for easy re-use

• Physics model implementation through equation mimicking

Current Development Work in OpenFOAM – p. 3

Page 4: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Implementing Continuum Models

Equation Mimicking

• Natural language of continuum mechanics: partial differential equations

• Example: turbulence kinetic energy equation

∂k

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

»

1

2(∇u + ∇uT )

2

−ǫo

ko

k

• Objective: represent differential 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));

• Correspondence between the implementation and the original equation is clear

• Library-based implementation of custom physical models with full freedom insolution algorithms. New: support for multi-equation implicit coupling

Current Development Work in OpenFOAM – p. 4

Page 5: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

OpenFOAM: Executive Overview

Physical Modelling Capability Highlights

• Basic: Laplace, potential flow, passive scalar/vector/tensor transport

• Incompressible and compressible flow: segregated pressure-based algorithms

• Heat transfer: buoyancy-driven flows, conjugate heat transfer

• Multiphase: Euler-Euler, VOF free surface capturing and surface tracking

• RANS for turbulent flows: 2-equation, RSTM; full LES capability

• Pre-mixed and Diesel combustion, spray and in-cylinder flows

• Stress analysis, fluid-structure interaction, electromagnetics, MHD, etc.

Current Development Work in OpenFOAM – p. 5

Page 6: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Running OpenFOAM

Structure of OpenFOAM

• OpenFOAM is assembled from components◦ Foundation libraries, containing discretisation, mesh handling etc. in re-usable

form. Functionality shared across many application

◦ Physical modelling libraries: thermo-physical models (liquids and gasses),viscosity models, turbulence models, chemical reactions interface

◦ Utilities: mesh import and manipulation, parallel processing, post processorhook-up (reader module) and data manipulation

◦ Customised, purpose-written and optimised executables for each physicssegment. All are founded on common components

◦ Linkage for user extensions and on-the-fly data analysis

OpenFOAM Executable

• Custom executable for specific physics segment: few 100s of lines of code

• Easy to read, understand, modify or add further capability

• Existing code is used as a basis for own development: simulation environment

• Low-level functions, eg. mesh handling, parallelisation, data I/O handledtransparently: no need for special coding at top level

Current Development Work in OpenFOAM – p. 6

Page 7: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Point of Interest

Why Consider OpenFOAM

• Open architectures◦ Access to complete source: no secret modelling tricks, no cutting corners

◦ Both community-based and professional support available

◦ Common platform for new R&D projects: shipping results of research into thehands of a customer with no delay

• Low-cost CFD◦ No license cost, portable to any computing platform (IBM Blue Gene)

◦ Easily scriptable and embeddable: “automated CFD” and optimisation

◦ Efficient on massively parallel computers, portable to new comms protocols

• Problem-independent numerics and discretisation◦ Tackle non-standard continuum mechanics problem: looking beyond the

capabilities of commercial CFD

• Efficient environment for complex physics problems

◦ Tackling difficult physics is made easier through equation mimicking

◦ Utility-level tools readily available: parallelism, moving mesh

◦ Track record in non-linear and strongly coupled problems

◦ Excellent piece of C++ and software engineering! Decent piece of CFD

Current Development Work in OpenFOAM – p. 7

Page 8: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Examples of Simulation

Example of Capabilities of OpenFOAM Relevant to Your CFD Needs

• This is only a part of the OpenFOAM capabilities!

• Chosen for relevance and illustration of the range of capabilities rather thanexhaustive illustration of range of capabilities

• In some cases, simplified geometry is used

• Regularly, the work resulted in a new solver; in many cases, it is developed as anextension or combination of existing capabilities

Description of Simulation and Setup

• Physics and numerical method setup

• Standard or customised solver; details of mesh resolution and customisation

• New capability and proposed development shall be marked

Current Development Work in OpenFOAM – p. 8

Page 9: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Radial Basis Function

Radial Basis Function Interpolation

• RBF interpolation defines the interpolation directly from the sufficient smoothnesscriterion on the interpolation (positive weighting factors):

s(x) =

NbX

j=1

γjφ(|x − xb,j |) + q(x)

where◦ x is the interpolant location

◦ xb is the set of Nb locations carrying the data

◦ φ(x) is the basis function, dependent on point distance

◦ q(x) is the (usually linear) polynomial function, depending on choice of basisfunction and γj , eg. q = b0 + b1x + b2y + b3z

• Consistency of interpolation is achieved by requiring that all polynomials of theorder lower than q disappear at data points

NbX

j=1

γjp(xb,j) = 0

Current Development Work in OpenFOAM – p. 9

Page 10: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Radial Basis Function

RBF Interpolation Procedure

1. Establish locations of data-carrying points xb and their values

2. Assemble and solve the equation set for γ and β using a direct solver

3. Calculate values at desired locations by evaluating s(x)

Using RBF in a CFD Code Context

• Automatic mesh motion: mesh deformation based on a small number of controlpoints located on moving boundaries

◦ PhD project by dr. Frank Bos, TU Delft◦ Basic implementation of RBF in OpenFOAM

◦ Automatic selection of control points with coarsening + extinguishing functionfor far-field motion control: reduce number of control points

◦ RBF interpolation to calculate mesh motion (+ parallelisation)◦ Implemented as an option in dynamic mesh motion

• RBF mesh morpher in geometric shape optimisation

◦ Morphing points control change of shape as data carriers

◦ Small number of degrees of freedom: ideal for parametrisation

◦ Mesh quality in deformation guaranteed by properties of RBF

Current Development Work in OpenFOAM – p. 10

Page 11: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Radial Basis Function

Radial Basis Function in Automatic Mesh Motion

• Mathematical tool which allows data interpolation from a small set of control pointsto space with smoothness criteria built into the derivation

• Used for mesh motion in cases of large deformation: no inverted faces or cells

• Control points chosen on a moving surface, with “extinguishing function” used tocontrol far-field mesh motion

• Implemented by Frank Bos, TU Delft and Dubravko Matijaševic, FSB Zagreb

Current Development Work in OpenFOAM – p. 11

Page 12: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Radial Basis Function

RBF Mesh Morphing

• RBF morphing object defines the parametrisation of geometry (space):

1. Control points in space, where the parametrised control motion is defined

2. Static points in space, whose motion is blocked

3. Range of motion at each control point: (d0,d1)

4. Set of scalar parameters δ for control points, defining current motion as

d(δ) = d0 + δ(d1 − d0), where 0 ≤ δ ≤ 1

• For each set of δ parameters, mesh deformation is achieved by interpolatingmotion of control points d over all vertices of the mesh: new deformed state of thegeometry

• Mesh in motion remains valid since RBF satisfies smoothness criteria

Using RBF in Optimisation

• Control points may be moved individually or share δ values: further reduction indimension of parametrisation of space

• Mesh morphing state is defined in terms of δ parameters: to be controlled by theoptimisation algorithm

Current Development Work in OpenFOAM – p. 12

Page 13: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Radial Basis Function

RBF Mesh Morphing: Cylinder and Sphere Examples

• Parametrisation uses a single parameter δ for this motion, with various number ofcontrol points

Current Development Work in OpenFOAM – p. 13

Page 14: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Shape Optimisation

Shape Optimisation Background

• Specify a desired object of optimisation and use the parametrisation of geometryto explore the allowed solution space in order to find the minimum of theoptimisation objective

objective = f(shape)

1. Parametrisation of Geometry• Computational geometry is complex and usually available as the

computational mesh: a large amount of data

• Parametrisation tool: RBF mesh morphing, defining deformation at a smallnumber of mesh-independent points in space

2. CFD Flow Solver is used to provide the flow solution on the current geometry, inpreparation for objective evaluation

3. Evaluation of Objective: usually a derived property of the flow solution

4. Optimiser Algorithm: explores the solution space by providing sets of shape

coordinates and receiving the value of objective. The search algorithm iterativelylimits the space of solutions in search of a minimum value of objective

Current Development Work in OpenFOAM – p. 14

Page 15: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Shape Optimisation

Example: HVAC 90 deg Bend: Flow Uniformity at Outlet

• Flow solver: incompressible steady-turbulent flow, RANS k − ǫ model; coarsemesh: 40 000 cells; 87 evaluations of objective with CFD restart

• RBF morphing: 3 control points in motion, symmetry constraints; 34 in total

• Objective: flow uniformity at outlet plane

iter = 0 pos = (0.9 0.1 0.1) v = 22.914 size = 0.69282iter = 5 pos = (0.1 0.1 0.1) v = 23.0088 size = 0.584096iter = 61 pos = ((0.990164 0.992598 0.996147) v = 13.5433 size = 0.000957122

Current Development Work in OpenFOAM – p. 15

Page 16: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Finite Area Method

Finite Area Discretisation

• Finite Area Method discretised equations on a curved surface in 3-D

• Surface is discretised using polygonal faces. Discretisation takes into accountsurface curvature. A level of smoothness is assumed in calculation of curvatureterms

• Surface motion is allowed: decomposed into normal and tangential motion

• Nomenclature for a surface element P and its neighbour N

nP

Nne

PNd e

eL

j

i

ee’ m

n f

SP

Current Development Work in OpenFOAM – p. 16

Page 17: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Thin Liquid Film Model

Modelling Assumptions: 2-D Approximation of a Free Surface Flow

• Isothermal incompressible laminar flow

• Boundary layer approximation:◦ Tangential derivatives are negligible compared to normal

◦ Normal velocity component is negligible compared to tangential

◦ Pressure is constant across the film depth

• Similitude of the flow variables in the direction normal to the substrate◦ Prescribed cubic velocity profile

n

Sw

v

vfs

Sfs

pgvg

md,i

Dependent variables: h and vσ

vd,iv

h

v = 1h

h∫

0

v dh

η = nh, 0 ≤ n ≤ h

v(η) = vfs• diag (aη + bη2 + cη3)

Current Development Work in OpenFOAM – p. 17

Page 18: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Thin Liquid Film Model

Validation: Droplet Spreading Under Surface Tension

• Liquid film equations governing the flow; self-similar velocity profile

• Droplet spread driven by gravity and counteracted by surface tension

• Equation set possesses an (axi-symmetric) analytical solution: validation ofimplementation and numerics

0

5e-06

1e-05

1.5e-05

2e-05

2.5e-05

3e-05

3.5e-05

4e-05

0 0.0005 0.001 0.0015 0.002

h, m

r, m

t = 0.000 st = 0.015 s

Analytical solution

Implementation of Liquid Film Model Volume-Surface-Lagrangian Coupling

• Full second order in space and time on curved moving surfaces

• Parallelisation bound to volumetric FVM

• Shared matrix and discretisation: possibility of close coupling with FVM

Current Development Work in OpenFOAM – p. 18

Page 19: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Coupling Wall Film with Spray

Volume-Surface-Lagrangian Coupling

• Coupling a volumetric flow model with Lagrangian particles for a dispersed phaseto a thin liquid film model on the solid wall Custom solver

• In terms of numerics, coupling of volumetric, surface and Lagrangian models iseasy to handle: different modelling paradigms

• Main coupling challenge is to implement all components side-by-side and controltheir interaction: volumetric-to-particle-to-surface data exchange

• Implementation of liquid film used in other applications: Italian engines

Current Development Work in OpenFOAM – p. 19

Page 20: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Turbomachinery Features

General Grid Interface

• Turbomachinery CFD requires additional features: implement in library form

• General Grid Interface (GGI) and its derived forms

◦ Cyclic GGI

◦ Partial overlap GGI

◦ Mixing plane interface (under testing)

• Implementation and parallelisation is complete: currently running validation casesin collaboration with commercial clients and Turbomachinery Working Group

• Other turbo-related components in pipeline: harmonic balance solver solver

• Library-level implementation allows re-use of GGI beyond turbomachinery

Current Development Work in OpenFOAM – p. 20

Page 21: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Tetrahedral Edge Swapping

Re-Meshing with Tetrahedral Edge Swapping

• In cases where mesh motion involves topological change at the boundary orunpredictable mesh deformation, topological change machinery is impractical:cannot decide a-priori where to place topology modifiers

• Dynamic remeshing using tetrahedral edge swapping◦ Motion is prescribed on external boundaries◦ Tetrahedral cell quality examined continuously: bad cells trigger automatic

remeshing without user interaction: answers to dynamicMesh interface

◦ Implemented by Sandeep Menon, UMass Amherst as a ready-to-use library

• Example: viscoelastic droplet collision using free surface tracking

• Can be used for all dynamic mesh cases: ultimate ease of mesh setup!

Current Development Work in OpenFOAM – p. 21

Page 22: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Overset Grid in OpenFOAM

foamedOver: Overset Grid Technology in OpenFOAM

• Work by David Boger, Penn State University using SUGGAR and DirtLib librariesdeveloped by Ralph Noack, Penn State (must mention Eric Paterson!)

• Overset Grid Technology

◦ Multiple components meshed individually, with overlap◦ Hole cutting algorithm to remove excess overlap cells

◦ Mesh-to-mesh interpolation with implicit updates built into patch field updatesand linear solver out-of-core operations

• Body-fitted component meshes: preserving quality and near-wall resolution

• Simple mesh motion and geometrical studies (replacing individual components)

• Overset grid is physics-neutral! Currently testing for free surface flows

Current Development Work in OpenFOAM – p. 22

Page 23: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Robustness, Accuracy, Scaling

Robustness and Accuracy Improvements

• Tetrahedral mesh solution improvement

◦ Historically, tet meshes are easier to generate, but “hex-based” CFDmethodology has produced poorer results, especially for boundary layers.Improvements took approx. 6 years in Star-CD and Fluent

◦ Pointwise mesh generator: unstructured complex geometry meshes withanisotropic tetrahedral mesh extrusion in boundary layers (with optionalrecombination of tetrahedra)

• With community effort, we got there in approx. 6 months: special discretisation

Performance and Parallel Scaling Improvements

• Tuning of OpenFOAM for high-end parallel machines: collaboration with Intel

• Scalable Software Workshop: National Science Foundation, USA

• OpenMP baseline by Sandeep Menon, UMass Amherst

◦ Basic wrapping and examples for use of OpenMP in the library

◦ Objective: provide multi-core support at linear solver, matrix and calculusand field operator level, in stages!

• OpenFOAM on GPU: Work in progress (don’t look at me!)

Current Development Work in OpenFOAM – p. 23

Page 24: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

VulaSHAKA Project

VulaSHAKA Background and Project Road-Map: OpenFOAM/SALOME Integration

• SALOME is an open source integration platform for numerical simulation

◦ Development coordinated and financed by EDF (France)

◦ Designed specifically to “host” numerical simulation software

• OpenFOAM/SALOME Integration

◦ IFoam: Interactive FOAM, Python-based, explicit and implicit distributedprocess coupling and data translation

◦ GFoam: Stand-alone GUI, including IFoam engine

◦ SFoam: IFoam and GFoam embedded in a SALOME module

Current Development Work in OpenFOAM – p. 24

Page 25: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

VulaSHAKA Project

VulaSHAKA Project Snapshots

• CAD generation, meshing, boundary condition setup and post-processing

Current Development Work in OpenFOAM – p. 25

Page 26: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

NUMAP-FOAM 2010

NUMAP-FOAM Summer School, Generation 2010

• Third year of Summer School in action: Zagreb, 1-15 September 2010

The idea of the Summer School is to expand the physical modellingknowledge, numerics and programming skills of attendees usingOpenFOAM in their research through direct supervision and one-to-onework.

This is NOT an introductory OpenFOAM course: significantunderstanding of the project and software is a pre-requisite forapplication.

• Example projects: picked for my personal interest

◦ Darrin Stevens, CSIRO Australia: poly-dispersed multiphase flows

◦ Oliver Borm, TU Munich Germany: compressible flows in turbomachinery

◦ Chiara Mistrangelo, Karlsruhe Institute of Technology: MHD flows

◦ Bill Rosemurgy, Uni Michigan: hybrid naval hydrodynamics solver for rapidcalm water resistance: potential flow + full RANS using VOF

◦ Peter Benovsky, Austrian Institute of Technology : combustion and chemistryin a direct fired generator

◦ Sunho Park, Seoul National University: 6-DOF of super-cavitating torpedoes

◦ Joris Mattheijssens, Royal Military Academy, Brussels: robotic ships

Current Development Work in OpenFOAM – p. 26

Page 27: Current Development Work in · PDF file• Provide basic information about OpenFOAM software from User’s viewpoint What is it? How do I run it? ... Current Development Work in OpenFOAM

Summary

A Year in Life of OpenFOAM

• Very successful: improved capability, visibility and quality of the code

• This is a community-driven project with numerous contributors: Thank You All

• Presence of OpenFOAM in the numerical simulation arena is changing the wayusers are applying CFD simulations in industrial settings

• Academic sharing of results and joint research is easier and more productive

Outlook

• Need to make OpenFOAM easier for entry-level users: several ongoing projects

• Formalise and validate software capability: adding new features is as important asmaking the best possible use of existing capability

• Expand the pool of expert developers: NUMAP-FOAM Summer School, Zagreb

• Grow the community and user base: software lives only as long as it is used

Something to Look Forward To

• OpenFOAM Workshop 2011: Penn State University, June 2011

• NUMAP-FOAM 2011: Zagreb, September 2011

. . . let’s see what the future brings

Current Development Work in OpenFOAM – p. 27