Quality and Reliability in CFD



Similar documents
OpenFOAM Optimization Tools

HPC Deployment of OpenFOAM in an Industrial Setting

OpenFOAM: Open source CFD in research and industry

OpenFOAM Workshop. Yağmur Gülkanat Res.Assist.

ME6130 An introduction to CFD 1-1

Express Introductory Training in ANSYS Fluent Lecture 1 Introduction to the CFD Methodology

Recent Developments in OpenFOAM

Customer Training Material. Lecture 2. Introduction to. Methodology ANSYS FLUENT. ANSYS, Inc. Proprietary 2010 ANSYS, Inc. All rights reserved.

Computational Fluid Dynamics in Automotive Applications

Current Development Work in OpenFOAM

POLITECNICO DI MILANO Department of Energy

OpenFOAM: Introduction, Capabilities and HPC Needs

CONVERGE Features, Capabilities and Applications

Multiphase Flow - Appendices

OpenFOAM Opensource and CFD

Introduction to CFD Analysis

OpenFOAM: Open Platform for CFD and Complex Physics Simulations

XFlow CFD results for the 1st AIAA High Lift Prediction Workshop

NUMERICAL SIMULATION OF REGULAR WAVES RUN-UP OVER SLOPPING BEACH BY OPEN FOAM

Introduction to CFD Analysis

OpenFOAM: Year in Review

Implementation of a flexible fiber model in a general purpose CFD code

Self Financed One Week Training

Overset Grids Technology in STAR-CCM+: Methodology and Applications

CFD with OpenSource software

2013 Code_Saturne User Group Meeting. EDF R&D Chatou, France. 9 th April 2013

Automated moving mesh techniques in CFD

This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM and OpenCFD trade marks.

Advanced discretisation techniques (a collection of first and second order schemes); Innovative algorithms and robust solvers for fast convergence.

CFD modelling of floating body response to regular waves

MEng, BSc Applied Computer Science

How To Run A Cdef Simulation

Model of a flow in intersecting microchannels. Denis Semyonov

Aeroacoustic Analogy for the Computation of Aeroacoustic Fields in Partially Closed Domains

MEng, BSc Computer Science with Artificial Intelligence

Application of CFD in connection with ship design

Lecture 16 - Free Surface Flows. Applied Computational Fluid Dynamics

Christof Hinterberger, Mark Olesen

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries

Computational Modeling of Wind Turbines in OpenFOAM

Adaptation and validation of OpenFOAM CFD-solvers for nuclear safety related flow simulations

LSCFD: Meshing Tools for Open Source CFD A Practical Point of View

Giorgio Bornia. Research statement. Primary interests

Tomasz STELMACH. WindSim Annual User Meeting 16 June 2011

STCE. Outline. Introduction. Applications. Ongoing work. Summary. STCE RWTH-Aachen, Industrial Applications of discrete adjoint OpenFOAM, EuroAD 2014

The influence of mesh characteristics on OpenFOAM simulations of the DrivAer model

Simulation of Fluid-Structure Interactions in Aeronautical Applications

Use of OpenFoam in a CFD analysis of a finger type slug catcher. Dynaflow Conference 2011 January , Rotterdam, the Netherlands

Introduction: Keywords: CFD, MRF, Blower Angular Orientation

CCTech TM. ICEM-CFD & FLUENT Software Training. Course Brochure. Simulation is The Future

O.F.Wind Wind Site Assessment Simulation in complex terrain based on OpenFOAM. Darmstadt,

FINE TM /Marine. CFD Suite for Marine Applications. Advanced Development for Better Products.

Compatibility and Accuracy of Mesh Generation in HyperMesh and CFD Simulation with Acusolve for Torque Converter

HPC enabling of OpenFOAM R for CFD applications

MEL 807 Computational Heat Transfer (2-0-4) Dr. Prabal Talukdar Assistant Professor Department of Mechanical Engineering IIT Delhi

