Beruflich Dokumente
Kultur Dokumente
Eric Paterson
egp@vt.edu
ESOP Workshop
5-8 June 2017
Outline
1 Introduction
2 Standard Solvers
4 Standard Utilities
5 Case Structure
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 2 / 22
Applications in OpenFOAM
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 3 / 22
Finding applications (source code) in OpenFOAM
The source code for the applications is arranged in a structure that is useful for
finding the application you need
Use the pre-defined alias "app" to go to the source code applications directory
(alias app = ’cd $FOAM_APP’)
There you will find:
Note the descriptive nature of the directory names, which is described by the type
of physical phenomena solved.
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 5 / 22
Finding applications (source code) in OpenFOAM
Inside each solver directory you find a *.C file with the same name as the directory. This is the
main file, where you will find the top-level source code and a short description of the solver.
Most solvers have self-explanatory names (at least once you are familiar with OpenFOAMese):
icoFoam – Transient solver for incompressible, laminar flow of Newtonian fluids
simpleFoam – Steady-state solver for incompressible flows with turbulence
modelling.
pisoFoam – Transient solver for incompressible, turbulent flow, using the PISO
algorithm.
If all else fails, read the commented description in the source file
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 6 / 22
Some standard OpenFOAM solvers
Basic solvers
laplacianFoam: Laplace equation solver for a scalar quantity.
potentialFoam: Potential flow solver which solves for the velocity potential, to calculate the
flux-field, from which the velocity field is obtained by reconstructing the flux. The potential flow
solution is typically employed to generate initial fields for full Navier-Stokes codes.
scalarTransportFoam: Solves a transport equation for a passive scalar.
Incompressible flow
icoFoam: Transient solver for incompressible, laminar flow of Newtonian fluids
nonNewtonianIcoFoam: Transient solver for incompressible, laminar flow of non-Newtonian
fluids..
pimpleFoam: Large time-step transient solver for incompressible, turbulent flow, using the
PIMPLE (merged PISO-SIMPLE) algorithm.
pisoFoam: Transient solver for incompressible, turbulent flow, using the PISO algorithm.
simpleFoam: Steady-state solver for incompressible flows with turbulence modelling.
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 7 / 22
Some standard OpenFOAM solvers
Compressible flow
rhoCentralFoam: Density-based compressible flow solver based on central-upwind schemes of
Kurganov and Tadmor.
rhoPimpleFoam: Transient solver for turbulent flow of compressible fluids for HVAC and similar
applications.
rhoSimpleFoam: Steady-state solver for turbulent flow of compressible fluids.
sonicFoam: Transient solver for trans-sonic/supersonic, turbulent flow of a compressible gas.
Heat transfer
buoyantBoussinesqPimpleFoam: Transient solver for buoyant, turbulent flow of incompressible
fluids.
buoyantPimpleFoam: Transient solver for buoyant, turbulent flow of compressible fluids for
ventilation and heat-transfer.
chtMultiRegionFoam: Transient solver for buoyant, turbulent fluid flow and solid heat
conduction with conjugate heat transfer between solid and fluid regions.
thermoFoam: Solver for energy transport and thermodynamics on a frozen flow field.
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 8 / 22
Some standard OpenFOAM solvers
Multiphase flow
cavitatingFoam: Transient cavitation code based on the homogeneous equilibrium model from
which the compressibility of the liquid/vapour "mixture" is obtained.
compressibleInterFoam: Solver for 2 compressible, non-isothermal immiscible fluids using a VOF
(volume of fluid) phase-fraction based interface capturing approach
interFoam: Solver for 2 incompressible, isothermal immiscible fluids using a VOF (volume of
fluid) phase-fraction based interface capturing approach.
interPhaseChangeFoam : Solver for 2 incompressible, isothermal immiscible fluids with
phase-change (e.g. cavitation). Uses a VOF (volume of fluid) phase-fraction based interface
capturing approach.
Electromagnetics
electrostaticFoam: Solver for electrostatics.
magneticFoam: Solver for the magnetic field generated by permanent magnets.
mhdFoam: Solver for magnetohydrodynamics (MHD): incompressible, laminar flow of a
conducting fluid under the influence of a magnetic field.
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 10 / 22
Finding solver tutorials/example cases in OpenFOAM
The directory organizaton of the tutorials is much like that of the solvers, making
it much easier to find a desired example case.
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 11 / 22
Utilities in OpenFOAM
In the utilities directory ($FOAM_APP/utilities) you find the source code for
the utilities.
Use the pre-defined alias util to go directly there.
The utilities are arrange according to:
. . . and in mesh/generation:
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 12 / 22
Utilities in OpenFOAM
Inside each utility directory you find a *.C file with the same name as the directory.
This is the main file, where you will find the top–level source code and a short
description of the utility.
Some utilities require a dictionary for specifying input parameters. If one is
required, an example or "boilerplate" will be in the directory, too.
For snappyHexMesh :
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 13 / 22
Some standard OpenFOAM utilities
preProcessing [1]
applyBoundaryLayer: Apply a simplified boundary-layer model to the velocity and turbulence
fields based on the 1/7th power-law.
boxTurb: Makes a box of turbulence which conforms to a given energy spectrum and is
divergence free.
changeDictionary: Utility to change dictionary entries, e.g. can be used to change the patch type
in the field and polyMesh/boundary files.
createExternalCoupledPatchGeometry: Application to generate the patch geometry (points and
faces) for use with the externalCoupled functionObject.
createZeroDirectory: Creates a zero directory with fields appropriate for the chosen solver and
turbulence model. Operates on both single and multi-region cases.
dsmcInitialise: Initialize a case for dsmcFoam by reading the initialization dictionary
system/dsmcInitialise
engineSwirl: Generates a swirling flow for engine calulations.
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 14 / 22
Some standard OpenFOAM utilities
preProcessing [2]
faceAgglomerate: Agglomerate boundary faces using the pairPatchAgglomeration algorithm.
foamUpgradeCyclics: Tool to upgrade mesh and fields for split cyclics.
mapFields: Maps volume fields from one mesh to another, reading and interpolating all fields
present in the time directory of both cases.
mapFieldsPar: Maps volume fields from one mesh to another, reading and interpolating all fields
present in the time directory of both cases.
mdInitialise: Initialises fields for a molecular dynamics (MD) simulation.
setFields: Set values on a selected set of cells/patchfaces through a dictionary.
viewFactorsGen: View factors are calculated based on a face agglomeration array.
wallFunctionTable: Generates a table suitable for use by tabulated wall functions
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 15 / 22
Some standard OpenFOAM utilities
postProcessing
noise: Utility to perform noise analysis of pressure data.
postProcessing: Execute the set of functionObjects specified in the selected dictionary (which
defaults to system/controlDict) or on the command-line for the selected set of times on the
selected set of fields.
postProcessing/dataConversion
foamDataToFluent: Translates OpenFOAM data to Fluent format.
foamToEnsight: Translates OpenFOAM data to EnSight format.
. . . plus a lot more
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 16 / 22
Some standard OpenFOAM utilities
parallelProcessing
decomposePar: Automatically decomposes a mesh and fields of a case for parallel execution of
OpenFOAM.
reconstructPar: Reconstructs fields of a case that is decomposed for parallel execution of
OpenFOAM.
reconstructParMesh: Reconstructs a mesh using geometric information only.
redistributePar: Redistributes existing decomposed mesh and fields according to the current
settings in the decomposeParDict file.
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 17 / 22
Some standard OpenFOAM utilities
mesh/generation
blockMesh: A multi-block mesh generator.
extrude: Extrude mesh from existing patch (by default outwards facing normals; optional flips faces) or
from patch read from file.
extrude2DMesh: Takes 2D mesh (all faces 2 points only, no front and back faces) and creates a 3D
mesh by extruding with specified thickness.
foamyMesh: Conformal Voronoi automatic mesh generator
snappyHexMesh: Automatic split hex mesher. Refines and snaps to surface.
mesh/manipulation - numerous
checkMesh: Checks validity of a mesh.
mergeMeshes: Merges two meshes.
refineMesh: Utility to refine cells in multiple directions.
renumberMesh: Renumbers the cell list in order to reduce the bandwidth, reading and renumbering all
fields from all the time directories.
transformMesh: Transforms the mesh points in the polyMesh directory according to the translate, rotate
and scale options.
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 18 / 22
Some standard OpenFOAM utilities
Miscellaneous utilities
foamDictionary: Interrogates and manipulates dictionaries.
foamFormatConvert: Converts all IOobjects associated with a case into the format specified in
the controlDict.
foamHelp: Top level wrapper utility around foam help utilities
foamList: Print the table of contents of selectable switches, classes etc. in the OpenFOAM
libraries
foamListTimes: List times using timeSelector.
patchSummary: Writes fields and boundary condition info for each patch at each requested time
instance.
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 19 / 22
Finding tutorials for the utilities in OpenFOAM
There are no specific tutorials for the utilities, but many of the solver tutorials also
show how to use the utilities. (We will have a look at some of them while we run
through the icoFoam cavity tutorial.)
The best way to find examples of how to use a specific utility:
Go to the utility source code and find the name of the dictionary required for that
utility. For example, for snappyHexMesh:
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 20 / 22
Running solver tutorial cases in OpenFOAM
In general, if you have questions on running a specific tutorial case see the
Allrun script (if it exists).
This will show which utilities must also be executed to successfully run a tutorial
case
For example, see $FOAM_TUTORIALS/interFoam/Allrun:
Eric Paterson (Virginia Tech AOE) Getting started with OpenFOAM applications 5-8 June 2017 21 / 22
The OpenFOAM case structure