Standard utilities

A.2 Standard utilities

The utilities with the OpenFOAM distribution are in the $FOAM_UTILITIES directory, reached quickly by typing util at the command line. Again the names are reasonably descriptive, e.g.ideasToFoam converts mesh data from the format written by I-DEAS to the OpenFOAM format. The current list of utilities distributed with OpenFOAM is given in Table A.2.

Pre-processing


applyBoundaryLayer

Apply a simplified boundary-layer model to the velocity and turbulence fields based on the 1/7th power-law

boxTurb

Create a box of divergence-free turbulence conforming to a given energy spectrum

changeDictionary

Utility to change dictionary entries, e.g. can be used to change the patch type in the field and polyMesh/boundary files

createBoxTurb

Create a box of isotropic turbulence based on a user-specified energy spectrum

createExternalCoupledPatchGeometry

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

Initialise a case for dsmcFoam by reading the initialisation dictionary system/dsmcInitialise

engineSwirl

Generate a swirl flow for engine calculations

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

PDRsetFields

Preparation of fields for PDRFoam

setAlphaField

Uses isoCutCell to create a volume fraction field from either a cylinder, a sphere or a plane

setExprBoundaryFields

Set boundary values using an expression

setExprFields

Set values on a selected set of cells/patch-faces via a dictionary

setFields

Set values on a selected set of cells/patch-faces via a dictionary

viewFactorsGen

View factors are calculated based on a face agglomeration array (finalAgglom generated by faceAgglomerate utility)

wallFunctionTable

Generates a table suitable for use by tabulated wall functions

Mesh generation


blockMesh

A multi-block mesh generator

extrude2DMesh

Create a 3D mesh by extruding a 2D mesh with specified thickness. For the 2D mesh, all faces are 2 points only, no front and back faces

foamyHexMesh

Conformal Voronoi automatic mesh generator

foamyHexMeshBackgroundMesh

Writes out background mesh as constructed by foamyHexMesh and constructs distanceSurface

foamyHexMeshSurfaceSimplify

Simplifies surfaces by resampling

foamyQuadMesh

Conformal-Voronoi 2D extruding automatic mesher with grid or read initial points and point position relaxation with optional ”squarification”

PDRblockMesh

A specialized single-block mesh generator for a rectilinear mesh in x-y-z

snappyHexMesh

Automatic split hex mesher. Refines and snaps to surface

Mesh conversion


ansysToFoam

Convert an ANSYS input mesh file (exported from I-DEAS) to OpenFOAM format

ccmToFoam

Reads CCM files as written by PROSTAR/STARCCM and writes an OPENOpenFOAM polyMesh

foamToCcm

Translates OPENOpenFOAM mesh and/or results to CCM format

cfx4ToFoam

Convert a CFX 4 mesh to OpenFOAM format

datToFoam

Reads in a datToFoam mesh file and outputs a points file. Used in conjunction with blockMesh

fireToFoam

Convert AVL/FIRE polyhedral mesh to OpenFOAM format

fluent3DMeshToFoam

Convert a Fluent mesh to OpenFOAM format

fluentMeshToFoam

Convert a Fluent mesh to OpenFOAM format, including multiple region and region boundary handling

foamMeshToFluent

Write an OpenFOAM mesh in Fluent mesh format

foamToFireMesh

Write an OpenFOAM mesh in AVL/FIRE fpma format

foamToStarMesh

Write an OpenFOAM mesh in STARCD/PROSTAR (v4) bnd/cel/vrt format

foamToSurface

Extract boundaries from an OpenFOAM mesh and write in a surface format

gambitToFoam

Convert a GAMBIT mesh to OpenFOAM format

gmshToFoam

Reads .msh file as written by Gmsh

ideasUnvToFoam

I-Deas unv format mesh conversion

kivaToFoam

Convert a KIVA grid to OpenFOAM

mshToFoam

Convert .msh file generated by the Adventure system

netgenNeutralToFoam

Convert a neutral file format (Netgen v4.4) to OpenFOAM

plot3dToFoam

Plot3d mesh (ascii/formatted format) converter

star4ToFoam

Convert a STARCD/PROSTAR (v4) mesh into OpenFOAM format

tetgenToFoam

Convert tetgen .ele and .node and .face files to an OpenFOAM mesh

vtkUnstructuredToFoam

Convert legacy VTK file (ascii) containing an unstructured grid to an OpenFOAM mesh without boundary information

writeMeshObj

For mesh debugging: writes mesh as three separate OBJ files

Mesh manipulation


attachMesh

Attach topologically detached mesh using prescribed mesh modifiers

autoPatch

