0% found this document useful (0 votes)
128 views20 pages

OpenFoam of Apps

The document discusses pre-compiled applications and utilities in OpenFOAM. It describes how OpenFOAM is organized, including different categories of applications like solvers and utilities. It provides examples of common solvers for incompressible flow, compressible flow, combustion, DNS/LES, electromagnetics, and heat transfer. The document aims to help users understand what applications are available and how to find their source code within the OpenFOAM directory structure.

Uploaded by

M Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
128 views20 pages

OpenFoam of Apps

The document discusses pre-compiled applications and utilities in OpenFOAM. It describes how OpenFOAM is organized, including different categories of applications like solvers and utilities. It provides examples of common solvers for incompressible flow, compressible flow, combustion, DNS/LES, electromagnetics, and heat transfer. The document aims to help users understand what applications are available and how to find their source code within the OpenFOAM directory structure.

Uploaded by

M Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

POLITECNICO DI MILANO

Pre-compiled applications and utilities in


OpenFOAM

Tommaso Lucchini

Department of Energy
Politecnico di Milano

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Learning outcome

You will learn ...


the meaning of the words applications, solvers, and utilities
different strategies to find the applications that are available in the
OpenFOAM distribution
how to find and run the solver tutorials
The slides are based on the OpenFOAM-1.5-dev distribution.

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Required OpenFOAM environment

Make sure that you have sourced the OpenFOAM bashrc file correctly,
which should have been done for you already in the SLAX USB
distribution. Test by typing:
which icoFoam
which should give you a path to the icoFoam executable
Make sure that you have a $WM_PROJECT_USER_DIR directory:
ls $WM_PROJECT_USER_DIR
If not, you have to create it by doing the following:
mkdir $WM_PROJECT_USER_DIR
Make sure that you have a run directory:
ls $WM_PROJECT_USER_DIR/run
If not, you have to create it by doing the following:
mkdir $WM_PROJECT_USER_DIR/run

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Applications in OpenFOAM

OpenFOAM is first and foremost a C++ library, used primarily to create


executables, known as applications. The applications fall into two
categories: solvers, that are each designed to solve a specific continuum
mechanics problem; and utilities, that are designed to perform tasks that
involve data manipulation.
OpenFOAM is distributed with a large number of applications, covering
some different aspects of what can be done with OpenFOAM. Don’t view
these applications as a limit of what you can do, instead view them as
examples of what you can do.
Any advanced user will develop new applications for his/ her special
needs. The basic way to do this is to find and copy an application that
almost does what is needed, and then to modify it by copy/paste from
other applications that has some features that are needed.

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Finding the source code of the applications 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 applications directory:
$FOAM_APP
You will find: Allwmake bin solvers test utilities
Allwmake is used to compile all the applications.
bin contains the binaries of the applications after compilation.
solvers contains the source code of the solvers.
utilities contains the source code of the utilities.
test contains source code for testing specific features of OpenFOAM.

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Solvers in OpenFOAM
In $FOAM_APP/solvers you find the source code for the solvers
arranged according to:
basic DNS heatTransfer newStressAnalysis
combustion electromagnetics incompressible stressAnalysis
compressible engine molecularDynamics surfaceTracking
conjugate financial multiphase
We will have a look at the incompressible solvers.
In $FOAM_APP/solvers/incompressible you find the solver source
code directories:
boundaryFoam icoDyMSimpleFoam oodles transientSimpleOodles
channelOodles icoFoam simpleFoam turbDyMFoam
icoDyMFoam nonNewtonianIcoFoam transientSimpleFoam turbFoam
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. For icoFoam:
Transient solver for incompressible, laminar flow of
Newtonian fluids.
For a more complete description, you have the source code right there.

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Basic CFD solvers

(The following slides show an incomplete list, based on OpenFOAM-1.4.1)

Solver Description
laplacianFoam Solves a simple Laplace equation, e.g.
for thermal diffusion in a solid
potentialFoam Simple potential flow solver which can
be used to generate starting fields for full
Navier-Stokes codes
scalarTransportFoam Solves a transport equation for a passive scalar

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Solvers for combustion

Solver Description
coldEngineFoam Solver for cold-flow in internal combustion engines
dieselEngineFoam Diesel engine spray and combustion code
dieselFoam Diesel spray and combustion code
engineFoam Solver for internal combustion engines
reactingFoam Chemical reaction code
XiFoam Compressible premixed/partially-premixed
combustion solver with turbulence modelling
Xoodles Compressible premixed/partially-premixed
combustion solver with large-eddy simulation
(LES) turbulence modelling

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Solvers for compressible flow

Solver Description
rhoPorousSimpleFoam Steady-state solver for turbulent flow of
compressible fluids for ventilation and heat-transfer,
with porous media
rhopSonicFoam Pressure-density-based compressible flow solver
rhoSimpleFoam Steady-state solver for turbulent flow of
compressible fluids for ventilation and heat-transfer
rhoSonicFoam Density-based compressible flow solver
rhoTurbFoam Transient solver for compressible, turbulent flow
sonicFoam Transient solver for trans-sonic/supersonic, laminar
flow of a compressible gas
sonicFoamAutoMotion Transient solver for trans-sonic/supersonic, laminar
flow of a compressible gas with mesh motion
sonicLiquidFoam Transient solver for trans-sonic/supersonic, laminar
flow of a compressible liquid
sonicTurbFoam Transient solver for trans-sonic/supersonic,
turbulent flow of a compressible gas

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Solvers for DNS and LES

