## Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

Hrvoje Jasak

h.jasak@wikki.co.uk, hrvoje.jasak@fsb.hr

Wikki Ltd, United Kingdom FSB, University of Zagreb, Croatia 10th January 2008

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.1/26

Background

Objective • Present an open source CFD simulation platform based on fundamental ideas of object orientation, layered software design and equation mimicking Topics 1. Implementing complex physical models through equation mimicking 2. OpenFOAM: Object-oriented software for Computational Continuum Mechanics 3. Layered software development and open source collaboration platform 4. Some illustrative examples 5. Development of in-house simulation tools 6. Summary

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.2/26

**Open Source CFD Platform
**

Open Source Computational Continuum Mechanics • Commercial CFD dominates the landscape: a complete code with sufﬁcient efﬁciency, parallelism, mesh handling and pre- and post- utilities is a large project • Targeted at industrial user and established physics. Can we extend the scope? • Complete CFD methodology is already in the public domain (research papers, model formulation, numerical schemes, linear equation solvers etc.) • Objective: open source implementation of existing knowledge and an object-oriented platform for easy and collaborative future development 1. Completely open software platform using object-oriented design 2. Extensive modelling capabilities in library form: component re-use 3. Fast, robust and accurate numerical solver 4. State-of-the-art complex geometry handling 5. Collaborative and project-driven model development • This furthers the research and collaboration by removing proprietary software issues: complete source code and algorithmic details available to all • . . . but the mode of operation changes considerably

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.3/26

**Object-Oriented Numerics for CCM
**

Flexible Handling of Arbitrary Equations Sets • Natural language of continuum mechanics: partial differential equations • Example: turbulence kinetic energy equation ∂k + ∇•(uk) − ∇•[(ν + νt )∇k] = νt ∂t » 1 (∇u + ∇uT ) 2 –2 ǫo k ko

−

**• 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

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.4/26

Object Orientation

Object-Oriented Software: Create a Language Suitable for the Problem • Analysis of numerical simulation software through object orientation: “Recognise main objects from the numerical modelling viewpoint” • Objects consist of data they encapsulate and functions which operate on the data Example: Sparse Matrix Class • Data members: protected and managed ◦ Sparse addressing pattern (CR format, arrow format) ◦ Diagonal coefﬁcients, off-diagonal coefﬁcients • Operations on matrices or data members: Public interface ◦ Matrix algebra operations: +, −, ∗, /, ◦ Matrix-vector product, transpose, triple product, under-relaxation • Actual data layout and functionality is important only internally: efﬁciency Example: Linear Equation Solver • Operate on a system of linear equations [A][x] = [b] to obtain [x] • It is irrelevant how the matrix was assembled or what shall be done with solution • Ultimately, even the solver algorithm is not of interest: all we want is new x! • Gauss-Seidel, AMG, direct solver: all answer to the same interface

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.5/26

**Model-to-Model Interaction
**

Common Interface for Model Classes • Physical models grouped by functionality, e.g. material properties, viscosity models, turbulence models etc. • Each model answers the interface of its class, but its implementation is separate and independent of other models • The rest of software handles the model through generic interface: breaking the complexity of the interaction matrix

class turbulenceModel { virtual volTensorField R() const = 0; virtual fvVectorMatrix divR ( volVectorField& U ) const = 0; virtual void correct() = 0; };

**• New turbulence model implementation : Spalart-Allmaras 1-equation model
**

class SpalartAllmaras : public turbulenceModel { // Model implementation lives here };

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.6/26

**Model-to-Model Interaction
**

Common Interface for Model Classes • Model user only sees the virtual base class • Example: steady-state momentum equation with turbulence

autoPtr<turbulenceModel> turbulence ( turbulenceModel::New(U, phi, laminarTransport) ); fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(phi, U) + turbulence->divR(U) == - fvc::grad(p) ); UEqn.solve();

• Implementation of a new model does not disturb existing models • Consumer classes see no changes whatsoever, just a new model choice

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.7/26

**Top-Level Solver Code
**

Application Development in OpenFOAM • Custom-written top-level solvers are written for each class of physics • Solvers are optimised for efﬁciency and storage, re-using basic components • Writing top-level code is very similar to manipulating the equations • Ultimate user-coding capabilities: components can be re-used to handle most problems in computational continuum mechanics Layered Development • Design encourages code re-use: developing shared tools • Classes and functional components developed and tested in isolation ◦ Vectors, tensors and ﬁeld algebra ◦ Mesh handling, reﬁnement, mesh motion, topological changes ◦ Discretisation, boundary conditions ◦ Matrices and linear solver technology ◦ Physics by segment in library form • Library level mesh, pre-, post- and data handling utilities • Model-to-model interaction handled through common interfaces • New components do not disturb existing code: fewer bugs

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.8/26

