openfoam: year in review -...

22
OpenFOAM: Year in Review Hrvoje Jasak [email protected], [email protected] Wikki Ltd, United Kingdom Faculty of Mechanical Engineering and Naval Architecture University of Zagreb, Croatia 5th OpenFOAM Workshop, Gothenburg 21-24 June 2010 OpenFOAM: Year in Review – p. 1

Upload: hadung

Post on 06-Mar-2018

228 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

OpenFOAM: Year in ReviewHrvoje Jasak

[email protected], [email protected]

Wikki Ltd, United Kingdom

Faculty of Mechanical Engineering and Naval Architecture

University of Zagreb, Croatia

5th OpenFOAM Workshop, Gothenburg 21-24 June 2010

OpenFOAM: Year in Review – p. 1

Page 2: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

Outline

Topics

1. Introduction and Project Overview

2. Robustness and accuracy and scaling improvements

3. Radial Basis Function in mesh motion, morphing and shape optimisation

4. Dynamic remeshing with tetrahedral edge swapping

5. Overset grid in OpenFOAM

6. Python and SALOME interface: VulaSHAKA project

7. Deployment of OpenFOAM

8. New Features in the upcoming release

9. Summary and Outlook

OpenFOAM: Year in Review – p. 2

Page 3: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

Introduction

OpenFOAM Since Montreal 2009

• A successful year for the community: further penetration into scientific researchcommunity, research laboratories and industrial CFD

• Major community contributions: from new ideas to complete capability libraries◦ Radial Basis Function◦ Turbomachinery features and validation

◦ Naval hydrodynamics effort and Overset grid

◦ Python and SALOME integration

◦ Robustness and accuracy improvements

• Next stage: integration, consolidation, validation◦ Public test loop, nightly builds, validation cases

◦ Documentation and community portal

◦ Integrated cross-platform version

◦ Quarterly release schedule

OpenFOAM: Year in Review – p. 3

Page 4: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

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!)

OpenFOAM: Year in Review – p. 4

Page 5: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

Massively Parallel Scaling

Intel and the Intel logo are trademarks or registered tradem arks od Intel Corporation or its subsidiaries in the United Sta tes and other countries

0 2e-07 4e-07 6e-07 8e-07Simulation Time (Iteration) [s]

0

500

1000

1500

2000

2500

3000

Exe

cutio

n T

ime

[s]

72 CPU144 CPU288 CPU

Scaling Test, VOF Free Surface Flow, 50m Cells(In Cooperaton with Intel)

Intel Xeon Processor: X5650 B0; Frequency: 2.93 GHz # pro-cessors 2; # cores 6; Cache (L1 KB/L2 MB/L3 MB): 32 KB / 256KB / 12 MB; 6x4GB DDR3 1333 RDIMM QDR InfiniBand 4x

OpenFOAM: Year in Review – p. 5

Page 6: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

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

OpenFOAM: Year in Review – p. 6

Page 7: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

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

OpenFOAM: Year in Review – p. 7

Page 8: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

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

OpenFOAM: Year in Review – p. 8

Page 9: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

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

OpenFOAM: Year in Review – p. 9

Page 10: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

Radial Basis Function

RBF Mesh Morphing: Cylinder and Sphere Examples

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

OpenFOAM: Year in Review – p. 10

Page 11: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

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

OpenFOAM: Year in Review – p. 11

Page 12: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

Shape Optimisation

2-D Wedge: Minimise X-Component of Force

• Using 4 moving control points along the height, with independent motionparameters in optimisation

Point Motion range( 0 0.25 ±0.1) (( 0.45 0 0) ( -0.45 0 0))

( 0.5 0.75 ±0.1) (( 0.25 0 0) ( -0.25 0 0))( 1 1.25 ±0.1) (( 0.25 0 0) ( -0.25 0 0))

( 1.5 1.75 ±0.1) (( 0.25 0 0) ( -0.25 0 0))

• Motion in all points is parallel to surface to preserve height and ground clearance

iter = 1 pos = (0.2 0.2 0.7) v = 2296.61 size = 0.3321iter = 6 pos = (0.4792 0.1746 0.995) v = 2125.69 size = 0.2915iter = 24 pos = (0.9554 0.01677 0.977) v = 2079.52 size = 0.05354iter = 36 pos = (0.9322 0.00383 0.993) v = 2071.47 size = 0.00980

OpenFOAM: Year in Review – p. 12

Page 13: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

Shape Optimisation

3-D Sphere: Minimising Drag Force

• Using 9 control points in motion, with symmetry constraints: 4 points in frontsquare, radial motion; 4 points in back square, radial and axial motion; 1 tail point,axial motion only