How To Model A Horseshoe Vortex

Investigation of the influence of turbine-to-turbine interaction on their performance using OpenFOAM

HPC technology and future architecture

Lecture 7 - Meshing. Applied Computational Fluid Dynamics

How To Optimise A Boat'S Hull

Using CFD to improve the design of a circulating water channel

CFD Applications using CFD++ Paul Batten & Vedat Akdag

A DISCRETE ADJOINT VERSION OF AN UNSTEADY INCOMPRESSIBLE SOLVER FOR OPENFOAM USING ALGORITHMIC DIFFERENTIATION

Modeling of Earth Surface Dynamics and Related Problems Using OpenFOAM

INCORPORATING CFD INTO THE UNDERGRADUATE MECHANICAL ENGINEERING PROGRAMME AT THE UNIVERSITY OF MANITOBA

Unsteady CFD of a Marine Current Turbine using OpenFOAM with Generalised Grid Interface

BBIPED: BCAM-Baltogar Industrial Platform for Engineering design

Scalable coupling of Molecular Dynamics (MD) and Direct Numerical Simulation (DNS) of multi-scale flows

Datavetenskapligt Program (kandidat) Computer Science Programme (master)

Computational Fluid Dynamics Research Projects at Cenaero (2011)

CastNet: GUI environment for OpenFOAM

Adaptation of General Purpose CFD Code for Fusion MHD Applications*

TWO-DIMENSIONAL FINITE ELEMENT ANALYSIS OF FORCED CONVECTION FLOW AND HEAT TRANSFER IN A LAMINAR CHANNEL FLOW

Design and Optimization of OpenFOAM-based CFD Applications for Hybrid and Heterogeneous HPC Platforms

Module 6 Case Studies

CFD ANALYSIS OF CONTROLLABLE PITCH PROPELLER USED IN MARINE VEHICLE

A simplefoam tutorial

Visualization of Adaptive Mesh Refinement Data with VisIt

Customer Training Material. Lecture 5. Solver Settings ANSYS FLUENT. ANSYS, Inc. Proprietary 2010 ANSYS, Inc. All rights reserved.

Eu-NORSEWInD - Assessment of Viability of Open Source CFD Code for the Wind Industry

Applied mathematics and mathematical statistics

Steady Flow: Laminar and Turbulent in an S-Bend

CFD simulations of flow over NASA Trap Wing Model

CastNet: Modelling platform for open source solver technology

GAS DISPERSION WITH OPENFOAM

Error Analysis in Finite Volume CFD

CFD Analysis of Container Ship Sinkage, Trim and Resistance

A CODE VERIFICATION EXERCISE FOR THE UNSTRUCTURED FINITE-VOLUME CFD SOLVER ISIS-CFD

Marine CFD applications using OpenFOAM

CFD software overview comparison, limitations and user interfaces

Differentiating a Time-dependent CFD Solver

CFD: What is it good for?

Coupled CFD and Vortex Methods for Modelling Hydro- and Aerodynamics of Tidal Current Turbines and On- and Offshore Wind Turbines

OPTIMISE TANK DESIGN USING CFD. Lisa Brown. Parsons Brinckerhoff

CFD SIMULATION OF SDHW STORAGE TANK WITH AND WITHOUT HEATER

How To Run A Steady Case On A Creeper

SOFTWARE FOR 3D IMAGE VISUALISATION, ANALYSIS AND MODEL GENERATION

Aerodynamic Department Institute of Aviation. Adam Dziubiński CFD group FLUENT

CFD Simulation of the NREL Phase VI Rotor

Transcription:

Quality and Reliability in CFD Open Source Challenges Hrvoje Jasak Wikki Ltd, United Kingdom Faculty of Mechanical Engineering and Naval Architecture University of Zagreb, Croatia Quality and Reliability in CFD p. 1