Mesh Handling

Mesh Conversion Tools • OpenFOAM does not provide integrated meshing: work in progress • Polyhedral mesh support makes for easy mesh conversion • Mesh converters for STAR-CD (Pro-Am), Fluent (Gambit, T-Grid), Ansys etc.

Automatic Mesh Generation • Meshing projects in OpenFOAM: Cartesian base with boundary interaction, polyhedral dual mesh. Methods based on oct-tree build: parallelisation! • Mesh generated from STL surface, with parameters for resolution control

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.9/26

**Automatic Mesh Generation
**

Integrated Automatic Meshing • The FVM method allows polyhedral support: fewer cells per volume, minimal distortion, near-wall layers, richer connectivity • Polyhedral cell support, combined with automatic mesh motion and topological changes gives a state-of-the-art mesh handling module • Avoiding user-interaction: reliable automatic meshing

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.10/26

**Automatic Mesh Motion
**

Handling Shape Change: Problem Speciﬁcation • Initial valid mesh is available • Time-varying boundary motion ◦ Prescribed in advance: e.g. IC engines ◦ Part of the solution: surface tracking • Need to determine internal point motion based on prescribed boundary motion • Mesh in motion must remain valid: face and cell ﬂip must be prevented by the algorithm Solution Technique • Point position will be provided by solving an equation given boundary motion conditions • Cell-based methods fail in interpolation; spring analogy unreliable • Choosing vertex-based (FEM) discretisation with polyhedral cell support: mini-element technique • Choice of equation: Laplace or pseudo-solid Solution-dependent mesh motion: solving equations for mesh deformation

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.11/26

**Prescribed Mesh Motion
**

Prescribed Mesh Motion • Domain shape is changing during the simulation in a prescribed manner • Motion is known and independent of the solution • . . . but it is usually only prescribed at boundaries • Deﬁnition of moving mesh involves point position and mesh connectivity for every point and cell for every time-step of the simulation. This is typically deﬁned with reference to a pre-processor or parametrically in terms of motion parameters (crank angle, valve lift curve, etc.) • “Dynamic” mesh changes are out of the question: eg. mesh reﬁnement • Can we simplify prescription of mesh motion?

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.12/26

**Automatic Mesh Motion
**

Hydrofoil Under A Free Surface • Flow solver gives surface displacement • Mesh adjusted to free surface position Single Solver, Complex Coupling • FVM on moving meshes • Automatic mesh motion • FAM: Surface physics

vb = −vF

**Free-Rising Air Bubble with Surfactants • Two meshes coupled on free surface
**

vF SB SA y′ o′ aF x′

rF y o x

Free surface

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.13/26

**Large Eddy Simulation
**

LES for Aero-Acoustic Noise Generation on a Rain Gutter • 3-D and transient simulation, incompressible Navier-Stokes model, segregated pressure-velocity solver • Sufﬁcient mesh resolution to capture energy-containing scales of turbulence. Efﬁcient linear equation solvers and massive parallelism • Second-order energy-conserving numerics in space and time • Sub-grid scale model library: 15 models on run-time selection • Field mapping and data analysis tools, e.g. inlet data mapping for realistic inlet turbulence; on-the-ﬂy sampling and averaging

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.14/26

**Multi-Phase Free Surface Flow
**

Two-Phase Incompressible Fluid System • Modelling two-ﬂuid system with a sharp interface • Complete domain treated as a single continuum, with a jump in properties at the interface between ﬂuids • Interface position tracked using an indicator variable γ: surface capturing approach, also know as Volume Of Fluid (VOF) • Surface tension term: pressure jump across the interface. Single pressure and single momentum equation for complete continuum ∂γ + ∇•(uγ) = 0 ∂t ∇•u = 0 ∂ρu + ∇•(ρuu) − ∇•σ = −∇p + ρf + σκ∇γ ∂t u = γu1 + (1 − γ)u2 µ, ρ = γρ1 + (1 − γ)ρ2

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.15/26

**Multi-Phase Free Surface Flow
**

Leading Surface Capturing Solver • Efﬁcient handling of interface breakup • Accurate handling of dominant surface tension: no parasitic velocity • OpenFOAM solver: interFoam, rasInterFoam, no modiﬁcations Ink-Jet Printer Nozzle, d = 20µm: Breakup Under Dominant Surface Tension

