Openfoam
Openfoam
Physical Models
Physical modeling library:
Thermophysical models and physical properties for Liquids and gases.
Transport/rheology models. Newtonian and non Newtonian viscosity
models.
Extensive turbulence modeling capabilities (RANS,SRS, DES and LES).
Lagrangian particle methods (DSMC, MD).
Discrete particle modeling (DPM, MP-PIC). > VOF method for
multiphase flows
Interphase momentum transfer models for multiphase flows.
Combustion, flame speed, chemical reactions, porous media, etc.
Physical Models
Physical modeling library: Discrete particle modeling (DPM, MP-PIC).
VOF method for multiphase flows.
Interphase momentum transfer models for multiphase flows.
Combustion, flame speed, chemical reactions, porous media, etc.
Solvers
OpenFOAM® comes with several ready-to-use or out Of-the box solvers:
you want to let us say write a solver for this equation so we have to write
this only 5/4 line that’s it and with the help of that you Will be able to code
this so you need not to think what discretization method you are going to use
(either you go with Eulerian, implicit explicit crank -nicholson backward
anything you use for temporal & for let's say convective part second order
central difference of finding scheme quick scheme) you need not to think
while you are developing your solver why because when you say divergence
of flux and it will understand whatever the scheme you going to select it
immediately applies the discretization in that part of equation and all the
discretization schemes are coded in terms of the libraries , that library is
readily available .Based on the calling of particular scheme, it immediately
adds up that part
Same in laplacian part , whatever the scheme you going to add up it is going
to work with that immediately
Modifying Solvers
Equation mimicking syntax, achieved through the use o f object
oriented programming, enables users to create custom solvers with
relative ease.
Users have total freedom to modify existing solvers or use them as
the starting point for new solvers.
Access to complete source: no secret modeling tricks or black magic.
OpenFOAM® design encourages code and libraries re-use.
As solvers can be tailored by a user for a specific need, OpenFOAM is
ideal for research and development.
Top level solvers are written in few 100 lines of code, and are
optimized for efficiency.
Core Technology
OpenFOAM® is assembled from components: foundations Libraries
(vectors and tensors algebra, mesh handling, Discretization,
boundary conditions, linear solvers, parallel Computing, etc.),
physical modeling libraries, utilities and Solvers.
All applications and utilities, are compiled using common
functionality in the collection of libraries distributed with
OpenFOAM®.
This ensures consistency across the whole of the OpenFOAM®
distribution, rather than having a suite of Packages compiled from
entirely separate source code.
Transparent solution algorithms which can be viewed by the User,
encouraging better understanding of the underlying Physics.
Standard Solvers
Solver Capabilities
Incompressible flows
Multiphase flows
Combustion
Buoyancy-driven flows
Conjugate heat transter
Compressible flows
Particle methods (DEM, DSMC, MD)
Other (Solid dynamics, electromagnetics)
2. Incompressible flow
simpleFoam: Steady-state solver for incompressible, turbulent flow
icoFoam: Transient solver for incompressible, laminar flow Of
Newtonian fluids
pisoFoam: Transient solver for incompressible flow (pisoFoam has
a certain limitation when we go towards highly complex physics.
So there we try to stick to the pimple form later on we try to
explore what is difference between the two
pimpleFoam: Large time-step transient solver for Incompressible,
flow using the PIMPLE (merged PISO-SIMPLE) algorithm
nonNewtonian lcoFoam: Transient solver for incompressible,
laminar flow of non-Newtonian fluid
channelFoam: Incompressible LES solver for flow in a channel
porousSimpleFoam: Steady-state solver for incompressible,
Turbulent flow with implicit or explicit porosity treatment
adjointShape OptimizationFoam: Steady-state solver for
incompressible, turbulent flow of non-Newtonian fluids with
optimization of duct shape by applying "blockage" in region
causing pressure loss as estimated using an adjoint formulation
boundaryFoam: Steady-state solver for incompressible, 1D
Turbulent flow, typically to generate boundary layer Conditions at
an inlet, for use in a simulation
MRFSimpleFoam: Steady-state solver for incompressible, Turbulent
flow of non-Newtonian fluids with MRF regions
pimpleDyM Foam:(pimple dynamic foam )Transient solver for
incompressible, flow of Newtonian fluids on a moving mesh using
the PIMPLE(merged PISO-SIMPLE) algorithm
shallowWaterFoam: Transient solver for inviscid shallow water
equations with rotaticn
SRFSimpleFoam: Steady-state solver for incompressible, Turbulent
flow of non-Newtonian fluids in a single rotating Frame
windSimpleFoam: Steady-state solver for incompressible,
Turbulent flow with external source in the momentum Equation.
3. Compressible flow
rhoSimpleFoam Steady-state SIMPLE Solver for laminar turbulent
RANS flow of compressible fluids
rhoSimplecFoam Steady-state SIMPLEC solver(C is the character in
simple algorithm) for laminar Or turbulent RANS flow of
compressible fluids
sonicFoam Transient solver for trans-sonic/supersonic, Laminar or
turbulent flow of a compressible gas
sonicLiquidFoam Transient solver for trans-sonic/supersonic,
laminar flow of a compressible liquid
rhoPimpleFoam: Transient solver for laminar or turbulent Flow of
compressible fluids for HVAC and similar applications
rhoPorousMRFLTSPimpleFoam: Transient solver for Laminar or
turbulent flow of compressible fluids with support for porous
media and MRF for HVAC and similar applications, with local time-
stepping for efficient steady state solution
rhoPorousMRFSimpleFoam: Steady-state solver for turbulent flow
of compressible fluids with RANS turbulence modelling, implicit or
explicit porosity treatment and MRF for HVAC and similar
applications
rhoPorousMRFPimpleFoam: Transient solver for laminar or
turbulent flow of compressible fluids with support for porous
media and MRF for HVAC and similar applications
rhoCentralFoam: Density-based compressible flow solver based on
central-upwind schemes of Kurganov and Tadmor (in compressible
environment either you work with the density base algorithm or a
pressure base algorithm. If you are working with a very high
speed flows so sometime the density based algorithm facilitate
much faster convergence as compared to the pressure base so
we stick to the density base type of the solver)
rhoCentralDyMFoam: Density-based compressible flow solver
based on central-upwind schemes of Kurganov and Tadmor with
moving mesh capability and turbulence Modelling
sonicDyMFoam Transient solver for trans-sonic/supersonic, laminar
or turbulent flow of a compressible gas with mesh motion
Note wherever you see interFoam , it has VOF things enabled in it.
11.Combustion
12.Particle-tracking flows
Note: couple of the solvers maybe you will not get directly in the Distributed
version but it's source code will be available online in certain class of the
hosting
Mesh Generation
OpenFOAM supports unstructured meshes of cells of any shape
cells in OpenFOAM can have any number of faces and faces can have
any number of edges
Such complete freedom on cell shape gives greater flexibility for the
generation of meshes around complex shapes, embedded refinement,
etc.
1.blockMesh
2.snappyHexMesh
Mesh Conversion
OpenFOAM accepts meshes generated by any of the major mesh
generators:
Mesh Manipulation
OpenFOAM is supplied with several utilties that perform mesh checking and
manipulation.
If mesh manipulation utility was not there then to change the mesh one
has to firrst modify the mesh from scratch then perform other steps. let’s
say you have put the skew line direction in X but now you want to
change or rotate it to Y direction so either you go back to the Mesh and
change the mesh but with the Elbow rotate mesh immediately it will
rotate.
Turbulence Models
OpenFOAM offers a large range of methods and models to simulate
turbulence.
The type of models implemented in this library are those found in rheology
to describe fluids with a complex structure, e.g. polymers, sludges,
foodstuffs, etc.
Transport Models
Transport models that are primarily temperature dependent, e.g. for
gases, are implemented as part of the thermophysical modelling
library.
OpenFOAM is distributed with a huge library of thermophysical
models and properties that can read from standard libraryTables,
including liquid and gas properties, combustion and flame speed
models.
Run-time Post-processin
1. To check whether the simulation is going in the right direction or not
for that we use the co-processing or run-time processing.Users can
configure an OpenFOAM case to carry out post processing
automatically while the simulation is running using function objects.
The range of available functionality is extensive:
Files of sampled data can be written for graph plotting
files of force coefficients can be written
files containing elements for visual post-processing, e.g. cutting
planes and isosurfaces can be written.
2. One major advantage is that this post-processing can run in parallel.
3. Certain utilities
fieldAverage: temporal averaging of fields.
fieldMinMax: writes min/max values of fields.
fieldValue: averaging/integration across sets of faces/cells,e.g. for
flux across a plane.
readFields: loads fields to the database for post-processing.
surfacelnterpolateFields: generates surfaceFields from volFields for
further postprocessing.
Forces: calculates pressure/viscous forces and moments.
forceCoeffs: calculates lift, drag and moment coefficients.
sampledSet: data sampling along lines, e.g. for graph plotting.
Probes: data probing at point locations.
isoSurface: generation of an isosurface of given fields in one of the
standard sample formats, e.g. VTK.
cuttingPlane: generation of a cuttingPlane with field data in one of
the sample formats.
sampledPatch: generation of a surface of a patch with field data in
one of the sample formats.
systemCall: execute any system call, e.g. email you to tell you your
job is finished.
abortCalculation: Watches for presence of the named file in the case
directory and aborts the calculation if it is present.
partialWrite: allows registered objects, e.g. fields, to be written at
different times (frequencies).
nearWallFields: generates a volField with boundary values from
interpolated internal field. streamLine – generates
streamlines: in one of the sample formats.
timeActivatedFileUpdate: modifies case settings at specified times in
a simulation.
Write RegisteredObject: writes registered objects, e.g. fields that are
not scheduled to be written in the application, i.e. created with
NO_WRITE.
Third-party Post-processing
OpenFOAM is supplied with reader modules and data converters for post-
processing with other third party products.
On Windows:
With WSL Ubuntu, launch the “Ubuntu” App
On native ubuntu linux:
$ whoami <enter>
2. Command execution usually throws an output and gives back the prompt
$ Exit <enter>
3. Special directories
a. /bin, /usr/bin, etc.: binary applications
b. etc: configuration files
c. /home: private user folders (not visible to others)
d. /tmp: temporary scratch space
e. /var: run time files used by the system
$ pwd
$ cd ..
$ pwd
cd $HOME
cd ~
cd
/home/sunthar
$ pwd
$ cd /home
$ cd ../tmp
Listing Directories and Files
1. List out the sub-directories and files under the current directory
$ ls
$ cd /
$ ls
$ Clear
$. mkdir -p docs/plots/two
$ rm -fr docs
$. ls
$ mkdir -p docs/plots/two
$ ls docs
$. ls do<tab> P<tab><tab>
Screen: ls docs/plots/two/
At the press of every <tabs, any unique words will be filled to result in
$ ls docs/plots/two
$. rm -f -r docs
4. Variables can be stored and retrieved
$. MYNAME=sunthar
$. echo $MYNAME
$. cd $FOAM_RUN
$. pwd
$. cp -r
$FOAM_TUTORIALS/incompressible/simpl
eFoam/pitzDaily
$. cd pitzDaily
$ blockMesh
$ simpleFoam
Viewing results in paraView
$. paraFoam