openfoam project for the future...3. openfoam governance steering committee 4. one openfoam...

45
OpenFOAM Project for the Future Hrvoje Jasak Wikki Ltd, United Kingdom, Germany and Brazil Faculty of Mechanical Engineering and Naval Architecture, Uni Zagreb, Croatia Korea Society for Computational Fluids Engineering Daejeon, 27 February 2019 OpenFOAM Project for the Future – p. 1

Upload: others

Post on 23-Oct-2020

11 views

Category:

Documents


3 download

TRANSCRIPT

  • OpenFOAM Project for the Future

    Hrvoje Jasak

    Wikki Ltd, United Kingdom, Germany and Brazil

    Faculty of Mechanical Engineering and Naval Architecture, Uni Zagreb, Croatia

    Korea Society for Computational Fluids Engineering

    Daejeon, 27 February 2019

    OpenFOAM Project for the Future – p. 1

  • Outline

    Objective

    • Present my work and vision for OpenFOAM: 1993 to 2019 and towards CFD 2030

    Topics

    1. About Me

    2. Mission / Vision: OpenFOAM as a revolutionary simulation platform

    3. OpenFOAM Governance Steering Committee

    4. One OpenFOAM integration efforts

    5. Some examples

    • Physics of free surface: planning hull simulations

    • Compressible two-phase free surface flow: wave impact

    • Turbomachinery capabilities and Harmonic Balance

    • Coupled solver applications

    6. Summary

    OpenFOAM Project for the Future – p. 2

  • About Me

    Hrvoje Jasak: Education and Professional Experience

    • First degree: mechanical engineering, University of Zagreb, Croatia 1992

    • PhD, Imperial College London 1993-1996

    • Senior development engineer, CD-adapco (Siemens), 1996-2000

    • Technical director, Nabla Ltd. 2000-2004: in charge of FOAM development

    • Consultant on CFD software, numerics and modelling, ANSYS Fluent 2000-2008

    Current Work

    • Director, Wikki Ltd: software development, support and consulting 2004-

    • Professor, University of Zagreb, Croatia 2007-

    • Mercator Fellow, TU Darmstadt, 2016-

    • Founder and Committee Member, OpenFOAM Workshop: 14 editions (2006)

    • Founder, NUMAP-FOAM Summer School: 14 editions (2008)

    • Coordinating open source OpenFOAM development to allow public contributions

    • Teaching, workshops, lectures and seminars, visiting professorships: TU Delft,

    Chalmers University, Uni Zaragoza, UFRJ, Seoul National University and others

    OpenFOAM Project for the Future – p. 3

  • About Me

    Role in OpenFOAM Development

    • One of two original developers of OpenFOAM software, starting from 1993

    • FVM discretisation, polyhedral mesh handling, linear solvers: Jasak PhD 1996

    • Error estimation, adaptive mesh refinement, dynamic mesh, automatic mesh

    motion, topological changes: (sliding, layering); engine CFD

    • Parallelism and HPC support: decomposition/reconstruction, comms

    • Mesh generation, conversion, manipulation; pre- and post-processing tools

    • Turbulence modelling, LES, free surface flows, solid mechanics, visco-elastic

    • Finite Element motion solver, finite area method, ODE solvers

    • Dynamic mesh handling; Immersed Boundary and Overset Mesh

    • POD, reduced order modelling

    • Geometric parametrisation and automatic optimisation

    OpenFOAM Project for the Future – p. 4

  • OpenFOAM and CFD in 2020

    My work with OpenFOAM in the Last 25 Years: 1993 – 2019

    • The vision at the start of the project was to see how good a code can we write

    ◦ Is commercial CFD numerics/modelling ahead of academic knowledge: No!

    ◦ Does a commercial environment lead to high-quality software: No!

    • The scope for Open Source is present: all CFD knowledge is in public domain

    • Focus the world-wide academic and industrial activity in collaborative work

    Where We Are Today?

    • ANSYS: World-Wide CFD market is no longer growing (oh, really???)

    • ISOPE Conference Sapporo, Jun/2018: 58 CFD papers with OpenFOAM

    • OpenFOAM present across all CFD applications, industries and research areas

    • Custom applications, multi-physics, new frontiers: this is what CFD is for!

    OpenFOAM Project for the Future – p. 5

  • Mission and Vision

    Mission

    • Write the best CFD code in the world, using modern software engineering and

    questioning existing (software, modelling, numerics) paradigms

    • (Open source deployment follows as a logical consequence)

    • . . . and watch its revolutionising effect in the CFD arena

    Vision

    • Having witnessed the effect of Open Source CFD in practical simulations

    1. Focus the academic and industrial research effort to provide a step-change in

    use and simulation capabilities

    2. Expand the base of competent researchers, developers and users

    3. Provide a framework for industrial-academic collaboration, knowledge

    transfer, sharing of work/software and understanding of practical requirements

    • Strive for excellence: we can do this better!

    Events and Consequences

    • By far the most widely used CFD/CCM tool of 2010s

    • Significant cost reduction of industrial CFD, with increase in simulation volume

    • Opening new areas for CFD simulation and integrated work-flows

    OpenFOAM Project for the Future – p. 6

  • OpenFOAM Governance

    OpenFOAM Project and Governance

    • Numerous worthy developments with insufficient integration:

    • “OpenFOAM Foundation”: discredited and dysfunctional; better structure and

    accountability is needed!

    OpenFOAM Governance Steering Committee

    • Restarted effort to integrate community developments into One OpenFOAM

    • The effort took 3 years and is now active

    OpenFOAM Project for the Future – p. 7

  • OpenFOAM Governance

    Governance Structure

    1. Steering Group

    2. Technical Committees

    • Turbulence modelling

    • Multiphase flows: Lagrangian, Eulerian

    • Marine applications

    • Numerics

    • Meshing

    • HPC / Hardware architectures

    • API and infrastructure tools

    • Documentation, tutorials, OpenFOAM learning

    • . . . others (Optimisation, etc)

    3. Release and Maintenance Committees

    4. Finance Committee

    OpenFOAM Project for the Future – p. 8

  • One OpenFOAM

    OpenFOAM Integration Effort: One OpenFOAM

    • There is a clear demand for One OpenFOAM effort

    ◦ Establish sound base open for all contributions

    ◦ Evaluate (competitive?) development effort and decide on merging

    ◦ Fund code maintenance, release cycle activities and porting

    ◦ Establish and maintain tutorial and validation suite base

    • Funding still needs to come from interested parties

    • OpenFOAM Governance Steering Committees coordinate the effort

    OpenFOAM Project for the Future – p. 9

  • Planning Hull Simulation

    OpenFOAM Project for the Future – p. 10

  • Planning Hull Simulation

    Overview of Interface Capturing Techniques (in the Naval Hydro Pack)

    • Conflicting requirements: no optimal scheme exists to cover all needs

    • Available surface capturing schemes

    ◦ Algebraic Volume–of–Fluid (A–VOF),

    ◦ Implicitly Redistanced Level Set (IR–LS),

    ◦ Geometric Volume–of–Fluid (G–VOF):

    isoAdvector by Johan Roenby.

    • Overview of scheme capability

    Advection scheme A-VOF IR-LS G-VOF

    Mass conservation ✓ ✗ ✓

    Exceeding Courant number limit ✓ ✓ ✗

    Control of interface smearing ✗ ✓ ✓

    • Loss of sharp interface has severe consequences: ventilation

    • Dynamic sinkage, trim and resistance are impossible to evaluate reliably

    OpenFOAM Project for the Future – p. 11

  • Planning Hull Simulation

    Ghost Fluid Method: Parasitic Jet in Regular Wave Propagation

    Conditional averaging (left) ; Ghost Fluid Method (right)

    OpenFOAM Project for the Future – p. 12

  • Planning Hull Simulation

    Hydro-Structure Coupling

    OpenFOAM Project for the Future – p. 13

  • Planning Hull Simulation

    Enhanced Hydro-Structure Coupling: CPU Time Reduction

    • Enhanced coupling: Integrate 6-DOF equations after each pressure correction

    equation and update wall velocity BC

    • Monolithic coupling: 6 DOF solved as a constraint in the p-equation

    • Both speed up convergence; monolithic coupling not necessary for seakeeping

    • Monolithic coupling is used for violent motions (large added mass and

    acceleration)

    2 4 6 8 10 12 14

    NnCorr

    0.85

    0.9

    0.95

    z 1/η

    PartitionedMonolithicExperiment

    2 4 6 8 10 12 14

    NnCorr

    -110

    -105

    -100

    -95

    -90

    γ z1,

    o

    OpenFOAM Project for the Future – p. 14

  • Planning Hull Simulation

    Validation: Ventilating Fast Hull at High Froude Numbers (Fn ≈ 2)

    • Specially designed hull with a step: ventilating region reduces resistance

    OpenFOAM Project for the Future – p. 15

  • Planning Hull Simulation

    Validation: SOPHYA Project: Sea-Keeping for Fast Hulls

    • Modelling, towing tank experiments and full-scale sea trials for a fast hull in calm

    water and in waves

    • Combination of model-scale and full-scale CFD simulations

    • Collaboration with Uni Trieste and Monte Carlo Yachts

    OpenFOAM Project for the Future – p. 16

  • Compressible Two Phase Model

    OpenFOAM Project for the Future – p. 17

  • Compressible Two Phase Model

    Compressible Two Phase Free Surface Formulation

    • Water is considered incompressible, while air is modelled as an ideal adiabatic

    compressible gas

    • Ghost Fluid Method is employed to provide a sharp change of fluid properties

    including compressibility

    • Emphasis on volumetric compressibility effects

    • The formulation provides fast and accurate simulations without a loss in efficiency

    comparing to its counterpart incompressible formulation

    • Applicable to general industrial problems in coastal and naval engineering

    OpenFOAM Project for the Future – p. 18

  • Compressible Two Phase Model

    Compressible Breaking Wave Impact

    • Excellent agreement of the force

    peak,

    • Pressure oscillations are damped

    more quickly in the experiment →

    holes in the wall? structural re-sponse?

    OpenFOAM Project for the Future – p. 19

  • Numerics

    OpenFOAM Project for the Future – p. 20

  • Numerics: Immersed Boundary

    Immersed Boundary Surface

    • IB implementation relies on the imposition of the boundary condition in the bulk of

    the mesh: this is built into the discretisation matrix

    • Objective: implement the influence of the presence of a boundary within the mesh

    as if the mesh consists of polyhedral body-fitted cells:

    ◦ Introduce the “new” IB face in the cut cell

    ◦ Account for the partial cell volume without loss of accuracy

    ◦ Account for partial face areas without loss of accuracy

    ◦ Calculate face and cell centre consistent with cell cut

    • . . . without changing the geometric mesh at all!

    Advantages and Disadvantages

    • IBS can eliminate volume mesh generation altogether

    • Possible combination of body-fitted mesh and IB appendages or moving parts

    • Due to wall functions, turbulent viscous force is (slightly) less accurate with IB

    OpenFOAM Project for the Future – p. 21

  • Numerics: Immersed Boundary

    Immersed Boundary Surface: Methodology

    Fluid cells: untouched

    Solid cells: deactivated

    IBS: intersected cells

    Adjusted IBS centres

    Background cell

    Corrected face centre

    Corrected cell centre

    Immersed face centre

    • Immersed boundary patch is included into the mesh via the distance function: all

    cells that straddle the immersed boundary remain active

    • STL resolution or quality is not important: only using nearest distance

    • Immersed intersection calculated based on point distance

    ◦ All faces and cells are cut by a distance plane

    ◦ Simple planar cutting provides robustness: no feature edges

    OpenFOAM Project for the Future – p. 22

  • Numerics: Immersed Boundary

    ONR Tumblehome Ship Hull: Body-Fitted vs Immersed Boundary

    • Complete appended hull using Immersed Boundary: viscous drag test

    OpenFOAM Project for the Future – p. 23

  • Numerics: Immersed Boundary

    ONR Tumblehome Ship Hull: Body-Fitted vs Immersed Boundary

    • ONR Tumblehome Ship from the Tokyo 2015 Workshop on Naval Hydrodynamics

    • Bare hull in full scale at Fr = 0.2

    • Comparison of a body fitted mesh simulation and immersed boundary

    • No dynamic sinkage and trim, and no turbulence modelling (still working on that)

    • Result: Resistance comparison

    Mesh structure Resistance [kN]

    Body Fitted Mesh 98.0 kN

    Immersed Boundary 92.0 kN

    • Notes

    ◦ The complete hull is modelled as Immersed Boundary: this is a test!

    ◦ No near-wall prismatic layers: wall functions see fluctuating y+

    ◦ Immersed boundary solver significantly faster: no small cells for CFL limit

    ◦ Intended use for IB patches are appendage geometries, not the complete hull

    OpenFOAM Project for the Future – p. 24

  • Numerics: Immersed Boundary

    ONR Tumblehome Ship Hull: Body-Fitted vs Immersed Boundary

    OpenFOAM Project for the Future – p. 25

  • Numerics: Immersed Boundary

    ONR Tumblehome Ship Hull: Body-Fitted vs Immersed Boundary

    OpenFOAM Project for the Future – p. 26

  • Numerics: Immersed Boundary

    Self-Propulsion in Calm Water (Preliminary Study)

    • Self–propulsion in calm water

    • PID controller for propeller rotation rate to achieve the desired ship speed

    • Two propellers modelled with patch–type actuator disk model

    • Static rudders modelled with Immersed Boundary

    • Hull and static appendages are body fitted

    OpenFOAM Project for the Future – p. 27

  • Numerics: Immersed Boundary

    Course-Keeping Test: Combined Body-Fitted and Immersed Boundary Mesh

    • Free–running model with propellers at constant rotation rate

    • Path offset at time zero to test the rudder controllers and the immersed boundary

    OpenFOAM Project for the Future – p. 28

  • Numerics: Overset Mesh

    Overset Mesh: Course Keeping in Irregular Waves: DTMB 5415-M

    OpenFOAM Project for the Future – p. 29

  • Numerics: Overset Mesh

    Overset Mesh: Course Keeping in Irregular Waves: DTMB 5415-M

    • Fully appended DTMB 5415-M hull

    • Self-propelled course keeping in irregular sea state

    • Irregular wave field corresponds to a significant wave height of 7.5m with a peak

    period of 9 s in full scale

    • Heading is 300 degrees (port-side stern-quartering)

    • Full scale speed is 24 knots

    CFD Simulation Settings

    • Model size: 4m. (142m full scale)

    • 5 million cell Overset mesh with 4 components

    • Overset mesh system rigged for full capsize

    OpenFOAM Project for the Future – p. 30

  • Numerics: Overset Mesh

    Overset Mesh: Course Keeping in Irregular Waves: DTMB 5415-M

    OpenFOAM Project for the Future – p. 31

  • Turbomachinery CFD

    OpenFOAM Project for the Future – p. 32

  • Turbomachinery CFD

    Support for Turbomachinery CFD in foam-extend

    • Complex rotor-stator interfaces, for all physics models: GGI, mixing plane

    • Incompressible and compressible turbulent flow, MRF and transient

    • Complex mesh motion or geometrical scaling (eg pitch-matching)

    • Validation and verification: propellers, pumps, turbines, fans, compressors

    OpenFOAM Project for the Future – p. 33

  • Turbomachinery CFD

    Harmonic Balance Method

    • Harmonic Balance method is a quasi-steady state method developed for

    simulation of non-linear temporally periodic flows

    • In rotating turbomachinery and other applications, engineering flows exhibit regular

    periodicity: wish to describe stable periodical behaviour

    • Replacing a transient problem with a set of coupled “steady-state” snapshots by

    virtue of using periodicity of the time-signal in:

    ◦ Boundary conditions

    ◦ Geometry or relative motion

    ◦ Flow solution

    Harmonic Balance Method: Work-Flow

    • Variables are developed into Fourier series in time with n-harmonics andsubstituted into transport equation

    • Transport equation with n sine and n cosine parts + mean part is obtained and

    written as a set of 2n+ 1 equations in frequency domain

    • Equations are transformed back to time domain in order to be able to use

    time-domain boundary conditions and time-domain non-linear flow solver

    OpenFOAM Project for the Future – p. 34

  • Turbomachinery CFD

    Harmonic Balance for a Water Jet Propulsor

    OpenFOAM Project for the Future – p. 35

  • Turbomachinery CFD

    Water Jet Propulsor: Flow Conditions

    • Six-bladed rotor, at 2000 rpm; eight-bladed stator

    • Turbulent flow with steady inlet condition, u = 11.43m/s

    • No experimental data available: real water jet cavitates at this flow rate

    Mesh Layout

    • Full annulus with resolved blade tip clearance: 2,153,424 hexahedral cells

    • Two domains: rotor and stator connected using a GGI interface

    Frozen Rotor MRF Simulation: Coupled Solver

    • Rapid and smooth convergence in 150 iterations: 4 hours on a laptop computer

    Transient Simulation

    • Transient simulation completely impractical due to small mesh size at tip clearance

    with large velocities

    • Typical ∆t = 5e− 05 s; time for 1 period = 0.08 s

    • Transient run: 4 weeks on a workstation (small mesh)

    Harmonic Balance Simulation

    • Performing HB simulations with 1, 2 and 7 harmonics

    OpenFOAM Project for the Future – p. 36

  • Turbomachinery CFD

    Harmonic Balance for a Water Jet Propulsor

    • Temporal variation of head and efficiency: 1 and 2 harmonics

    0 0.01 0.02 0.03Time, s

    22

    22.5

    23

    23.5

    24

    Hea

    d,

    m

    HB, 1hHB, 2h

    0 0.01 0.02 0.03Time, s

    82

    83

    84

    85

    86

    87

    88

    89

    Eff

    icie

    ncy

    , %

    HB, 1hHB, 2h

    Water Jet: Future Work

    • Further validation & verification work ongoing

    • It is possible to extend the HB model to cavitating flow

    OpenFOAM Project for the Future – p. 37

  • Coupled Solver

    1e-08

    1e-07

    1e-06

    1e-05

    1e-04

    1e-03

    1e-02

    1e-01

    1e+00

    0 500 1000 1500 2000 2500

    Res

    idual

    Iteration

    Ux (simpleFoam)

    Uy (simpleFoam)

    Uz (simpleFoam)

    p (simpleFoam)

    BiCGStab UxBiCGStab Uy

    BiCGStab UzBiCGStab p

    SAMG UxSAMG UySAMG Uz

    SAMG p

    OpenFOAM Project for the Future – p. 38

  • Coupled Solver

    Turbulent Steady Incompressible Flows: SIMPLE or Coupled System

    • Equation set contains linear p-U and non-linear U-U coupling

    ∂u

    ∂t+∇•(uu)−∇• (ν∇u) = −∇p

    ∇•u = 0

    • Traditionally, this equation set is solved using the segregated SIMPLE algorithm

    ◦ Low memory peak: solution + single scalar matrix in peak storage

    ◦ p-U coupling is handled explicitly: loss of convergence (under-relaxation)

    ◦ Number of iterations is substantial; not only due to non-linearity

    ◦ Convergence dependent on mesh size: SIMPLE slows down on large meshes

    • Block-implicit p-U coupled solution

    ◦ Coupled solution significantly increases matrix size: 4 blocks instead of 1

    ◦ . . . but the linear p-U coupling is fully implicit!

    ◦ Iteration sequence only needed to handle the non-linearity in the U-equation

    ◦ Net result: significant convergence improvement (steady or transient) at a

    cost of increase in memory usage: reasonable performance compromise!

    OpenFOAM Project for the Future – p. 39

  • Coupled Solver

    Performance of the Coupled p-U Solver: Submarine Flight, 14M Cells

    OpenFOAM Project for the Future – p. 40

  • Coupled Solver

    DrivAer Geometry: External Aerodynamics, Coupled Solver, 13.2M Cells

    OpenFOAM Project for the Future – p. 41

  • Coupled Solver

    Water Jet: Steady-State Frozen Rotor, MRF Solution, Coupled Solver: Convergence

    History

    OpenFOAM Project for the Future – p. 42

  • Coupled Solver

    Water Jet: Steady-State Frozen Rotor, MRF Solution, Coupled Solver

    OpenFOAM Project for the Future – p. 43

  • Summary

    Summary

    • OpenFOAM and Open Source software infrastructure allows us to leverage

    existing technology and deliver custom solution to clients, either via tools

    development or by developing, implementing and validating new physical and

    numerical models

    • A two-stage approach is needed: academic research + industrial deployment

    • (In my work):

    ◦ Wikki handles contracts where industrial collaboration is sought, either

    through support, custom development, training, process integration or

    collaborative simulation work

    ◦ Uni Zagreb has the capability of providing research support via industrial

    collaboration projects, funded or joint PhD research projects or direct

    collaboration

    • Strength of OpenFOAM is in collaborative Open Source: careful management is

    needed to secure the future

    OpenFOAM Project for the Future – p. 44

  • NUMAP-FOAM Summer School

    NUMAP-FOAM Summer School 2019

    • 14th Edition of NUMAP-FOAM Summer School: 19-30/Aug/2019https://www.fsb.unizg.hr/numap

    The idea of the Summer School is to expand the physical modelling

    knowledge, numerics and programming skills of attendees using

    OpenFOAM in their research through direct supervision and one-to-one

    work.This is NOT an introductory OpenFOAM course: significant

    understanding of the project and software is a pre-requisite for

    application.

    • The School accepts 10-15 attendees bringing their own projects to the School over

    a period of 10 working days

    • Work is embedded in the research group with 4–6 tutors providing daily one-to-one

    attention

    • School is open to “young researchers” (typically PhD students) but also to

    industrial users, government labs and professors

    • Strong follow-up collaboration and extensive publication lists

    • Approx 170 attendees to NUMAP-FOAM, from the start in 2008

    OpenFOAM Project for the Future – p. 45

    OutlineAbout MeAbout MeOpenFOAM and CFD in 2020Mission and VisionOpenFOAM GovernanceOpenFOAM GovernanceOne OpenFOAMPlanning Hull SimulationPlanning Hull SimulationPlanning Hull SimulationPlanning Hull SimulationPlanning Hull SimulationPlanning Hull SimulationPlanning Hull SimulationCompressible Two Phase ModelCompressible Two Phase ModelCompressible Two Phase ModelNumericsNumerics: Immersed BoundaryNumerics: Immersed BoundaryNumerics: Immersed BoundaryNumerics: Immersed BoundaryNumerics: Immersed BoundaryNumerics: Immersed BoundaryNumerics: Immersed BoundaryNumerics: Immersed BoundaryNumerics: Overset MeshNumerics: Overset MeshNumerics: Overset MeshTurbomachinery CFDTurbomachinery CFDTurbomachinery CFDTurbomachinery CFDTurbomachinery CFDTurbomachinery CFDCoupled SolverCoupled SolverCoupled SolverCoupled SolverCoupled SolverCoupled SolverSummaryNUMAP-FOAM Summer School