Complex Surface Breakup Phenomena: Sloshing and wet wall impact

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.16/26

**Free Surface LES
**

LES of a Diesel Injector • Injection of Diesel fuel into the atmosphere and subsequent breakup • d = 0.2mm, high velocity and surface tension • Mean injection velocity: 460m/s injected into air, 5.2MPa, 900K • 1.2 to 8 million cells, aggressive local mesh reﬁnement • 50k time-steps, 6µs initiation time, 20µs averaging time • OpenFOAM solver: lesInterFoam, no modiﬁcations

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.17/26

**Fluid-Structure Interaction
**

Solution Techniques for Coupled Problems • Partitioned approach: Picard iterations ◦ Optimal for weakly coupled FSI problems ◦ Separate mathematical model for ﬂuid and solid continua ◦ Shared or different discretisation method: FVM and FEM ◦ Coupling achieved by enforcing the kinematic and dynamic conditions on the ﬂuid-solid interface ◦ Strong coupling by additional iteration loop over partial solvers (need a convergence acceleration method) • Monolithic approach: Simultaneous solution ◦ Appropriate when ﬂuid-structure interaction is very strong ◦ Good stability and convergence properties ◦ In some cases may lead to ill-conditioned matrices or sub-optimal discretisation or solution procedure in ﬂuid or solid region Levels of Fluid-Structure Coupling • Uniﬁed mathematical model: single equation set for ﬂuid and structure • Uniﬁed discretisation method and boundary coupling consistency • Uniﬁed solution procedure: ﬂuid + structure matrix solved in a single solver

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.18/26

**Fluid-Structure Interaction
**

ALE FVM Fluid Flow Solver • Continuity and momentum equation for incompressible ﬂow in ALE formulation • Space conservation law; automatic mesh motion solver: Laplace equation • Collocated 2nd order FVM for ﬂow and 2nd order FEM for mesh motion Updated Lagrangian FVM Solver • Incremental momentum equation in updated Lagrangian formulation Z

Vu

∂δv dVu − ρu ∂t

I

Su

nu •(2µ + λ)∇δu dSu =

I

Su

nu •q dSu

Levels of Fluid-Structure Coupling • Uniﬁed mathematical model: single equation set (prof. Ivankovi´ , UC Dublin) c • Uniﬁed discretisation method and boundary coupling consistency • Uniﬁed solution procedure: ﬂuid + structure matrix solved in a single solver Data Transfer • Data transfer and coupling signiﬁcantly easier: both domains in the same solver • Data interpolation routines already available: patch-to-patch interpolation

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.19/26

**Fluid-Structure Interaction
**

Cantilevered Beam Vibration in an Oscillating Flow Field

Effect of Under-Relaxation ρs /ρf 10 1 Number of outer iterations per time-step Fixed under-relaxation Adaptive under-relaxation 30 60 6 12

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.20/26

**Liquid Film Model
**

Solution of Surface-Based Equations: Finite Area Method • Liquid ﬁlm model: shallow water model on a curved surface with surface tension • Example: collapse of ﬁve surface blobs under surface tension and gravity

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.21/26

**Vehicle Soling Simulation
**

Vehicle Soling Simulation: Coupled Eulerian, Lagrangian and Wall Transport Model • Continuous phase: external aerodynamics ﬂow model; coupled or uncoupled • Lagrangian tracking for droplets: drag, pressure term, gravity • Liquid ﬁlm model capturing surface transport • Droplet re-ejection on sharp edges and liquid ﬁlm stripping add further droplets

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.22/26

**In-House Simulation Tools
**

Tailored In-House Tools For Computational Continuum Mechanics • OpenFOAM is developed as a library of tools, rather than integrated executable • Extensive physics solver capabilities: ◦ Ready-to-use (ﬂow) solver with performance matching commercial CFD ◦ Open code for modiﬁcation to suit the needs ◦ Examples of complex physics solvers • Users regularly combine multiple applications, eg. ◦ Incompressible turbulent free surface ﬂow solver (VOF) + Automatic mesh motion + 6 degrees-of-freedom solid body motion solver • Combination of extensive capabilities and open architecture creates efﬁcient platform for tailored use

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.23/26

**Deployment and Support
**

Deployment and Support • OpenFOAM developed mainly on Linux/Unix: Windows and Mac OS X ports also exist but are not widely used. This needs to be improved (new initiative: OpenFOAM-extend) • Data input/output is in ﬁle form: there is no global graphical user interface that can be tailored to sufﬁcient level of usability (work in progress) • No built-in 3-D graphics; 2-D, graphing and sampling tools present • External post-processing with integrated readers: paraFoam (open source)

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.24/26