Outline Objective Describe how object-oriented software design and layered architecture impacts the quality and reliability of the software Review validation and verification practices in place with FOAM/OpenFOAM and in the framework of the FOAM-Extend project Summarise the quality assurance problems related to open source software development model Topics Introduction: OpenFOAM and object-oriented CFD software design Code verification: layered development and generic programming Code validation framework: tutorials and best practice guidelines Example: validation of the naval hydrodynamics solver Summary and Outlook Quality and Reliability in CFD p. 2

OpenFOAM: Executive Overview What is OpenFOAM? OpenFOAM is a free-to-use Open Source numerical simulation software with extensive 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 (8192) Software under active development, capabilities mirror those of commercial CFD Substantial installed user base in industry, academia and research labs Numerous extensions to non-traditional, complex or coupled physics 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 Quality and Reliability in CFD p. 3

Object Orientation in C++ Implementing Continuum Models by Equation Mimicking Object oriented software design: Recognise main objects from the numerical modelling viewpoint and implement them in code; object = data and functions operating on its data Natural language of continuum mechanics exists: partial differential equations Example: turbulence kinetic energy equation k t + (uk) [(ν +ν t) k] = ν t [ ] 1 2 2 ( u+ ut ) ǫ o k k o 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) ); Quality and Reliability in CFD p. 4

Object Orientation in C++ OpenFOAM Software Architecture: Layered Development Code developed and tested in isolation: natural layered design Vectors, tensors and field algebra Mesh handling, refinement, mesh motion, topological changes Discretisation, boundary conditions Matrices and solver technology Physics by segment: custom (vertically integrated) applications Design encourages code re-use: developing shared tools in library form Run-time selection mechanism allows new code components without disturbing existing code components: ultimate user-coding capabilities! Development of physics model libraries with run-time selection Mesh handling support: polyhedral cells, automatic mesh motion, topological changes, adaptivity, re-meshing; integrated mesh generation tools Custom-written top-level solvers optimised for efficiency and storage Substantial existing capability in physical modelling Quality and Reliability in CFD p. 5

Software Verification Software Verification Within Layered Development Rule #1: If you have not recompiled or re-linked the code, you have not broken it! In layered development, multiple programmers simultaneously work on software components, protected by common interfaces Functionality of components is established as and when they are written Each function throughout the code is consistently marked as const access when it is written: this is crucial (retro-fitting const is virtually impossible) Unit tests are preserved and automated; testing is performed every time the component or interface is touched Data encapsulation provides compile-level protection: C++ is excellent in following and enforcing data protection rules. No hacking allowed! For multiple run-time model choices, new code does not disturb existing components. No recompilation means no new bugs If component interface is changed, full verification loop is executed Using all possible computer-level verification techniques: valgrind, NaN memory initialisation, regular profiling, instrumented class-level debug streams However, this is only a basic verification level: complexity brings problems Quality and Reliability in CFD p. 6

Software Verification Software Verification With Generic Programming In generic programming, identical lines of source code are used to perform identical operations on different types. Code is generated automatically and in a controlled manner by the compiler Some examples of generic programming in OpenFOAM VectorSpace operations on components, eg. operator+(scalar, vector, tensor) Interpolation, eg. upwinding for scalar, vector, tensor Differential operators, eg. fvm:ddt(), fvm:laplacian(), Boundary conditions, eg. fixedvalue, inletoutlet Generic programming significantly facilitates verification at component level: fewer lines of code performing more functions Verification is shared among multiple software components and re-used Conclusion on Verification Good software design and agile programming renders more reliable code Agile programming: write and use unit tests before writing source code Quality and Reliability in CFD p. 7

Code Validation Open Source Software Code Validation At basic level, validation of Open Source software is identical to other validation efforts Choose well established validation examples Perform detailed CFD studies, with variation of model parameters Perform mesh independence studies Compare CFD results against know reference results and experimental data This is a huge amount of effort and cannot be avoided Code validation is done in a traditional way... but is helped by the fact that the top-level code is not monolithic: each physics segment is served by its own top-level solver, eg. reactingfoam The amount of top-level code is relatively small: all critical functionality is shared and re-used from library components! Usually, validation studies are performed in collaboration with end-users or academic partners: reliability of results is well established Quality and Reliability in CFD p. 8

