Lecture 3. OpenFOAM Documentation and Learning Materials
3.1 Official OpenFOAM Documentation
You can find the following documentation on the websites of OpenCFD and CFD DirectCFD Direct | OpenCFD | |
---|---|---|
1a. User Guide | 2a. User Guide | |
1b. C++ Source Guide | 2b. Tutorial Guide | |
2c. Extended Code Guide | ||
2d. Tutorial Wiki |
Below you'll find brief explanations for each of these.
- 1a. User Guide: This 7 chapter document teaches the basic principles of using OpenFOAM. You also get a copy of it when you install OpenFOAM. The whole document deserves to be read in detail. It is actually quite short to be a User Guide. Its chapters are as follows
- Ch. 1 Introduction: Nothing important here.
- Ch. 2 Tutorials: Detailed step-by-step instructions of how to setup, simulate and post-process three benchmark problems; lid driven cavity flow, stress analysis of a plate with a hole and the dam break problem.
- Ch 3. Applications and Libraries: Starts with instructions about the general coding principles used in OpenFOAM and how to compile the source files, which can be skipped by those who will be using OpenFOAM "as it is". Followed by instructions on how to run the applications (solvers and pre- and post-processing utilities) from the command line. Finally provides a list with very brief explanations of the standard solvers and utilities that are shipped with OpenFOAM.
- Ch 4. OpenFOAM Cases: Problems solved with OpenFOAM are called cases. Directories and files used to create cases are explained in detail. Time and space discretization options and many solver settings are explained.
- Ch 5. Mesh Generation and Conversion: Gives the basic terminology about the meshes used in OpenFOAM. Explains how OpenFOAM handles the boundary conditions. Mesh generation tools blockMesh and snappyHexMesh are introduced. Utilities available to convert meshes generated by other software to the format required by OpenFOAM are explained.
- Ch 6. Post-processing: Explains how to use ParaView to post-processs the results. Also gives information about run-time post processing and how to sample and monitor data during a solution.
- Ch 7. Models and Physical Properties: Thermophysical models, turbulence models and viscous models are explained.
- 1b. C++ Source Guide: Standard auto-generated class list, file list, functions list, etc. of the C++ source files for those who want to modify the existing codes or write new ones. Very minimal, nothing fancy.
- 2a. User Guide: Very similar to “1a. User Guide”, but not identical. Similar information is presented in a slightly different format and sectioning. It has no tutorials because they are shifted to document 2b given below. Documents 1a and 1b seem to be originated from the same User Guide, but over the years they've gone through some changes. Some of the parts that seem to be missing in this one are actually shifted to document 2c, given below.
- 2b. Tutorial Guide: The three tutorials of document 1a (lid driven cavity flow, stress analysis of a plate with a hole and the dam break problem) also appear in this document. Other than these, there are the following extra tutorials - Flow around a cylinder
- 2c. Extended Code Guide: It has two parts. The "OpenFOAM API" part is the same as document 1b, with auto-generated documentation of source files. But the second part has extra details, some being the same as those of document 1a. An interesting new part here is called Validation and Verification, which explains several tutorial problems that comes with OpenFOAM. The aim of these examples is to test the accuracy of OpenFOAM solutions by comparing them against other reference simulations or experiments, which I found to be quite valuable.
- 2d. Tutorial Wiki: This is one of the two Wiki pages related to OpenFOAM. This one is maintained by Jozsef Nagy, who is currently in charge of OpenFOAM documentation at OpenCFD. It offers a collection of tutorials prepared by the members of OpenCFD and the OpenFOAM communities. Look like that they are kept up-to-date as much as possible, and checked for quality and correctness. The tutorials are organized under different titles, such as "First Glimpse Series", "3 Weeks Series", "Tips", etc. You should definitely check them out, and to ease your job I'll briefly describe each tutorial below. Click on the images to visit the web sites of these tutorials.
- Two YouTube videos (33 and 25 min).
- Mixing flow in an elbow.
- Based on the elbow example that comes with OpenFOAM.
- 2D, incompressible, steady, isothermal, laminar flow is solved using the unsteady icoFoam solver.
- Three different already prepared meshes are used and results are compared.
- Same elbow problem as the previous one.
- 15 page PDF file.
- Demonstrates how to convert an .MSH file from ANSYS to be used with OpenFOAM.
- 16 min. introductory video for OpenFOAM.
- Very basic information. No problem is solved.
- Continuation of the previous introductory video with 2 more videos (2 min and 18 min).
- General philosophy behind OpenFOAM and its history.
- Explanation of the directories and files that come with OpenFOAM.
- 39 min video on how to use blockMesh to prepare meshes for the classical 2D forward facing step benchmark problem.
- Based on the forwardStep example that comes with OpenFOAM.
- Uses sonicFoam solver to simulate unsteady, compressible flow.
- 116 page PDF explaining various introductory concepts.
- Solves the classical lid driven cavity example that comes with OpenFOAM and discussed in detail in the User Guide.
- Two YouTube videos (30 and 17 min).
- Solves the 1D shock tube example that comes with OpenFOAM.
- Uses sonicFoam to solve unsteady, compressible flow.
- Shows how to initialize different regions of the problem domain to different values at the start of the solution.
- Shows how to extract data from a finished solution, i.e. how to sample it.
- Uses three different grids to show how the shocks are captured better as the mesh is refined.
- Two YouTube videos (25 and 23 min).
- Solves 1D, unsteady advection-diffusion equation using scalarTransportFoam solver.
- Solves 11 different cases with different convection and diffusion characteristics.
- Creates case files by modifying those of existing cases.
- 10 page PDF with case files.
- Uses simpleFoam solver to simulate steady Taylor Couette flow, the flow inside the gap between two concentric cylinders.
- Demonstrates how to use the postProcess utility to calculate vorticity.
- Demonstrates how to perform a parallel run.
- 9 page PDF with case files.
- Uses simpleFoam and scalarTransportFoam solvers to simulate 3D, turbulent flow through a T-junction.
- Sets the case up by modifying the files coming with the pitzDaily example.
- Demonstrates how to calculate residence time distribution, which is the amount of time fluid particles spend inside a part of the flow domain.
- 135 page PDF showing how to use ParaView.
- Tons of techniques and hints.
- 12 page PDF showing how to sample (extract) data during and after the solution.
- Solves the 1D shockTube example that comes with OpenFOAM.
- 13 page PDF demonstrating how to use swak4Foam and pyFoam utilities.
- swak4Foam stands for SWiss Army Knife for Foam. It allows you use simple mathematical expressions in case files. Used for example to define complicated boundary conditions.
- pyFoam allows one to use python language to control and manipulate OpenFOAM cases.
- 4.5 hours of YouTube video on OpenFOAM, given by Prof. Hrvoje Jasak, one of the original developers of FOAM and the maintainer of the foam-extend branch.
- Hands on use of the command line to solve a few different problems and post process them.
- Full of information and tips.
- Two PDF presentations (132 and 51 pages) about the Finite Volume Method, which forms the basis of OpenFOAM.
- High quality information about discretization schemes, linear system solvers, pressure-velocity coupling techniques used in pressure based incompressible solvers, unsteady and steady solutions, residuals, etc.
- Demonstrations on simple 1D and 2D test problems.
- 38 page PDF presentation on fvSchemes and fvSolution, which are the two case files used to set discretization schemes and linear algebraic system solution techniques.
- Demonstrates the use of foamSearch utility.
- Two YouTube videos (19 and 16 min).
- Talks about different schemes used to discretize the convection term.
- Solves 1D, unsteady advection-diffusion equation using scalarTransportFoam solver with different diffusion and convection characteristics.
- 14 page PDF and 1 hour YouTube video given by Prof. Hrvoje Jasak about discretization schemes used for diffusion, convection and gradient calculations.
- Default choices for tetrahedral and hexahedral meshes.
- Tests using flow over an airfoil.
- A 6 min. YouTube video describing a convection-diffusion test problem and challenge you to set it up and solve it by yourself.
- Also provides another video with a detailed solution in case you are having any difficulty.
- 50 page PDF and case files for the solution of Hagen-Poiseuille flow, i.e. flow inside a pipe.
- Laminar flow at Re=100 is solved using simpleFoam solver.
- 11 videos totaling 100 min. about general usage of OpenFOAM.
- Covers fundamental topics such as case folders and files, dictionaries, blockMesh, fvSchemes and fvSolution, sampling and probing, visualization.
- Continuation of earlier videos given by Stefan Radl.
- 3 min. video and 105 page PDFs about general use of OpenFOAM.
- Given by Prof. Hakan Nilsson from Chalmers University, where he teaches a popular graduate course devoted to OpenFOAM.
- At 360 pages, this manual is not "little" at all. It is an unofficial User Guide.
- Has the following chapters; Installation, General Remarks, Pre-processing, Modeling, Solver, Post-processing, Source Code & Programming, Theory.
- 85 pages of slides.
- A lot of useful information on general CFD and OpenFOAM.
- Puts special emphasis on mesh quality.
- 49 pages of slides on solid modeling using the cloud based Onshape application, which is free for educational use.
- 19 pages of slides on mesh quality.
- 4 pages of slides on mesh conversion.
- 66 pages of slides on using the blockMesh utility.
- 100 pages of slides on using the snappyHexMesh utility.
- 18 min. video about the free and open-source mesh generation software Gmsh, and how to covert GMSH files into OpenFOAM format.
- 1-hour long video on how to solve turbulent flows using Reynolds Averaged Navier-Stokes (RANS) method. In OpenFOAM RANS is called Reynolds-Averaged Simulation (RAS).
- Introduction to Reynolds averaging and turbulence modeling.
- Solves flow over a backward facing step test problem using k-epsilon, k-omega and Reynolds stress models.
- Two videos (26 and 20 min) on how to solve unsteady turbulent flows.
- Unsteady RANS (URANS) and Large Eddy Simulation (LES) techniques are used with the pisoFoam solver to solve the backward facing step problem.
- Averaging and filtering ideas used in URANS and LES are explained.
- 36 pages of slides. Not detailed, gives general advices. Comes with case files.
- Solves 3D, turbulent flow over a car.
- Uses a mesh generated with snappyHexMesh.
- 45 pages of slides about turbulence modeling, Reynolds averaging, RANS, URANS, DES, LES, DNS, law of the wall, near wall treatment, y+, etc.
- No problem is solved.
- 80 pages of slides about 2D flow over a circular cylinder and vortex shedding. Case files are provided.
- 29 different cases are solved at different Reynolds numbers, using different solvers, different turbulence models, etc.
- Even supersonic compressible cases at Mach number of 2 and cases with moving and oscillating cylinder are solved.
- 12 pages of slides about 3D flow over a square cylinder and vortex shedding.
- Case files are provided.
- Re=21400 flow is simulated using RANS and LES.
- Two videos (23 and 12 min) solving the 2D damBreak tutorial that comes with OpenFOAM and also explained in the User Guide.
- interFoam solver with the Volume of Fluid (VOF) approach is used to simulate a two-phase flow with immiscible water and air phases.
- Two PDFs with 40 and 37 page slides about the same dam break problem, but this time both in 2D and 3D.
- Case files are provided.
- Almost 2 hour of video lecture given by Prof. Hrvoje Jasak on multi-phase flows and free surface flows.
- General information about different modeling approaches.
- VOF approach is used to solve a bubble rising in a tank problem.
- 45 page slides about simulating free surface flows.
- Theory about the interFoam solver is given.
- Detailed solution of a dam spillway problem is provided with case files.
- Rayleigh-Taylor instability problem is mentioned very briefly.
- 24 page slides about running OpenFOAM in parallel.
- Decomposing the problem domain, solving a case in parallel and visualizing the results of a parallel run are discussed.
- Case files are provided.
- 6 min. video about running OpenFOAM in parallel.
- Robert Lee has a YouTube channel called OpenFOAM Tutorials.
- Two videos (28 and 21 min) about running OpenFOAM in parallel to solve the depthCharge example that comes with OpenFOAM.
- It uses the compressibleInterFoam solver to simulate an explosion in water and the expanding pressure waves, but the focus is not on the problem, rather on parallelization.
- 33 page slides about implementing non-constant boundary conditions using codeStream and codedFixedValue options.
- Shows how to define parabolic (in 2D) and paraboloid (in 3D) inlet boundary conditions.
- Case files are provided.
- 21 page slides about using codeStream to initialize field variables to non-constant values.
- Demonstrates the idea using examples such as Rayleigh-Taylor instability and tank filling problem.
- Case files are provided.
- 13 page slides about writing a new solver for the convection-diffusion equation from scratch.
- Source codes and case files are available.
- 7 page slides about modifying the icoFoam solver by adding an extra variable to it governed by the convection-diffusion equation.
- 80 min video by Prof. Hrvoje Jasak explaining the programming paradigms and styles used in OpenFOAM.
- Hands on exercises.
- 31 page slides for an introduction to programming OpenFOAM.
- A walk through of a simple scalarTransportFoam solver and a utility that calculates the magnitude of a given velocity field.
- Case files to test the developed solver are provided.
- 33 page slides about OpenFOAM programming.
- Gives a walk-through of the existing icoFoam solver.
- the solver is modified by adding the energy equation into it and recompiled into a new solver.
- Two PDFs with 24 and 46 pages of slides for an introduction to the C++ language and how it is used in OpenFOAM.
- Several PDFs about programming OpenFOAM.
- Explains the directory structure of OpenFOAM from the programming perspective.
- Several programming exercises such as developing a new solver from scratch, adding an extra transport equation to an existing solver and adding an extra new call to an existing solver to extend its functionality.
- Several PDFs about programming OpenFOAM.
- Gives information about the existing icoFoam and pisoFoam solvers used in solving incompressible flows.
- Explains how turbulence models are coded in OpenFOAM and implements a new model by modifying an existing one.
- Explains how to debug OpenFOAM codes.
- 40 page slides about programming in OpenFOAM.
- Implements Boussinesq approximation to the icoFoam solver to solve buoyancy-driven flows.
- Implements non-Newtonian Casson viscosity model.
- Magnetohydrodynamic flow of a liquid
- Compressible, turbulent flow over a backward facing step
- Supersonic flow over a forward facing step
- Decompression of a tank internally pressurized with water
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.2 Extra Learning Materials
I think a CFD software should come with at least two official guides. A User Guide that teaches how to use the software to solve different types of problems and a Technical Reference Guide giving details about the methods used in discretization and modeling. OpenFOAM's official user guide serves for both purposes, but I think that it is too short. It does not provide enough details. Being an open-source software, you expect to find a documentation about the source files, how to understand and modify them, but the documentation for that is also not enough. The tutorials mentioned above try to fill the gaps. They are quite helpful, but they could have been organized better. They are prepared by different people, at different times for different purposes. They are not meant to be a set of 50+ tutorials served all together. There are many repetitions and you need to check them all one by one to see if any of them offer anything that you are looking for. The trainings offered by CFD Direct and OpenCFD seem to be much more organized and effective, but unfortunately they are not free.Being an open-source software, community contributions become critical in the learning process. Other than the ones listed above there are tons of OpenFOAM related material out there on the internet. I will try to mention couple of notable ones below.
Unofficial Wiki is maintained by the foam-extend group. It is an OpenFOAM information hub. There is not much original content here, but you will mostly find links to already available information, categorized in many different ways. You can find things like FAQ, tutorials, theses, papers, conferences, courses, community written utilities, etc., all about OpenFOAM. Although I learned a lot from this Wiki page, I think it should be organized in a different way and they should clean up old information, which may be misleading.
Hakan Nilsson's CFD with OpenSource Software Course has been offered at Chalmers University since 2007. A PhD student anywhere in the world can enroll, but it is not an online course. The good part is that students work on a term project and prepare reports/tutorials that involve the use of OpenFOAM and the ones prepared in the previous semesters are shared at the course web site. Check them out.
CFD Support is an engineering company dealing with CFD. They offer CFD training and support based on OpenFOAM. They also sell a product called TCFD, which is OpenFOAM packaged with a GUI, specifically designed for turbomachinery applications. At their web site they have several downloadable OpenFOAM cases and tutorials both as PDFs and videos. Check their websites for general OpenFOAM cases and the ones specific to turbomachinery cases.
Wolf Dynamics offers consulting services in CFD and related fields. Their tutorials and validation cases web site has several beginner level and advanced level material. Some of them are also included in the Wiki tutorials mentioned above.
The Foam House hosts 5 beginner level OpenFOAM tutorials to solve 5 different problems.
YouTube has tons of OpenFOAM related videos. Some notable channels are as follows.
CFD Support channel
OpenFOAM Tutorials channel
foamDude channel
TotalSim's channel
The Finite Volume Method in Computational Fluid Dynamics - An Advanced Introduction with OpenFOAM and Matlab is a 800 page book, which is quite unique in how it teaches the Finite Volume Method (FVM) by focusing on how it is implemented in OpenFOAM. Very useful to learn the details of FVM and the coding details in OpenFOAM. There are only a few solved CFD problems in this book. It is mostly filled with methods, formulations and codes.
OpenFOAM Technology Primer is a 440 page book, which is more like a User Guide, rather than a textbook. It is quite similar to the official User Guide with extended coverage. It does no contain any problem solutions in it.