Summary

Project Status Summary • OpenFOAM is a free software, available to all at no charge: GNU Public License • Object-oriented approach facilitates model implementation • Equation mimicking opens new grounds in Computational Continuum Mechanics • Extensive capabilities already implemented; open design for easy customisation • Solvers are validated in detail and match the efﬁciency of commercial codes OpenFOAM in Research and Industry • Second OpenFOAM Workshop: Zagreb Croatia, Jun/2007. 100 attendees in 2007 • Leading research/development centres: FSB Zagreb, Chalmers University, Sweden; Politecnico di Milano, University College Dublin, Penn State University; new groups joining research and contributing code • Major development through US Research Labs: National Energy Technology Lab (NETL), US Dept. of Energy (MFIX-NG), Oak Ridge Labs, USA, NRC Canada • Interest greatly increased in the last three years, industry-sponsored PhD projects, study visits, funded projects or joint development • Active use in Audi, ABB Corporate Research, BAE Systems, US Navy, Shell Oil, SKF, Hitachi, Mitsubishi, Airbus, Toyota, Volkswagen and high-end consultants

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.25/26

About Me

Hrvoje Jasak • First degree: mechanical engineering, University of Zagreb, Croatia • PhD, Imperial College London 1993-1996 • Senior development engineering, CD-adapco, 1996-2000 • Technical director, Nabla Ltd. 2000-2004 • Consultant on CFD software architecture and modelling, Ansys Fluent 2000Current Work • Professor, University of Zagreb, Croatia • Director, Wikki Ltd: UK-based consultancy company • Various software development and commercial support projects based on OpenFOAM with consultants and large industrial partners • Collaboration with several Universities and government research labs on wide range of OpenFOAM activities, including naval hydrodynamics • Coordinating open source OpenFOAM development to allow contributions from the public domain developers • OpenFOAM workshops, lectures and seminars, visiting professorships (University Santa Maria, Chile, University of Zaragoza)

OpenFOAM: Open Platform for CFD and Complex Physics Simulations – p.26/26

- A Method for Capturing Sharp Fluid Interfaces on Arbitrary Meshes-Ubbink AndIssa
- OpenFoam Examples
- Inter Track
- Modena2006_LucchDerrOK
- A Multi Scale Simulation Approach for Diesel Particulate Filter Design Based on OpenFOAM and DexaSIM.
- Evaluation of OpenFOAM for CFD of Turbulent Flow in Water Turbines
- LucchiniPolyMilano
- Advanced Modelling of Elastohydrodynamic Lubrication PetraBrajdicPhD2005
- Introduction to Combustion in Diesel Engines
- ÓÑÔÐ Ü
- CFD Modelling of Elastohydrodynamic Lubrication Markus Hartinger PhD
- In-Cylinder CFD Simulation Using a C++ Object Oriented Toolkit SAE2004
- Finite Volume Methodology for Contact Problems of Linear Elastic Solids
- Compressible Solver
- A Tensorial Approach to Computational Continuum Mechanics Using Object Oriented Techniques
- Large Eddy Simulation of Premixed Turbulent Combustion Using E Flame Surface Wrinkling Model
- In-Cylinder Flows With Openfoam
- Some Experiences on the Accuracy and Parallel Performance of OpenFOAM for CFD in Water Turbines
- New High-Resolution Central Schemes for Nonlinear Conservation Laws and Convection Diffusion Equations
- Paper-Shu-CHT-08-20080214
- OpenFOAM a C++ Library for Complex Physics Simulations
- Solve Cavitating Flow Around a 2D Hydrofoil Using a User Modified Version of Inter Phase Change Foam
- VirtuhconUniFreibergOct2007
- The Computer Simulation of Dispersed Two Phase Flows David Hill Phd 1998
- Solve Cavitating Flow Around a 2D Hydrofoil With Inter Phase Change Foam
- Predicting Residual Stresses Due to Solidification in Cast Plastic Plates VladoTropsaPhD
- Particle Tracking in Unstructured, Arbitrary Polyhedral Meshes for Use in CFD and Molecular Dynamics
- Openfoam Simulation of the Flow in the Hoelleforsen Draft Tube Model
- Hrvoje Jasak UniFlorence_5Oct2007
- The Numerical Simulation of Two Phase Flow in Settling Tanks DanielBrennanPhD

Skip carousel

