Basic Open Foam Tutorials Guide
Basic Open Foam Tutorials Guide
Rapid OF Blog
1.
Introduction
Practically every question on how to learn OpenFOAM is answered by directing the aspiring
student to tutorials provided with the package. They are instructed to simply go through the
tutorials, run and play with them and learn through practice.
It is not far from the truth - we learn best by practice and any time you want to learn something
really well you need to practice it to drill the procedures into your memory. Theory is of course
fundamental, but its practice that makes the student skillful in any given field.
There are tens of solvers in OpenFOAM and each of them has few tutorials, so there is a lot to
work through. Naturally, at the beginning you will want to work on the field you are most
interested with, or need for your work or study, and thus you will need to choose a relevant
tutorial(s).
What I want to give you in this guide is a short instruction on each of listed tutorials. I will not go
deep into physics, equations and so on instead I will cover what happens in each of them from
the procedural side. How the case is set up, are there some additional steps taken, ho the mesh
is set up and some general remarks on physics and boundary conditions.
The tutorials, as found in OpenFOAM installation, are divided by solvers names each solver
has its own set of tutorials (few of them have only one).
Below you will find a list of solvers with descriptions taken from OpenFOAM official
documentation (to be found in UserGuide.pdf in OF installation or here
http://www.openfoam.org/features/standard-solvers.php). For each solver I have listed the
tutorials available (OF release 2.3.0), a short description of what is done and a screenshot of
the results.
Based on this list you can quickly select the one most useful for you at the time and use it to set
up a case you want to simulate.
Rapid OF Blog
2.
Basic
laplacianFoam - Solves a simple Laplace equation, e.g. for thermal diffusion in a solid
Tutorial name
flange
Description
Steady state heat transfer on a flange.
Dirichlet boundary conditions used, two
different temperatures. Includes mesh
conversion from Ansys mesh.
potentialFoam - Simple potential flow solver which can be used to generate starting fields for
full Navier-Stokes codes.
cylinder
pitzDaily
Rapid OF Blog
Description
Convection-diffusion problem with
temperature being convected with
velocity through Pitz- Daily problem
geometry.
3.
Incompressible
adjointShapeOptimization - Steady-state solver for incompressible, turbulent flow of nonNewtonian fluids with optimization of duct shape by applying blockage in regions causing
pressure loss as estimated using an adjoint formulation
Tutorial name
Description
pitzDaily
Runs optimization of
Pitz Daily case to
reach Ua, pa
conditions at the exit.
Applies blockage
(alpha) in regions
which need to be
modified to reach the
desired conditions.
Description
boundaryLaunderSharma
Generates velocity distribution using Launder Sharma kepsilon turbulence model. Kinematic viscosity applied using .xy
file. Cyclic symmetry applied on front and back sides.
Generates a ./graphs directory with .xy files with velocity and LS k-epsilon model variables distribution for each saved time
step.
boundaryWallFunctions
Rapid OF Blog
Figure I-1
Comparison of velocity profiles for the three tutorials
Figure I-2
Comparison of OpenFOAM solution to Spalding law
Rapid OF Blog
Description
Lid-driven flow in a square shaped
cavity; incompressible and laminar,
basic hex mesh. Widely described in
OpenFOAM user guide.
cavityClipped
cavityGrade
elbow
The above case solved on a geometry with one bottom corner being cut out.
Cavity tutorial using mesh grading
Incompressible laminar flow through
an elbow with side pipe. Imports
mesh from a .msh file.
Description
offsetCylinder
Rapid OF Blog
Description
mixerVesselAMI2D
movingCone
Rapid OF Blog
wingMotion
pimpleFoam - Large time-step transient solver for incompressible, flow using the PIMPLE
(merged PISO-SIMPLE) algorithm
Tutorial name
Description
channel395
pitzDaily
Rapid OF Blog
TJunction
TJunctionFan
les:
Tutorial name
Description
motorBike
pitzDaily
Rapid OF Blog
ras
Tutorial name
Description
cavity
cavityCoupledU
Tutorial name
Description
squareBump
Rapid OF Blog
10
Tutorial name
airFoil2D
Description
Steady state flow of air around
airfoil, Newtonian fluid model,
Spalart-Allmaras turbulence, Ctype 2D mesh (imported from
external mesher)
mixerVessel2D
motorBike
pipeCyclic
Rapid OF Blog
11
pitzDaily
pitzDailyExptInlet
turbineSiting
Description
mixer
Rapid OF Blog
12
4.
Compressible
Description
obliqueShock
shockTube
Rapid OF Blog
13
wedge15Ma5
rhoLTSPimpleFoam Local time stepping transient solver for laminar or turbulent flow of
compressible fluids.
Tutorial name
Description
angledDuct
Description
angledDuct
Rapid OF Blog
14
rhoPimpleDyMFoam - Transient solver for laminar or turbulent flow of compressible fluids for
HVAC and similar applications with moving mesh capability
Tutorial name
Description
rhoPimpleFoam - Transient solver for laminar or turbulent flow of compressible fluids for HVAC
and similar applications
Tutorial name
Description
les
pitzDaily
ras
angledDuct
Rapid OF Blog
15
cavity
Description
squareBend
Rapid OF Blog
16
Description
Description
laminar forwardStep
schockTube
nacaAirfoil
Launder-Sharma k-epsilon,
imported mesh with techniques
shown how to overcome high
skewness; contains also
technique to calculate the airfoil
force coefficients.
ras
Rapid OF Blog
17
prism
Rapid OF Blog
18
5.
Multiphase
cavitatingFoam - Transient cavitation code based on the homogeneous equilibrium model from
which the compressibility of the liquid/vapour mixture is obtained
Tutorial name
Description
LES
throttle
throttle3D
throttle
RAS
Rapid OF Blog
19
Tutorial name
Description
Tutorial name
Description
20
Tutorial name
Description
interDyMFoam - Solver for 2 incompressible, isothermal immiscible fluids using a VOF (volume
of fluid) phase-fraction based interface capturing approach, with optional mesh motion and
mesh topology changes including adaptive re-meshing.
Tutorial name
Description
DTCHull
Rapid OF Blog
21
floatingObject
mixerVesselAMI
sloshingTank2D
testTubeMixer
Rapid OF Blog
22
interFoam - Solver for 2 incompressible, isothermal immiscible fluids using a VOF (volume of
fluid) phase-fraction based interface capturing approach.
Tutorial name
laminar
capillaryRise
Description
Natural wall contact driven rise of
water in a capillary channel.
ConstantAlphaContactAngle =
45deg set in 0/alpha.water file.
damBreak
les
nozzleFlow2D
ras
damBreak
Rapid OF Blog
23
damBreakPorous
Baffle
waterChannel
Gravitational flow of
water through a
narrow channel,
originating in a
slightly higher placed
chamber. The
channel mesh is built
using extrudeMesh
utility. K-omega SST
turbulence model
used. Inlet, outlet and atmosphere fluxes calculated using
additional entries in ControlDict.
Water flowing over weir
barrier. RANS turbulent
flow modeling with kepsilon turbulence model.
setFields used for initial
water distribution along
with initial conditions
attached in 0 directory,
which specify water flow
rate.
weirOverflow
Rapid OF Blog
24
interMixingFoam - Solver for 3 incompressible fluids, two of which are miscible, using a VOF
method to capture the interface
Tutorial name
Description
damBreak
Tutorial name
Description
propeller
Rapid OF Blog
25
interPhaseChangeFoam - Solver for 2 incompressible, isothermal immiscible fluids with phasechange (e.g. cavitation). Uses a VOF (volume of fluid) phase-fraction based interface capturing
approach
Tutorial name
Description
cavitatingBullet
LTSInterFoam - Local time stepping (LTS, steady-state) solver for 2 incompressible, isothermal
immiscible fluids using a VOF (volume of fluid) phase-fraction based interface capturing
approach
Tutorial name
Description
DTCHull
Rapid OF Blog
26
Description
mixerVessel2D
Water (0.25 volume) and air being mixed in a simple 2D mixer. Laminar
flow model used; rotor movement introduced as an additional rotating
frame of reference.
Tutorial name
Description
mixerVessel2D
Rapid OF Blog
27
multiphaseEulerFoam Solver for n incompressible fluids with one phase dispersed, e.g. gas
bubbles in a liquid.
Tutorial name
Description
bubbleColumn
dambreak4hase
Rapid OF Blog
28
multiphaseInterFoam - Solver for n incompressible fluids which captures the interfaces and
includes surface-tension and contact-angle effects for each phase
Tutorial name
Description
dambreak4phase
Fine
settlingFoam - Solver for 2 incompressible fluids for simulating the settling of the dispersed
phase
Tutorial name
Description
dahl
Rapid OF Blog
29
tank3D
Description
lockExchange
twoPhaseEulerFoam - Solver for a system of 2 incompressible fluid phases with one phase
dispersed, e.g. gas bubbles in a liquid
Tutorial name
laminar
Rapid OF Blog
Description
bubbleColumn
30
bubbleColumnIATE
fluidizedbed
mixerVessel2D
LES
Rapid OF Blog
bubbleColumn
31
RAS
Rapid OF Blog
bubbleColumn
fluidizedBed
Simulation of dispersed
particles column behavior
when hot air is blowed in
from the bottom. Particles
are assumed to be of
spherical shape and
constant radius
(constant/phaseProperties).
32
6.
Heat transfer
buoyantBoussinesqPimpleFoam
incompressible fluids
Transient
solver
Tutorial name
Description
hotRoom
for
buoyant,
turbulent
flow
of
Description
hotRoom
iglooWithFridges
Rapid OF Blog
33
buoyantPimpleFoam - Transient solver for buoyant, turbulent flow of compressible fluids for
ventilation and heat-transfer
Tutorial name
Description
hotRoom
Tutorial name
Description
buoyantCavity
Rapid OF Blog
34
circuitBoardCooling
externalCoupledCavity
hotRadiationRoom
Rapid OF Blog
35
Tutorial name
Description
multiRegionHeater
Rapid OF Blog
36
Description
heatExchanger
Rapid OF Blog
37