Divides external faces into patches based on (user supplied) feature angle

checkMesh

Checks validity of a mesh

createBaffles

Makes internal faces into boundary faces. Does not duplicate points, unlike mergeOrSplitBaffles

createPatch

Create patches out of selected boundary faces, which are either from existing patches or from a faceSet

deformedGeom

Deforms a polyMesh using a displacement field U and a scaling factor supplied as an argument

flattenMesh

Flattens the front and back planes of a 2D cartesian mesh

insideCells

Create a cellSet for cells with their centres ’inside’ the defined surface. Requires surface to be closed and singly connected

mergeMeshes

Merges two meshes

mergeOrSplitBaffles

Detects boundary faces that share points (baffles). Either merges them or duplicate the points

mirrorMesh

Mirrors a mesh around a given plane

moveDynamicMesh

Mesh motion and topological mesh changes utility

moveEngineMesh

Solver for moving meshes for engine calculations

moveMesh

A solver utility for moving meshes

objToVTK

Read obj line (not surface) file and convert into legacy VTK file

orientFaceZone

Corrects the orientation of faceZone

polyDualMesh

Creates the dual of a polyMesh, adhering to all the feature and patch edges

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

rotateMesh

Rotates the mesh and fields from the direction n1   \relax \special {t4ht= to direction n
  2   \relax \special {t4ht=

setSet

Manipulate a cell/face/point Set or Zone interactively

setsToZones

Add pointZones/faceZones/cellZones to the mesh from similar named pointSets/faceSets/cellSets

singleCellMesh

Reads all fields and maps them to a mesh with all internal faces removed (singleCellFvMesh) which gets written to region ”singleCell”

splitMesh

Splits mesh by making internal faces external. Uses attachDetach

splitMeshRegions

Splits mesh into multiple regions

stitchMesh

’Stitches’ a mesh

subsetMesh

Create a mesh subset for a particular region of interest based on a cellSet or cellZone

topoSet

Operates on cellSets/faceSets/pointSets through a dictionary, normally system/topoSetDict

transformPoints

Transforms the mesh points in the polyMesh directory according to the translate, rotate and scale options

zipUpMesh

Reads in a mesh with hanging vertices and ’zips’ up the cells to guarantee that all polyhedral cells of valid shape are closed

Other mesh tools


collapseEdges

Collapses short edges and combines edges that are in line

combinePatchFaces

Checks for multiple patch faces on the same cell and combines them. Multiple patch faces can result from e.g. removal of refined neighbouring cells, leaving 4 exposed faces with same owner

modifyMesh

Manipulate mesh elements

PDRMesh

Mesh and field preparation utility for PDR type simulations

refineHexMesh

Refine a hex mesh by 2x2x2 cell splitting for the specified cellSet

refinementLevel

Attempt to determine the refinement levels of a refined cartesian mesh. Run before snapping

refineWallLayer

Refine cells next to specified patches

removeFaces

Remove faces specified in faceSet by combining cells on both sides

selectCells

Select cells in relation to surface

snappyRefineMesh

Refine cells near to a surface

splitCells

Utility to split cells with flat faces

Finite area


checkFaMesh

Check a finiteArea mesh

makeFaMesh

A mesh generator for finiteArea mesh

Post-processing


noise

Perform noise analysis of pressure data

postProcess

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

Post-processing graphics


Post-processing data converters


foamDataToFluent

Translate OpenFOAM data to Fluent format

foamToEnsight

Translate OpenFOAM data to EnSight format. An Ensight part is created for the internalMesh and for each patch

foamToEnsightParts

Translate OpenFOAM data to Ensight format with an Ensight part for each cellZone and patch

foamToGMV

Translate OpenFOAM output to GMV readable files

foamToTetDualMesh

Convert polyMesh results to tetDualMesh

foamToVTK

General OpenFOAM to VTK file writer

smapToFoam

Translate a STARCD SMAP data file into OpenFOAM field format

Post-processing Lagrangian simulation


particleTracks

Generate a legacy VTK file of particle tracks for cases that were computed using a tracked-parcel-type cloud

steadyParticleTracks

Generate a legacy VTK file of particle tracks for cases that were computed using a steady-state cloud

Post-processing lumped-mass simulation


lumpedPointForces

Extract force/moment information from existing calculations based on the segmentation of the pressure integration zones

lumpedPointMovement

This utility can be used to produce VTK files to visualize the response points/rotations and the corresponding movement of the building surfaces

lumpedPointZones

Produce a VTK PolyData file lumpedPointZones.vtp in which the segmentation of the pressure integration zones can be visualized for diagnostic purposes. Does not use external coupling

Miscellaneous post-processing



engineCompRatio

Calculate the engine geometric compression ratio

pdfPlot

Generate a graph of a probability distribution function

postChannel

Post-process data from channel flow calculations

profilingSummary

Collects information from profiling files in the processor sub-directories and summarizes the number of calls and time spent as max/avg/min values. If the values are identical for all processes, only a single value is written

temporalInterpolate

Interpolate fields between time-steps e.g. for animation

Noise post-processing


noise

Perform noise analysis of pressure data

Post-processing utility


postProcess

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

Surface mesh (e.g. STL) tools



surfaceAdd

Add two surfaces. Does geometric merge on points. Does not check for overlapping/intersecting triangles

surfaceBooleanFeatures

Generates the extendedFeatureEdgeMesh for the interface between a boolean operation on two surfaces

surfaceCheck

Check geometric and topological quality of a surface

surfaceClean

Utility to clean surfaces

surfaceCoarsen

Surface coarsening using ’bunnylod’

surfaceConvert

Converts from one surface mesh format to another

surfaceFeatureConvert

Convert between edgeMesh formats

surfaceFeatureExtract

Extracts and writes surface features to file. All but the basic feature extraction is a work-in-progress

surfaceFind

Finds nearest face and vertex. Uses a zero origin unless otherwise specified

surfaceHookUp

Find close open edges and stitches the surface along them

surfaceInertia

Calculates the inertia tensor, principal axes and moments of a command line specified triSurface

surfaceInflate

Inflates surface. WIP. Checks for overlaps and locally lowers inflation distance

surfaceLambdaMuSmooth

Smooth a surface using lambda/mu smoothing

surfaceMeshConvert

Convert between surface formats with optional scaling or transformations (rotate/translate) on a coordinateSystem

surfaceMeshExport

Export from surfMesh to various third-party surface formats with optional scaling or transformations (rotate/translate) on a coordinateSystem

surfaceMeshExtract

Extract patch or faceZone surfaces from a polyMesh. Depending on output surface format triangulates faces

surfaceMeshImport

Import from various third-party surface formats into surfMesh with optional scaling or transformations (rotate/translate) on a coordinateSystem

surfaceMeshInfo

Miscellaneous information about surface meshes. To simplify parsing of the output, the normal banner information is suppressed

surfaceOrient

Set normal consistent with respect to a user provided ’outside’ point. If the -inside option is used the point is considered inside

surfacePatch

Patches (regionises) a surface using a user-selectable method

surfacePointMerge

Merges points on surface if they are within absolute distance. Since absolute distance use with care!

surfaceRedistributePar

(Re)distribution of triSurface. Either takes an undecomposed surface or an already decomposed surface and redistributes it so that each processor has all triangles that overlap its mesh

surfaceRefineRedGreen

Refine by splitting all three edges of triangle (’red’ refinement)

surfaceSplitByPatch

Writes regions of triSurface to separate files

surfaceSplitByTopology

Strips any baffle parts of a surface

surfaceSplitNonManifolds

Takes multiply connected surface and tries to split surface at multiply connected edges by duplicating points

surfaceSubset

A surface analysis tool that subsets the triSurface to choose a region of interest. Based on subsetMesh

surfaceToPatch

Reads surface and applies surface regioning to a mesh. Uses boundaryMesh to do the hard work

surfaceTransformPoints

Transform (scale/rotate) a surface. Like transformPoints but for surfaces

Parallel processing



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

Thermophysical-related utilities


adiabaticFlameT

Calculate adiabatic flame temperature for a given fuel over a range of unburnt temperatures and equivalence ratios

chemkinToFoam

Convert CHEMKIN 3 thermodynamics and reaction data files into OpenFOAM format

equilibriumCO

Calculate the equilibrium level of carbon monoxide

equilibriumFlameT

Calculate the equilibrium flame temperature for a given fuel and pressure for a range of unburnt gas temperatures and equivalence ratios. Includes the effects of dissociation on O
  2   \relax \special {t4ht=, H2O  \relax \special {t4ht= and CO2   \relax \special {t4ht=

mixtureAdiabaticFlameT

Calculate adiabatic flame temperature for a given mixture at a given temperature

Miscellaneous utilities


foamDictionary

Interrogate and manipulate 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

foamListRegions

List regions from constant/regionProperties

foamListTimes

List times using the timeSelector, or use to remove selected time directories

foamRestoreFields

Restore field names by removing the ending. The fields are selected automatically or can be specified as optional command arguments

addr2line

A simple, partial emulation of addr2line utility for Mac-OS

patchSummary

Write field and boundary condition info for each patch at each requested time instance

Table A.2: Standard utilities.