- Optimization of Natural Gas Mixture Design Using Computational Method for HCCI Engine by Improving Swirl Effect.
- tmp2C23
- An Overview of Vortex Tube on CFD with Straight and Helical Nozzle
- A Review on Design Optimization of Air Dam for Lift Reduction of a Car Using in Wind Tunnel and CFD Analysis
- tmp8E1D.tmp
- tmpE735.tmp
- tmp7E6C.tmp
- CFD Analysis of Enhancement of the Forced Convection Heat Transfer over the Pin Fin with Trapezoidal Fin and Flow Structure Analysis Using "ANSYS" Fluent 15.0
- tmpA98.tmp
- tmp1790.tmp
- Comparison of CFD Analysis of Heat Transfer Augmentation & Surface Heat Transfer Co-efficient of I. C. Engine Fins at Different wind Velocities with Experimental Investigation
- CFD Analysis of Convergent-Divergent Nozzle using Standard K-ÃŽâ€¢ Model
- tmpA0FB.tmp
- Lid driven cavity flow simulation using CFD & MATLAB
- tmpF4A5.tmp
- Comparative Assessment of Aerodynamic Forces Generated Due to Wind Deflector of Passenger Car by CFD and Experimental Method
- Investigation On Computational Fluid Dynamics (CFD) Simulation for Wind Effects On Tall Tapered Buildings
- Performance Improvement of Modified Omnidirectional Ducted Wind Mill
- tmpFAEF.tmp
- Multi-Dimensional Modeling of Internal Combustion Engine Processes
- CFD Trials for Comparative Evaluation and Recommendation of Nozzle Geometry for Gas Atomization of Aluminum Alloys
- tmp979.tmp
- Columbia Accident Investigation Board Volume Five Book Three
- tmpC7C7.tmp
- CFD Analysis of Air Flow Modelling in Apple Cold Storage
- tmpAB93.tmp
- CFD simulation of Lid driven cavity flow
- tmp53C2.tmp
- CFD Analysis of Flow Through T-junction an Overview
- Burnback Analysis & CFD Simulation of Finocyl Grain in Solid Propellant Rocket Motor

- Msc Thesis Hamed Aghajani Amirkabir University of Technology
- Aghajani Greece Paper 85-01-25
- MODELLING THE INITIAL SPRAY CHARACTERISTICS OF FIRE SPRINKLERS
- Theoretical Modelling of Sprinkler Sprays
- ISME2007 Full One
- Hamed Aghajani-CFES Development Day-290110
- Tunesia Ganz Total-86!02!24
- Sprinkler Spray Modelling - Hamed Aghajani
- Liquid H2 Jet Revised 080409x
- Sprinkler Spray Modelling
- 2007_Jan_2812_01
- Dimensionless study of spray formed by impinging jets over a flat deflector
- Cfd Modeling of Fire Suppression
- Analytical Modeling of Flame Kernel Formation and Development
- The Potential of Large Eddy Simulation for the Modeling of Wall Bounded Flows EugeneDeVilliersPhD2006
- On Modelling the Mass of Arctic Sea Ice JennyHutchingsPhD
- Using Openfoam to Model Energy Taken From the Swirl Behind a Car
- Particle Tracking in Unstructured, Arbitrary Polyhedral Meshes for Use in CFD and Molecular Dynamics
- Some Experiences on the Accuracy and Parallel Performance of OpenFOAM for CFD in Water Turbines
- Paper-Shu-CHT-08-20080214
- Solve Cavitating Flow Around a 2D Hydrofoil Using a User Modified Version of Inter Phase Change Foam
- VirtuhconUniFreibergOct2007
- The Computer Simulation of Dispersed Two Phase Flows David Hill Phd 1998
- OpenFOAM Tutorial Free Surface Tutorial Using InterFoam and RasInterFoam Hassan_Hemida_VOF
- Solve Cavitating Flow Around a 2D Hydrofoil With Inter Phase Change Foam
- Predicting Residual Stresses Due to Solidification in Cast Plastic Plates VladoTropsaPhD
- Particle Tracking in Unstructured, Arbitrary Polyhedral Meshes for Use in CFD and Molecular Dynamics
- Surface Capturing in Droplet Breakup and Wall Interaction
- Openfoam Simulation of the Flow in the Hoelleforsen Draft Tube Model
- The Numerical Simulation of Two Phase Flow in Settling Tanks DanielBrennanPhD

Sign up to vote on this title

UsefulNot usefulClose Dialog## Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

Close Dialog## This title now requires a credit

Use one of your book credits to continue reading from where you left off, or restart the preview.

Loading