Code Validation Fundamental advantage of Open Source CFD: Direct Peer Review of Source Code In Open Source CFD, full source code is available for inspection at all levels Object orientation and layered design make the code concise and legible without reading every line Example: inletoutlet boundary condition template<class Type> class inletoutletfvpatchfield : public mixedfvpatchfield<type> {... } template<class Type> void inletoutletfvpatchfield<type>::updatecoeffs() { const scalarfield& phip = this->lookuppatchfield(phiname_); this->valuefraction() = 1.0 - pos(phip); } mixedfvpatchfield<type>::updatecoeffs(); Quality and Reliability in CFD p. 9

Code Validation Direct Peer Review of Source Code Direct peer review of the source code happens on a daily basis: CFD is still a realm of experts where numerous people understand and care about the details of code implementation The code is questioned at every level an on a daily basis (requires effort!) but in terms of code validation cannot be beaten! Code validation cases are also available in full source Computational mesh (or mesh generation scripts) Material properties, model settings Initial and boundary conditions Discretisation parameters Automatic execution scripts (If possible) Automatic data extraction and comparison with experimental data or reference CFD results Validation cases simultaneously serves as a problem class tutorial and best practice guideline example: freely distributed and maintained Validation cases are maintained by Special Interest Groups Quality and Reliability in CFD p. 10

Code Validation Code Validation Contests Validation contests are essential and performed regularly with ERCOFTAC Turbomachinery Special Interest Group The Bolund Experiment: Wind on complex terrains Gothenburg 2010, A Workshop on Numerical Ship Hydrodynamics (AIAA CFD Drag Prediction Workshop) Provide an impartial forum for evaluating the effectiveness of existing computer codes and modelling techniques Allows users to examine the limits of applicability of physical models and CFD without being bound to a single software implementation. Example: bypass turbulence transition modelling vs. natural transition... but in most cases results are discouraging: typically giving 30-40% influence of user experience on results Quality and Reliability in CFD p. 11

Naval Hydro Validation Example: Detailed Validation of the Naval Hydrodynamics Solver Validation of the steady resistance free surface VOF solver on a canonical geometry: KRISO Container Ship with known experimental data Items under review Mesh refinement study: 6 meshes, 600k to 4.6M cells Variation of Courant number and influence on result Variation of discretisation settings: how robust is CFD solution on changes in discretisation settings? Convection and diffusion differencing schemes Gradient calculation algorithm and gradient limiters Boundary conditions Solver convergence criteria Detailed analysis of solution features: far field wave field, stern wetting Stability of solution in time; force decomposition Analysis of simulation time and parallel scaling The result of validation study is not only what accuracy can be achieved but also how robust is the CFD result Quality and Reliability in CFD p. 12

Summary and Outlook Summary on Verification Object-oriented software design allows for detailed and critical verification studies, beyond the scope available in procedural programming Development and verification of software components is performed from ground up Higher programming language software tools built into the compiler help resolve many old-fashioned programming problems, eg. data protection Code re-use through library components and generic programming exercises the code at higher level This can be achieved in any software development framework (not only Open Source)... but this is only the beginning of Quality and Reliability in CFD Quality and Reliability in CFD p. 13

Summary and Outlook Summary on Validation Basic work on code and model validation is always the same... but the benefit of Open Source is peer review at source code level The most reliable validation tool is a multi-code beauty contest exercise against known validation data, which involves substantial work As a benefit, validation cases distributed with OpenFOAM also act as complete tutorial examples and best practice guidelines Outlook In code verification and validation Open Source carries a big advantage: source code is open for peer review at all levels Largest uncertainty still comes from the operator factor, which remains a prevalent problem for modern CFD Quality and Reliability in CFD p. 14