0% found this document useful (0 votes)
5 views23 pages

Openfoam10 PDF

OpenFOAM® is an open-source C++ library designed for solving partial and ordinary differential equations, featuring a wide range of solvers and utilities for computational fluid dynamics and multi-physics applications. It supports massive parallel computing and has an active global community, making it suitable for both academic and industrial use. Users can easily modify existing solvers or create new ones using its flexible programming environment, which promotes code reusability and transparency in modeling.

Uploaded by

Fatima Zehra
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)
5 views23 pages

Openfoam10 PDF

OpenFOAM® is an open-source C++ library designed for solving partial and ordinary differential equations, featuring a wide range of solvers and utilities for computational fluid dynamics and multi-physics applications. It supports massive parallel computing and has an active global community, making it suitable for both academic and industrial use. Users can easily modify existing solvers or create new ones using its flexible programming environment, which promotes code reusability and transparency in modeling.

Uploaded by

Fatima Zehra
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/ 23

Introduction

• OpenFOAM® stands for Open Source Field Operation and Manipulation.


• OpenFOAM® is first and foremost a C++ library used to solve partial differential
equations (PDEs), and ordinary Differential equations (ODEs)
• It comes with several ready-to-use or out-of-the-box solvers, pre-processing utilities and
post-processing utilities.
• It is licensed under the GNU General Public License (GPL) that means it is freely available
and distributed with the source code.
• It can be used in massively parallel computers. No need to pay for separate licenses.
• It is under active development, its capabilities mirror those of commercial CFD
applications.
• It counts with a wide-spread community around the world (Industry, academia and
research labs).

It has extensive multi-physics capabilities:

• Computational fluid dynamics


• Heat transfer and conjugate heat transfer.
• Combustion and chemical reactions
• Multiphase flows and mass transfer
• Stress analysis and fluid-structure interaction.
• Particle methods (DEM, DSMC, MD) and lagrangian particles Tracking.
• Dynamic mesh handling, 6DOF solvers, and adaptive mesh Refinement.
• Computational aero-acoustics, computational electromagnetics, computational solid
mechanics, etc.

How to get best out of this training


