Programming CFD | OpenFOAM Training | Course Modules (3 days)
Introduction to Programming
- Getting started with C : creating a C program, compilation, scope, namespace, header files
- OpenFOAM core classes: introduction,
scalar
,vector
,tensor
,List
,Field
,word
- Tools and practice: finding classes & functions, code readability, programming style, file editor, scripts
Utility Programming
- Data construction:
Time
andfvMesh
, fields, dimensioned types, primitives andconst
- Data access and processing: introduction, references, data access in loops, function styles, data output
- Data input: reading data, keyword lookup, dictionary hierarchy,
scalar
/label
lookup, command line arguments/options - Data operations: code verification, compound assignment, reduction operations, case statements, error checking, type conversion, efficiency
Boundary Conditions
- Class hierarchy: boundary mesh and fields, patch field types, new boundary condition, private data, constructors
- Generic programming: templates, template boundary condition,
pTraits
, lookup with default, parameter checking - Class functions/data: private functions, “
*this
” pointer,updateCoeffs()
, user interface, documentation
Model/Solver Code Structure
- Interfaces: library-application interface, model update and delivery, virtual functions, run-time selection
- Data Initialization: class declaration, member access (public, private, protected), constructor initialization
- Optional models:
autoPtr
, memory allocation, pointer de-referencing, pointer validity
Model/Solver Numerical Methods
- Fields:
GeometricField
, dimensional units, volume and surface fields, flux, mesh regions,DimensionedField
- Equations and algorithms: solver code, iterative solution, momentum predictor, pressure equation,
fvMatrix
- Derivatives and algebra: tensors, tensor algebra, interpolation, derivative functions, sources, implicitness
Data Analysis (Post-Processing)
- Data processing: creating a new function object, reading parameters, data access / calculation, customizing output
- Data output: output to file, formatting output, output in parallel, extending applicability, default inputs
Who Should Attend
Target Audience
- CFD users working in R&D, academia and method development
- Existing users developing in-house CFD capability
- Programmers required to code to the OpenFOAM standards
- Users needing to manage robust, maintainable code
Pre-requisites
- A science/engineering/mathematics background is beneficial
- Familiarity with Linux is an advantage
- Working through the OpenFOAM Linux Guide is strongly encouraged
Excellent course & highly recommendable ! https://t.co/D0IdIKzIls
— Bino Maiheu (@binomaiheu) 8 July 2016
Further Details
Competence in OpenFOAM Programming
- This course has been created over several months, drawing on 2000 hours OpenFOAM training experience, by…
- Chris Greenshields: OpenFOAM project manager and leading trainer, with 1000 hours of training OpenFOAM programming.
- Henry Weller: OpenFOAM creator and architect, who pioneered C for CFD and created the coding practice used in OpenFOAM.
- It enables competency: the confidence to program OpenFOAM to a defined standard.
- Confidence = not freezing at the keyboard.
- Repeatedly = delivering good software, time and again
- Defined standard = understand what good software is and delivering it in a timely manner.
- It addresses the complexity of programming CFD through modular curriculum.
Accelerated Learning
- We have accelerated the learning process by making OpenFOAM easier to use with scripts to generate…
- Template application code and compilation files, that provides a convenient way to set up and start a new application.
- Template boundary condition code, that sets a standard programming methodology for boundary condition coding.
- We add new functions to automate tasks and reduce unnecessary coding, e.g. …
InFunction
macros inmessageStream
. - CFD Direct is able to do this because it includes the architect/co-founders of OpenFOAM.
Learning OpenFOAM Programming through Experience
- The training involves learning through experience.
- We use customization tasks commonly needed across all a range of scientific disciplines and industries.
- … e.g. utility programming, model development, boundary condition, solver development and customized post-processing.
- Programs are written in small, digestible steps with periods of reflection to reinforce new concepts.
- This reflects real programming practice, where trouble-free, complex programs cannot usually be set up in “one go”.