Solver Description
channelOodles Incompressible LES solver for
flow in a channel
dnsFoam Direct numerical simulation solver for boxes
of isotropic turbulence
oodles Incompressible LES solver

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Solvers for electromagnetics

Solver Description
electrostaticFoam Solver for electrostatics
mhdFoam Solver for magnetohydrodynamics (MHD):
incompressible, laminar flow of a
conducting fluid under the
influence of a magnetic field

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Solvers for financial

Solver Description
financialFoam Solves the Black-Scholes equation
to price commodities.

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Solvers for heat transfer

Solver Description
buoyantFoam Transient Solver for buoyant, turbulent
flow of compressible fluids for ventilation
and heat-transfer
buoyantSimpleFoam Steady-state solver for buoyant, turbulent
flow of compressible fluids for ventilation
and heat-transfer

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Solvers for incompressible flow

Solver Description
boundaryFoam Steady-state solver for 1D turbulent flow,
typically to generate boundary layer conditions
at an inlet, for use in a simulation.
icoDyMFoam Transient solver for incompressible, laminar flow of
Newtonian fluids with moving mesh
icoFoam Transient solver for incompressible, laminar flow
of Newtonian fluids
nonNewtonianIcoFoam Transient solver for incompressible, laminar flow
of non-Newtonian fluids
simpleFoam Steady-state solver for incompressible, turbulent
flow of non-Newtonian fluids
turbDyMFoam Transient solver for incompressible, turbulent flow of
Newtonian fluids with moving mesh
turbFoam Transient solver for incompressible, turbulent flow

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Solvers for multiphase flow

Solver Description
bubbleFoam Solver for a system of 2 incompressible fluid phases
with one phase dispersed, e.g. gas bubbles in a liquid
cavitatingFoam Solver for compressible liquid flow including
cavitation modelled by a barotropic equation of state
interFoam Solver for 2 incompressible fluids, which tracks
the interface and includes the option of
mesh motion
lesInterFoam Solver for 2 incompressible fluids capturing the
interface. Turbulence is modelled using a runtime
selectable incompressible LES model
multiphaseInterFoam Solver for n incompressible fluids
which captures the interfaces and
includes surface-tension and
contact-angle effects for each.
continued ...

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Solvers for multiphase flow (continued)

Solver Description
rasInterFoam Solver for 2 incompressible fluids capturing the
interface. Turbulence is modelled using a runtime
selectable incompressible RAS model
settlingFoam Solver for 2 incompressible fluids for simulating
the settling of the dispersed phase
twoLiquidMixingFoam Solver for mixing 2 incompressible fluids
twoPhaseEulerFoam Solver for a system of 2 incompressible fluid
phases with one phase dispersed, e.g.
gas bubbles in a liquid

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Solvers for stress analysis

Solver Description
solidDisplacementFoam Transient segregated finite-volume
solver of linear-elastic,
small-strain deformation of a solid
body, with optional thermal
diffusion and thermal stresses
solidEquilibriumDisplacementFoam Steady-state segregated finite-volume
solver of linear-elastic,
small-strain deformation of
a solid body, with optional thermal
diffusion and thermal stresses.

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Utilities in OpenFOAM

In $FOAM_APP/utilities you find the source code for the utilities


arranged according to:
errorEstimation parallelProcessing surface
mesh postProcessing thermophysical
miscellaneous preProcessing
In $FOAM_APP/utilities/postProcessing/velocityField
you find:
Co flowType Mach Q uprime
enstrophy Lambda2 Pe streamFunction vorticity
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. For vorticity:
Calculates and writes the vorticity of velocity field U.
The -noWrite option just outputs the max/min values
without writing the field.

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Utilities in OpenFOAM - some examples
mapFields Maps volume fields from one mesh to another,
reading and interpolating all fields present in the
time directory of both cases. Parallel and
non-parallel cases are handled without the
need to reconstruct them first
blockMesh Mesh generator
fluentMeshToFoam Converts a Fluent mesh to OpenFOAM format
checkMesh Checks validity of a mesh
renumberMesh Renumbers the cell list in order to reduce
the bandwidth, reading and renumbering all the fields
from all the time directories
foamToEnsight Translates OpenFOAM data to Ensight format
Lambda2 Calculates and writes the second largest
eigenvalue of the sum of the square of the symmetrical
and anti-symmetrical parts of the velocity gradient tensor,
at each time in a database
decomposePar Automatically decompose a mesh and fields
for a case for parallel execution of OpenFOAM

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM


POLITECNICO DI MILANO
Additional solvers and utilities

See the Wiki, the Forum, and the OpenFOAM-extend project at SourceForge.

Tommaso Lucchini/ Pre-compiled applications and utilities in OpenFOAM

You might also like