• Optimisation is performed with 3 parameters:

iter = 1 pos = (0.2 0.7 0.2) v = 147.96 size = 0.2997iter = 5 pos = (0.06111 0.7092 0.7092) v = 106.26 size = 0.2153iter = 12 pos = (0.03727 0.9354 0.3830) v = 77.934 size = 0.0793iter = 22 pos = (0.04095 0.9458 0.3413) v = 75.821 size = 0.006610

OpenFOAM: Year in Review – p. 13

Page 14: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

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!

OpenFOAM: Year in Review – p. 14

Page 15: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

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

OpenFOAM: Year in Review – p. 15

Page 16: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

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

OpenFOAM: Year in Review – p. 16

Page 17: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

VulaSHAKA Project

VulaSHAKA Project Snapshots

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

OpenFOAM: Year in Review – p. 17

Page 18: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

VulaSHAKA Project

VulaSHAKA Code Components

• IFoam (Interactive FOAM): Interactive calculation and integration framework forOpenFOAM, provides integration to SALOME

• pyFoam (sorry, Bernhard): Python front-end to OpenFOAM, supports IFoam

• unv2foam: Extends OpenFOAM ideasUnvToFoam utility, introducing embeddedcapabilities necessary for embedding (available as C++ function)

• foam2vtk: Memory based conversion of FOAM objects into VTK objects fordisplay

• foam2med: Allows translation of OpenFOAM data into MED format to enableintegration with SALOME

• confFoam: Common configuration package for OpenFOAM development basedon automake tools

• User requirements and future plans: establish international collaboration

• Developer credits

◦ Ivor Clifford, (currently Penn State University), formerly PBMR

◦ Alexey Petrov , Johannes Odendaal, PBMR Pty, South Africa

OpenFOAM: Year in Review – p. 18

Page 19: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

Deployment of OpenFOAM

OpenFOAM Extend Deployment and Release Schedule

• Substantial community contributions and developments need a better deploymentframework: help the users with new capability and share results of your work

• Improvements in many directions needed: mimic operation of a software company

• Community effort is the only way to address all needs: large amount of work!

Major Improvements in the Pipeline

1. Unified Linux, Mac OS-X and Windows version

2. Testing and validation harness

3. Community portal and joint documentation effort

4. Quarterly release schedule

OpenFOAM: Year in Review – p. 19

Page 20: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

New Features in Upcoming Release

New Features

• Functional merge with OpenFOAM-1.6.x: new developments + consistent controls

• Major new features◦ Block matrix implementation with parallelisation support

◦ Re-meshing with tetrahedral edge swapping: Sandeep Menon

◦ Completion of the internal combustion engine library: Poly Milano

◦ Parallelisation work in Fluid-Structure interaction solver◦ Python-SWIG interface to OpenFOAM and finiteVolume library: sufficient to

migrate complete physics solvers into python

• Running OpenFOAM without trace on disk: complete functional case generationand setup. This is a part of python interface requirement – enable full interpretedexecution of OpenFOAM cases, from mesh generation to post-processing

• Parallelisation of topology modifiers: parallel dynamic mesh

• Accuracy improvements on tetrahedral meshes

• Bug fixes and algorithmic improvements (approx 5000)

• Changing software management system to git

OpenFOAM: Year in Review – p. 20

Page 21: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

New Features in Upcoming Release

Native Windows Version of OpenFOAM

• Major piece of work, actively supported by Microsoft: HPC platform push

• No shortcuts: native compiler and operating system interface (non-POSIX)

• Complete rewrite of build system: CMake: generate Visual Studio project files

• New mechanism for include file handling: Michael Wild, FreeFOAM

• Library symbol import-export handling: changes to all class files!

• Plan: keep Windows port as a git branch to stabilise the regular release andresolve deployment and efficiency issues

• The work is lost if development lines do not merge. Therefore . . .

Unified Linux, Mac OS-X and Windows Version

• Merging the development line and regular porting required

• Binary releases for Linux, Mac and Windows; USB stick, Debian packages

• Public testing and validation runs prior to release

• Quarterly release schedule to minimise version-to-version jumps

• I would like a Release Committee please! Can you help?

OpenFOAM: Year in Review – p. 21

Page 22: OpenFOAM: Year in Review - Chalmersweb.student.chalmers.se/groups/ofw5/Presentations/HrvojeJasakSlide... · Designed specifically to “host” numerical simulation software •

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

• OpenFOAM Workshop 2011 : Who is Next?

. . . let’s see what the future brings

OpenFOAM: Year in Review – p. 22