• Read the user and programmer’s guide.
• Explore the source code and doxygen documentation (OpenFOAM® C++ documentation)
• Get familiar with all the applications and utilities available by doing all the tutorials
available in the OpenFOAM® Installation.
Useful links
• User manual, programmer manual and source code.
• The Doxygen manual (http://www.openfoam.org/docs/cpp/).
• CFD-Online OpenFOAM user discussion group (http://www.cfd-
online.com/Forums/openfoam/).
• OpenFOAM® wiki (http://www.openfoamwiki.net).
• OpenFOAM® website (http://www.openfoam.com/).
• OpenFOAM® extend project (http://www.extend-project.de).

Description and Implementation


• Finite Volume Method (FVM) based solver.
• Collocated polyhedral unstructured meshes.
• Second order accuracy in space and time. Many discretization schemes available
(including high order methods).
• Pressure-velocity coupling via segregated methods (SIMPLE and PISO).
• Coupled solvers are under active development.
• Massive parallelism through domain decomposition.
• It comes with its own mesh generation tools.
• It also comes with many mesh manipulation and conversion Utilities.
• Meshes generated using many of the major mesh Generators can be converted to
OpenFOAM® format.
• All components implemented in library form for easy re-use.
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:

➢ Basic solvers: Laplace, potential flow, passive scalar Transport.


➢ Incompressible and compressible flows: segregated pressure-based algorithms
(SIMPLE and PISO).
➢ Heat transfer modeling capabilities: buoyancy-driven flows, conjugate heat transfer.
➢ Multiphase flows: Euler-Euler, VOF for free surfaces, multiple phases, cavitation,
phase change.
➢ Combustion and fire dynamic solvers.
➢ Stress analysis, electromagnetics, acoustics, MHD, fluid structure interaction, etc.
You can implement your own solvers.

OpenFOAM® is designed to be a flexible and programmable environment for numerical


simulations by using a high level programming language that is a direct representation of the
equations being solved.

New solvers can be easily implemented using OpenFOAM® high level programming or equation
mimicking, e.g.:

Suppose you want to write a solver for this equation so we have to write only 5/4 lines to code
this & 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 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
FVM (finite volume method) and FVC (finite volume calculus)
These imply the concept of implicit and explicit scheme .It means fvm is implicit and FVC is
always explicit that means for FVC whatever the pressure we are going to use for this gradient,
it comes from the previous time step or from the guess value and For FVM all this comes in
terms of the implicit environment .so whatever the term you require in the implicit ,you type
FVM and whatever the term you require in the explicit way you type as a FVC that is how one
can code any class of the equation so it is called equation mimicking syntax

Modifying Solvers
➢ Equation mimicking syntax, achieved through the use of 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 transfer
➢ Compressible flows
➢ Particle methods (DEM, DSMC, MD)
➢ Other (Solid dynamics, electromagnetics)

1. Basic’ CFD codes


➢ 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 i.e, this solver can be used to solve potential
equations and to create an initial condition for a complete Navier Stoke equations
➢ scalarTransportFoam: Solves a transport equation for a passive scalar

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
➢ nonNewtonianlcoFoam: 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
➢ adjointShapeOptimizationFoam: 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
➢ pimpleDyMFoam:(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
rotation
➢ 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.

Note: Simple implies steady state

Pimple or Piso implies transient state.

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 based algorithm or a pressure based algorithm. If you are working
with a very high speed flows so sometimes 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: (whenever there is a DyM that means it has a capability of mesh movement)

4. Heat transfer and buoyancy-driven flows


➢ buoyantSimpleFoam: Steady-state solver for buoyant, turbulent flow of
compressible fluids
➢ buoyantPimpleFoam: Transient solver for buoyant, turbulent flow of compressible
fluids for ventilation and heat-transfer
➢ chtMultiRegionFoam: Combination of heatConductionFoam and buoyantFoam for
conjugate heat transfer between a solid region and fluid region
➢ buoyantSimpleRadiationFoam: Steady-state solver for buoyant, turbulent flow of
compressible fluids, including radiation, for ventilation and heat-transfer
➢ buoyantBaffleSimpleFoam: Steady-state solver for buoyant, turbulent flow of
compressible fluids using thermal baffles
➢ buoyantBoussinesqPimpleFoam: Transient solver buoyant, turbulent flow of
incompressible fluids
➢ buoyantBoussinesqSimpleFoam: Steady-state solver for buoyant, turbulent flow of
incompressible fluids

5. 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

6. Stress analysis of solids


➢ solidDisplacementFoam: Transient segregated finite-volume solver of linear-
elastic, small-strain deformation of a solid body, with optional thermal diffusion
and thermal stresses
➢ solidEquilibrium DisplacementFoam: Steady-state segregated finite-volume solver
of linear-elastic, small-strain deformation of a solid body, with optional thermal
diffusion and thermal stresses

7. Direct simulation Monte Carlo methods


➢ dsmcFoam: Direct simulation Monte Carlo (DSMO) solver for 3D, transient, multi-
species flows

8. Direct numerical simulation (DNS) and large eddy simulation (LES)


➢ dnsFoam: Direct numerical simulation solver for boxes of isotropic turbulence

9. Molecular dynamics methods


➢ mdEquilibrationFoam: Equilibrates and/or preconditions molecular dynamics
systems
➢ mdFoam: Molecular dynamics solver for fluid dynamics

10. Multiphase flow


➢ bubbleFoam: Solver for a system of 2 incompressible fluid phases with one phase
dispersed, e.g. gas bubbles in a liquid
➢ cavitatingFoam: Transient cavitation code based on the homogeneous equilibrium
model from which the compressibility of the liquid/vapor “mixture” is obtained
➢ compressiblelnterFoam: Solver for 2 compressible, 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
➢ 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
➢ interMixingFoam Solver for 3 incompressible fluids, two of which are miscible,
using a VOF method to capture the interface
➢ 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
➢ 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
➢ MRFInterFoam: Multiple reference frame (MRF) solver for2 incompressible,
isothermal immiscible fluids using a VOF (volume of fluid) phase-fraction based
interface capturing approach
➢ MRFMultiphaselnterFoam: Multiple reference frame (MRF) solver for
incompressible fluids which captures the interfaces and includes surface-tension
and contact-angle effects for each phase
➢ multiphaselnterFoam: Solver for incompressible fluids which captures the
interfaces and includes surface-tension and contact-angle effects for each phase
➢ porousInterFoam: Solver for 2 incompressible, isothermal immiscible fluids using
a VOF (volume of fluid) phase fraction based interface capturing approach, with
explicit handling of porous zones
➢ settlingFoam: Solver for 2 incompressible fluids for simulating the setting 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

Note wherever you see interFoam, it has VOF things enabled in it.

11.Combustion

• chemFoam: Solver for chemistry problems – designed for use on single cell cases to
provide comparison against other chemistry solvers – single cell mesh created on-the-fly
fields created on the fly from the initial conditions
• coldEngineFoam: Solver for cold-flow in internal combustion engines
• dieselEngineFoam: Solver for diesel engine spray and combustion
• dieselFoam: Solver for diesel spray and combustion
• engineFoam: Solver for internal combustion engines
• fireFoam: Transient Solver for Fires and turbulent diffusion flames
• PDRFoam: Solver for compressible premixed/partially premixed combustion with
turbulence modeling
• reactingFoam: Solver for combustion with chemical reactions
• rhoReactingFoam: Solver for combustion with chemical reactions using density based
thermodynamics package
• XiFoam: Solver for compressible premixed/partially premixed combustion with
turbulence modelling

12.Particle-tracking flows

➢ coalChemistryFoam : Transient solver for: - compressible, turbulent flow, with – coal


and limestone parcel injections, energy source, and – combustion
➢ icoUncoupledKinematicParcelDyMFoam: Transient solver for the passive transport of a
single kinematic particle cloud
➢ IcoUncoupledKinematicParcelFoam Transient solver for the passive transport of a single
kinematic particle cloud
➢ porousExplicitSourceReacting ParcelFoam: Transient PISO solver for compressible,
laminar or turbulent flow with reacting multiphase Lagrangian parcels for porous
media, including explicit sources for mass, momentum and energy
➢ reactingParcelFilmFoam Transient PISO solver for compressible, laminar or turbulent
flow with reacting Lagrangian parcels, and surface film modelling
➢ reactingParcelFoam Transient PISO solver for compressible, laminar or turbulent flow
with reacting Lagrangian parcels
➢ LTSReacting ParcelFoam Local time stepping (LTS) solver for steady, compressible,
laminar or turbulent reacting and non-reacting flow with multiphase Lagrangian parcels
and porous media, including explicit sources for mass, momentum and energy
➢ uncoupledKinematicParcelFoam Transient solver for the passive transport of a single
kinematic particle cloud

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.
Two types of mesh

1.blockMesh

• For simple geometries, there is blockMesh, a multi-block mesh generator that generates
meshes of hexahedra from a text configuration file.
• The OpenFOAM distribution contains numerous example configuration files for
blockMesh to generate meshes for flows around simple geometries, e.g. a cylinder, a
wedge, etc.

2.snappyHexMesh

• For complex geometries, there is snappyHexMesh that meshes to surfaces from CAD,
but also allows the user to define simple geometric entities such as boxes, spheres,
planes, etc.
• The snappyHexMesh utility can run in parallel, so can generate meshes of 100s of
millions of cells, given a sufficient number of CPUs and memory.
(let’s say you have to generate the mesh on entire car AC or something where
you are expecting millions of mesh size then it not possible to create a mesh on a
single PC then for that purpose we require the parallel computing environment and
with the help of that a sophisticated mesh can be created.)
• It performs automatic load balancing when generating mesh in parallel, i.e.
redistributes cells across the CPUs, so the final mesh has approximately the same
number cells per processor, for optimal performance during simulation.

Mesh Conversion
OpenFOAM accepts meshes generated by any of the major mesh generators:

• fluent3DMeshToFoam: Converts a Fluent mesh to OPENFOAM® förmat


• fluentMeshToFoam: Converts a Fluent mesh to OPENFOAM® format including multiple
region and region boundary handling
• foamMeshToFluent: Writes out the OPENFOAM® mesh in Fluent mesh format
• cfx4ToFoam: Converts a CFX 4 mesh to OPENFOAM® format
• ansysToFoam: Converts an ANSYS input mesh file, exported from I-DEAS, to
OPENFOAM® format
• ideasUnvToFoam: J-Deas unv format mesh conversion
• kivaToFoam: Converts a KIVA grid to OPENFOAMO format
• plot3dToFoam: Plot3d mesh (ascii/formatted format) converter
• sammToFoam: Converts a STAR-CD (v3) SAMM mesh to OPENFOAM® format
• Star4ToFoam: Converts a STAR-CD (v4) PROSTAR mesh into OPENFOAM® format

Mesh Manipulation
OpenFOAM is supplied with several utilties that perform mesh checking and manipulation.

• checkMesh: Checks validity of a mesh (checkMesh gives you the idea either that mesh
is valid for openFoam or not. It tries to check different aspects of the meshing like its
aspect ratio , skewness, volume either it is negative or positive volume. If
it is not suitable type mesh then OpenFOAM immediately gives an error that this mesh
is not suitable in openFOAM environment and you have to modify this mesh)
• mergeMeshes: Merge two meshes
• mirrorMesh: Mirrors a mesh around a given plane
• setSet: Manipulate a cell/face/point set or zone interactively
• setsToZones: Add pointZones/faceZones/cellZones to the mesh from similar named
pointSets/face Sets/cellSets
• topoSet: Operateson cellSets/face Sets/pointSets through a dictionary
• rotateMesh: Rotates the mesh and fields from the n1 direction to the n2 direction
• moveDynamicMesh: Mesh motion and topological mesh changes utility
• moveEngineMesh: Solver for moving meshes for engine calculations
• createPatch: Utility to create patches out of selected boundary faces. Faces come
either from existing patches or from a faceSet
• autoPatch: Divides external faces into patches based on (user supplied) feature angle

If mesh manipulation utility was not there then to change the mesh one has to first 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 and then perform the other steps but with the Elbow
rotate mesh immediately it will rotate.
Turbulence Models
OpenFOAM offers a large range of methods and models to simulate turbulence.

➢ Reynolds-average simulation (RAS)


➢ Large eddy simulation (LES)
➢ Detached eddy simulation (DES)
➢ Direct numerical simulation (DNS)

More detail visit: http://www.openfoam.org/features/turbulence.php

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.

➢ Newtonian: Linear viscous fluid model


➢ poweLaw: Power-law nonlinear viscous model
➢ InterfaceProperties: Models for the interface, e.g. contact angle, in multiphase
simulations

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.

(as far as transport property is concerned what we require is to set a Reynolds number, for
that we need the density and the viscosity and here we are going to work with the ratio of
viscosity and density ie. kinematic viscosity. So only kinematic viscosity is required to set a
transport property but if you talk about the compressible flow then we require certain
more properties for that basic thermophysical models are available)

Basic thermophysical models

➢ hPsiThermo: General thermophysical model calculation based on enthalpy and


compressibility
➢ hsPsiThermo: General thermophysical model calculation based on sensible
enthalpy and compressibility
➢ ePsiThermo General thermophysical model calculation based on internal energy
and compressibility
➢ hRhoThermo General thermophysical model calculation based on enthalpy
➢ hsRhoThermo General thermophysical model calculation based on sensible
enthalpy
➢ pureMixture General thermophysical model calculation passive gas mixtures

More detail visit: http://www.openfoam.org/features/thermophysical. Php

Lagrangian Particle Tracking


➢ A variety of fluid-flow problems deal with more than one phase and OpenFOAM® has
a Lagrangian particle tracking library for this kind of problem.
➢ The basic Lagrangian library provides an efficient parallelised implementation of
tracking and coupling with the Eulerian phase
➢ The Lagrangian implementation is used as a basis for particle-based flow methods in
OpenFOAM® such as direct simulation Monte-Carlo (DSMC) and molecular dynamics
(MD). Some of the solvers are
➢ coalCombustion: Coal dust combustion modeling
➢ dieselSpray: Diesel spray and injection modeling
➢ distributionModels : Particle distribution function modeling
➢ Dsmc: Direct simulation Monte Carlo method modeling
➢ Lagrangian: Basic Lagrangian, or particle-tracking, solution scheme
➢ LagrangianIntermediate: Particle-tracking kinematics, thermodynamics, multispecies
reactions, particle forces, etc.
➢ potential: Intermolecular potentials for molecular dynamics
➢ molecule: Molecule classes for molecular dynamics
➢ molecularMeasurements: For making measurements in molecular dynamics
➢ solidParticle: Solid particle implementation

The ParaView Post-processor


The paraView İs basically an open source post processor and in the OpenFOAM they created
wrapper over the paraview and it’s called paraFoam so we’re going to work with the paraFoam
but in the background paraView is working .It uses the vtk toolkit format but when we work
with the paraFoam you need not to create the foamtovtk utility but it tries to add up very
quickly with the help of the paraFoam processor

➢ ParaView uses the Visualisation Toolkit (VTK) as its data processing and rendering
engine and can therefore read any data in VTK format.
➢ OpenFOAM includes the foamToVTK utility to convert data from its native format to
VTK format, which means that any VTK-based graphics tools can be used to post-
process OpenFOAM® cases.(let’s say you want the post processing in different post
processer e.g Ansys or EnSight fluent environment then you have to convert the foam
data and foam mesh to the fluent and when you run certain utilities it tries to create a
case and data file you add up that case and data file and do the post processing in
your post processor like Ansys EnSight , Tecplot etc)
➢ The user therefore has the choice of using the reader module or data converter.
Further details about ParaView can be found at http:/www.paraview.org

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.
➢ writeRegisteredObject: 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.

➢ foamDataToFluent: Translates OpenFOAM® data to Fluent format


➢ foamToEnsight: Translates OpenFOAM® data to EnSight format
➢ foamToTecplot360: Tecplot binary file format writer
➢ foamToVTK: Legacy VTK file format writer
BASICS OF LINUX COMMANDS
Opening a Terminal

• On Windows:
With WSL Ubuntu, launch the “Ubuntu” App
• On native ubuntu Linux:

Ctrl-Shift-T (to open gnome-terminal) OR

Search for terminal and click on the app icon

Terminals have Command Prompts


1. Command line means typing on a terminal prompt

(prompt is your username@computername:~$

$ whoami <enter>

(shows your username)

2. Command execution usually throws an output and gives back the prompt

3. Prompts are denoted by $ symbol

$ Exit <enter>

(closes the terminal window)

Directory (Folder) Structure


1. Top most directory is called the “root” directory.

Denoted by “/” (forward slash).

2. Child directories are separated by /


a. /home / sunthar

(windows uses backslash “\”)

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
Navigating Directories on Command Line
All terminal commands are executed inside a specific directory

1.Find your current location pwd (present

working directory)

$ pwd

2. Change to parent directory (..)

$ cd ..

$ pwd

4. Change to your home directory (SHOME, ~)


[any of the following will work]

cd $HOME

cd (change directory)

Absolute Directory Path and Sister Directories


Entire name of a directory from the root / is called the path

1. Path of your home directory is

/home/sunthar

2. Change directly to distant directory


$ cd /usr/local/bin

$ pwd

3. Change to a sister directory bin

$ cd /home

$ cd ../tmp
Listing Directories and Files
1. List out the sub-directories and files under the current directory

$ ls

$ cd /

$ ls

Clear Terminal Screen


Once a while the terminal window gets busy with lots of text, not needed anymore.

To bring it to a clean slate, we can ‘clear’ the screen (equivalent to ‘cls’ of Windows command
prompt)

$ Clear

Creating and Destroying Directories


1. Create (make) a new directory
$ mkdir docs ( make directory named as docs)
$ cd docs ( change directory to docs i.e go to docs folder
2. Destroy (remove) an empty directory:

$ cd ..

$. rmdir docs. (Remove directory named docs)

3. Remove directory and all its contents “folder within the folder” (warning: cannot be
recovered) use:

$. mkdir -p docs/plots/two

$ rm -fr docs (forcibly & recursively delete the directory docs)

$. ls
Command Line Completion
To avoid typing Linux prompt can complete some words for you

$ mkdir -p docs/plots/two

$ ls docs

$. ls do<tab> P<tab><tab>

( automatically types rest of the words by pressing tab key

Screen: ls docs/plots/two/

At the press of every <tabs, any unique words will be filled to result in

$ ls docs/plots/two

Command and Arguments


1. All command line text consist of a command and a series of arguments

$ <command> <arg1> <arg2>

2. Some arguments can be an option (or a key) with a prefix of ‘minus’ or ‘hyphen’ sign:
$. <command> -<key> <arg>
$ mkdir -p docs/plots/two
(this means create a directory named docs/plots/two
-p for path : suppose directory of docs and plots do not exist so we cannot create
“two” directory , the -p will create entire path of directories i.e all the three directories.
Therefore instead of creating the three directories separately we use a single command
to create the three directories.
3. Two or more options can be combined with a single 'minus

$ rm -fr docs is the same as

$. rm -f -r docs

4. Variables can be stored and retrieved


$. MYNAME=sunthar

$. echo $MYNAME

Your First OpenFOAM Solver


1. Create a directory for all your OpenFOAM runs
$ mkdir -p $FOAM_RUN

$. cd $FOAM_RUN

$. pwd

$. cp -r

$FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily

$. cd pitzDaily

$ blockMesh

$ simpleFoam

Viewing results in paraView

$. paraFoam

Viewing Contents of Text files


All of OpenFOAM input files are written in plain text. To quickly view the contents use one of
following

1. Entire file is concatenated on terminal

$ cat constant /physicalProperties

2. File can be seen one by one page


$ more system/controlDict

(will quit the more command and return to prompt)

3. File can be scrolled by line or by page, up or down


$ less system/ fvSchemes
OPENFOAM DIRECTORY

openfoam

applicati bin doc etc platforms src tutorials


ons wmake
foamNew tools caseDicts MomentumT DNS makefiles
solvers ransportMod
els
foamLog Guides codeTemplates basic platforms
test
paraFoam Doxygen config.csh lagrangian combustion rules
utilities
config.sh compressible scripts
finiteVolume

templates discreteMethods src


OpenFOAM

thermoData electromagnetics
Thermophysical
bashrc TransportMode financial
ls
controlDict heatTransfer
& some other
solvers incompressible

lagrangian

mesh
linux64GccDPInt32Opt
multiphase

resources

stressAnalysis

You might also like