Object-Oriented CFD Solver Design: Hrvoje Jasak
Object-Oriented CFD Solver Design: Hrvoje Jasak
Hrvoje Jasak
[email protected]
Outline
Objective Present new approach to software design in Computational Continuum Mechanics Topics A new approach to model representation Object-orientation in numerical simulation software: code re-use and layered design Examples of complex model implementation
Background
State of the Art Numerical modelling is becoming a part of product design Improved computing performance Improved modelling Sufcient validation and experience Two-fold requirements Ease of use and process integration Quick and reliable model implementation
Software Design
Physics-based approach Traditional view of the problem Well dened physics, studied in isolation Clearly dened objective Numerical software sometimes limiting design: e.g. Lockheed Martin F-117 Stealth Typically handled by monolithic software with well-dened capabilities
Software Design
Application-based approach A collection of components involving various physics phenomena (beyond CFD) Complex model-to-model interaction Complex simulation and optimisation objectives, unexpected conclusions Made-to-measure modelling Requires more exible software design: can object orientation help?
(uk) t
[( + t ) k] =
2
1 ( u+ 2
u )
ko
Geometry Handling
Complex geometry requirements Complex geometry is a rule, not exception Polyhedral cell support Cell described as a polyhedron bounded by polygons Consistent handling of all cell types More freedom in mesh generation Recent developments: polyhedral FVM provides equivalent accuracy at lower cost
Geometry Handling
Geometry Handling
Time-varying geometry cases Automatic mesh motion Topological mesh changes with poly support
Speed of Execution
Handling large-scale computations Efcient numerics Best discretisation practice for a given problem Iterative solvers almost inevitable Careful analysis of non-linearity and inter-equation coupling Massive parallelism: domain decomposition
Layered Development
Design encourages code re-use: shared tools Code developed and tested in isolation Vectors, tensors and eld algebra Mesh handling, renement, topo changes Discretisation, boundary conditions Matrices and solver technology Physics by segment Custom applications Ultimate user-coding capabilities!
Examples of Application
Objective: illustrate examples of FOAM library in use Diesel Combustion: Scania D-12 Engine Free surface ow modelling Capillary jets, LES + free surface Surface tracking: rising bubble Solid-uid interaction: plastic pipeline failure
Diesel Combustion
Diesel Combustion in Scania D-12 Engine 1/8 sector with 75 % load and n-heptane fuel RANS, k turbulence model, simplied 5-species chemistry and 1 reaction, Chalmers PaSR combustion model Temperature on a cutting planes Spray droplets coloured with temperature
Diesel Combustion
Diesel Combustion in Scania D-12 Engine
Capillary Jet
Ink-jet printer nozzle, 20m diameter Pulsating ow, umean = 20m/s Tuning frequency (50kHz) and amplitude (5%)
Diesel Injector
LES of a Diesel Injector d = 0.2mm, high velocity and surface tension Mean injection velocity: 460m/s Diesel fuel injected into air, 5.2MPa, 900K Turbulent and subsonic ow, no cavitation 1-equation LES model with no free surface correction Fully developed pipe ow inlet
Diesel Injector
Mesh size: 1.2 to 8 million CVs, aggressive local renement, 50k time-steps 6s initiation time, 20s averaging time
Surface tracking
vb = vF
Free surface tracking 2 phases = 2 meshes Mesh adjusted for interface motion Coupled b.c. Air-water system 2-D: rb = 0.75 mm 3-D: rb = 1 mm
vF SB SA
y o
aF x
rF y o x
Free surface
Surfactant Effect
Clean surface
Complex coupling problem: FVM ow solver + FEM mesh motion + FAM surfactants
Fluid-Solid Coupling
Pipeline failure: crack propagation and leakage
Fluid-Solid Coupling
Enlarged deformation of the pipe
Other Capabilities
FOAM contains other capabilities as well RANS and LES turbulence modelling Thermophysical and transport model libraries A-posteriori error estimation Adaptive mesh renement Software used for algorithm and numerics research: excellent numerics and pre-implemented models
Summary
Object-oriented approach facilitates model implementation: layered design + re-use Equation mimicking opens new CCM grounds Extensive capabilities already implemented Open design for easy user customisation
Acknowledgements Scania engine: Dr. Niklas Nordin, Chalmers University Sweden Spray breakup: Eugene de Villiers, Imperial College Cracking pipe: Dr. Vlado Tropa, prof. A Ivankovi c, UC Dublin Foam and OpenFOAM are released under GPL: http://www.openfoam.org