POLITECNICO DI MILANO

CHALMERS

OpenFOAM postprocessing and advanced running options
Gianluca Montenegro

Department of Energy Politecnico di Milano

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

The post processing tool: paraFoam
The main post-processing tool provided with OpenFOAM is the reader module to run with ParaView, an open-source, visualization application The module is compiled into 2 libraries, PVFoamReader and vtkFoam, using version 2.4.4 of ParaView supplied with the OpenFOAM release ParaView uses the Visualization 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. This provides an alternative means for using ParaView with OpenFOAM paraFoam is strictly a script that launches ParaView using the reader module supplied with OpenFOAM It is executed like any of the OpenFOAM utilities with the root directory path and the case directory name as arguments: paraFoam <root> <case>

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO
Before starting

CHALMERS

Before starting with the user should copy two tutorials in his own run folder: cp -r $FOAM_TUTORIALS/simpleFoam/pitzDaily/ $FOAM_RUN/ cp -r $FOAM_TUTORIALS/dieselFoam/aachenBomb $FOAM_RUN/ SimpleFoam is an incompressible steady-state flow solver, while dieselFoam is dedicated to combustion process with spray injection The two cases should also be executed run blockMesh . pitzDaily simpleFoam . pitzDaily blockMesh . aachenBomb dieselFoam . aachenBomb The user should care about reducing the endTime and the writeInterval to have immediately some calculations to post process for the pitzDaily case For the aachenBomb case the user should switch off the chemistry to reduce the computational time

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO
Viewing the mesh

CHALMERS

The mesh can be viewed only in paraFoam since there is no pre-processing tool to view the mesh We shall start with the pitzDaily case of the simpleFoam tutorial: paraFoam $FOAM RUN/ pitzDaily Click the Accept button which will bring up an image of the case geometry in the image display window. In the parameters panel it is possible to choose what you can visualize: the time step the region the vol field the point field if exists To visualize the mesh make sure that all the regions are toggled on

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

regions and fields Display panel controls the visual representation of the selected module. which contains the following: Selection Window lists the modules opened in ParaView. colors Information panel gives case statistics such as mesh geometry and size ParaView operates a tree-based structure in which data can be filtered from the toplevel case module to create sets of sub-modules Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . where the selected modules are highlighted in yellow and the graphics for the given module can be enabled/disabled by clicking the eye button alongside Parameters panel contains the input selections for the case. e.POLITECNICO DI MILANO CHALMERS The post processing tool: paraFoam When paraView is launched the case is controlled from the left panel.g. such as times.

Play wit the actor color menu to select the color you prefer Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .POLITECNICO DI MILANO Viewing the mesh CHALMERS Select property and wireframe of surface to visualize the mesh.

Play with the color option to create the desired contrast Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .POLITECNICO DI MILANO Viewing the mesh CHALMERS To improve the quality of the mesh Visualization it is possible to overlap the surface of your mesh Select the extract parts from the filter menu and then select surface visualization of the mesh.

g.POLITECNICO DI MILANO CHALMERS Viewing fields: display panel The Display panel contains the settings for visualizing the data/fields for a given case module. scaled. so the user should take care to select Edit Color Map and Reset range at appropriate intervals. a mesh (if Wireframe is selected). for the color bar is controlled by in the Scalar Bar panel of the Edit Color Map window the underlying mesh can be represented by selecting Wireframe in the Representation menu the geometry. font. e. in particular after loading the initial case module the style of legend. can be visualized as a single color by selecting Property from the Color by menu and specifying the Actor color the image can be made translucent by editing the value in Opacity (1 = solid.g. The following points are particularly important: the data range is not automatically updated to the max/min limits of a field. e. rotated with respect the other ones In the color windows it is possible to select the field that the user wants to plot Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . 0 = invisible) the activated field can be translated.

12244 Then select the magU filed in the color window If you run the magU utility after having launched paraFoam you will need to change the time step or to update the GUI to visualize the new field Alternatively the user may use the calculator filter. the velocity field is defined on the grid vertex and interpolated from the cell centers cell U the velocity field is displayed in the cell center It is possible to visualize only the magnitude of velocity. two options are available: point volPointInterpolate. without any information about the direction of the velocity vector: magU .619 min: 0. Keep in mind that it works only for the selected time step Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . pitzDaily Time = 50 Reading U Calculating magU mag(U): max: 10.POLITECNICO DI MILANO CHALMERS Viewing fields: vectorFields (U) Selecting the velocity field from the color window in the display panel.

POLITECNICO DI MILANO CHALMERS Viewing fields: vectorFields (U) To visualize the velocity filed as a field of vectors you must act on filters once again: The user must first create a filter to select the quantities in the cell centers Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .

the user must select the Glyphs filter and then accept The vector field will be displayed in the window on the right Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .POLITECNICO DI MILANO CHALMERS Viewing fields: vectorFields (U) Starting from the cell center filtered field.

where the glyph length is proportional to the vector magnitude. cubes.POLITECNICO DI MILANO Viewing fields: glyphs (U) CHALMERS The filter reads an Input and offers a range of Glyphs for which the Arrow0 provides a clear vector plot images In the Orient/Scale window. the most common options for Scale Mode are: Vector Magnitude. Putting a number lower than the cell number can speed up the visualization Other option rather than arrows are available: cones. spheres and arrow2d It is possible to select the glyphs filter directly from the ParaView toolbar: Glyphs button Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . whereas selecting Data Scaling Off each glyph is the same length An additional Scale Factor parameter controls the base length of the glyphs It is possible to select the maximum number of Glyphs to be displayed. lines.

e. the contours will be a set of 2D surfaces that represent a constant value. i. isosurfaces The Parameters panel for contours contains the list of constant values.POLITECNICO DI MILANO CHALMERS Viewing fields: contour plots A contour plot is created by selecting Contour from the Filter menu at the top menu bar Iso−surface button The filter acts on a given module so that. The Input and Scalars menus present the module and fields. that the user can edit. respectively. if the module is the 3D case module itself. most conveniently by the Generate range of values window. that are read by the filter Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .

POLITECNICO DI MILANO CHALMERS Viewing fields: streamlines Streamlines are created by first creating an append attributes filter Streamlines are created selecting the tracer lines using the Stream Tracer filter The tracer Seed window specifies a distribution of tracer points over a Line or Point Cloud The distance the tracer travels and the length of steps the tracer takes are specified in the text boxes below Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .

POLITECNICO DI MILANO Viewing fields: probes CHALMERS To plot a graph in ParaView. the users must first extract the internal mesh using the Extract Parts filter The user can then plot a graph by selecting Probe from the Filter menu In the Probe Object window. the user should select Line and position the line vertically up the center of the domain with a resolution of 50 The fields that are plotted are selected in the Point scalars window of the Probe panel Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .

48..8.37819.12835.7. The output will be a comma separated file as follows: volPointInterpolate(p)...13229.13691...10.POLITECNICO DI MILANO Viewing fields: probes CHALMERS The user can select the probe filter directly by clicking onto the probes button on the toolbar Sample button It is possible to write the selected sampled fields onto a csv file.28333. volPointInterpolate(epsilon).1.8.6491.5.7.3918. volPointInterpolate(k)... volPointInterpolate(magU)..67..200097. Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .1.1.1.0361.8.24178.3533..0..70859.7.1914.1.63369..59.19894..08187.6348.52.

vertex.POLITECNICO DI MILANO CHALMERS Viewing fields: Data analysis To plot field values in a certain point (cell. line) as a function of time (plotted time steps) the user can select the filter Data analysis form the filter menu or by clicking onto the Data Analysis button on the toolbar: Data analysis Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .

point (interpolated). line.POLITECNICO DI MILANO Viewing fields: probes CHALMERS Pick the cell you want to select by positioning the pointer onto it and pressing the p key (pick) The user can pick the cell by means of different query methods: cell. cell ID. point ID Plotted fields can be activated or deactivated The time period can be selected by acting on the slide bar in the temporal parameters window Once again the plotted fields can be written onto a csv file by clicking the save as CSV button Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .

POLITECNICO DI MILANO Cut planes CHALMERS To create a contour plot across a plane rather than producing isosurfaces. the user must first use the Cut filter to create the cutting plane. on which the contours can be plotted The Cut filter allows the user to specify a cutting Plane or Sphere in the Cut Function menu by a center and normal/radius respectively The user can then run the Contour filter on the cut plane to generate contour lines Multiple cut planes can be generated using the Add value or the Generate range of values sub panel Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .

but keeps the mesh and field information on one side of the cutting plane The Clip filter allows the user to specify a cutting Plane. Sphere. Box or on the basis of a value for a scalar field The clip selection can be inverted by activating the Inside out option The visibility option allows the user to activate or deactivate the visibility of the cutting plane. sphere or box Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .POLITECNICO DI MILANO Clip filter CHALMERS The Clip filter works similarly to the Cut one.

POLITECNICO DI MILANO Threshold CHALMERS The Threshold filter allows to visualize only the cells having the values of the selected field within a specified range The range can be specified by means of moving the Upper threshold and lower threshold bars Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .

and selecting the VTK directory. open. By clicking on the *.POLITECNICO DI MILANO Visualizing Lagrangian CHALMERS To visualize the Lagrangian particle tracking the case must be converted into paraview format The user should run the application foamToVTK on the case containing the Lagrangian particle tracking (in our case the aachenBomb tutorial for the dieselFoam application) foamToVTK .vtk file the case will be opened The user may load all the time steps by clicking on the timesteps button and selecting the Add all choice on the new window The use must then open the files contained in the lagrangian directory inside the VTK folder Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . aachenBomb This command will generate an additional folder named VTK inside the case directory The user must start paraview typing the following command: paraview The case can be opened clicking on the file menu.

POLITECNICO DI MILANO Visualizing Lagrangian CHALMERS To display the particles the user must filter the lagrangian field with the Glyphs filter Then the scalar option must be selected in the scale mode window along with the spheres as glyphs Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .

lowering the levels set by the sliders. resized. where white is often a preferred choice for printed material Use parallel projection which is the usual choice for CFD. or alternatively by clicking the small 3D View toggle button at the top left of the image display window The General panel includes the following items which are often worth setting at startup the background color. for subsequent retrieval using the left mouse button Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .g. e. selected from the View menu.POLITECNICO DI MILANO The 3D view button CHALMERS There are settings controlling the 3D view Properties. rotated. especially for 2D cases the level of detail (LOD) which controls the rendering of the image while it is being manipulated. translated. allows cases with large numbers of cells to be re-rendered quickly during manipulation The Annotate panel includes options for including annotations in the image The Display Orientation Axes feature is particularly useful. The Camera panel includes buttons of Standard Views. settings for Camera Controls and the options for detailed Camera Orientation The user can store up to 6 camera positions by clicking on a given button using the right mouse button.

e. i. i. a cellSet.e. faceSet and cellSet) to perform certain additional operation over the fields. moving certain points or applying a source term only in a certain area A set. Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . can be created in OpenFOAM using the command cellSet $FOAM_APP/utilities/mesh/manipulation/cellSet This application creates a list of cells on the base of data read from the cellSetDict file The user shall try to create a new cellSet in the pitzDaily tutorial case run cp -r $FOAM_TUTORIAL/simpleFoam/pitzDaily cd pitzDaily/system cp $FOAM_UTILITIES/mesh/manipulation/cellSet/cellSetDict .POLITECNICO DI MILANO CHALMERS Viewing sets with paraview The user may create sets (pintSet.

pitzDaily Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .25 -0. // One of clear/new/invert/add/delete|subset/list action new.001) (0. topoSetSources ( // Cells with cell centre within box boxToCell { box (-0.POLITECNICO DI MILANO CHALMERS Viewing sets with paraview The user must modify the cellSetDict file in the following way: // Name of set to operate on name myCellSet. } ). To create the cell set the user must run the cellSet application cellSet .1 0.001).05 -0.25 0.

* Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . pitzDaily -cellSet myCellSet To know all the available option of the foamToVTK application type foamToVTK and press enter.POLITECNICO DI MILANO CHALMERS Viewing sets with paraview Once the cellSet has been created run the foamToVTK command on the pitzDaily case using the cellSet option: foamToVTK . It will be displayed the usage of that application Usage: foamToVTK <root> <case> [-surfaceFields] [-ascii] [-faceSet faceSet name] [-mesh mesh name] [-nearCellValue] [-pointSet pointSet name] [-excludePatches patches to exclude] [-allPatches] [-cellSet cellSet name] [-parallel] [-fields fields] [-constant] [-noPointValues] [-latestTime] [-noInternal] [-time time] To visualize the cellSet the user must open the VTK folder (it works also form a already opened paraFoam windows) in the pitzDaily directory and select the file with the name of the cellSet: myCellSet_*.

POLITECNICO DI MILANO Data manipulation CHALMERS It possible to rely on data manipulation utilities which OpanFOAM provides inside its utilities folder OpenFOAM utilities can also be copied and customized to create user defined utilities An example could be the ptot utilities which calculates the total pressure starting from the velocity and pressure field $FOAM_UTILITIES/postProcessing/miscellaneous/ptot It is also possible to export data to be visualized with other post-processing tools >cd $FOAM_UTILITIES/postProcessing/dataConversion >ls foamDataToFluent foamToFieldview9 foamToVTK foamToEnsight foamToGMV smapToFoam Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .

in which the geometry and associated fields are broken into pieces and allocated to separate processors for solution The first step is to decompose the domain using the decomposePar utility The user must edit the dictionary associated with decomposePar named decomposeParDict which is located in the system directory of the case The first entry is numberOfSubdomains which specifies the number of sub-domains into which the case will be decomposed. usually corresponding to the number of processors available for the case The parallel running uses the public domain openMPI implementation of the standard message passing interface (MPI) The process of parallel computation involves: decomposition of mesh and fields. post-processing the decomposed case Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . running the application in parallel. and.POLITECNICO DI MILANO Running in parallel CHALMERS The method of parallel computing used by OpenFOAM is known as domain decomposition.

POLITECNICO DI MILANO Running in parallel CHALMERS We shall use the pitzDaily case for the simpleFoam application tutorial tut cd simpleFoam cd pitzDaily We can copy the pitzDaily case to the pitzDailyParallel cp -r pitzDaily pitzDailyParallel And copy into the system directory the directory the decomposeParDict file available in the pitzdailtExptInlet case cp pitzDailyExptInlet/system/decomposeParDict pitzDailyParallel/system Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .

POLITECNICO DI MILANO CHALMERS Running in parallel: domain decomposition The mesh and fields are decomposed using the decomposePar utility The underlying aim is to break up the domain with minimal effort but in such a way to guarantee a fairly economic solution The geometry and fields are broken up according to a set of parameters specified in a dictionary named decomposeParDict that must be located in the system directory of the case of interest In the decomposeParDict file the user must set the number of domains which the case should be decomposed into: usually it corresponds to the number of cores available for the calculation numberOfSubdomains 2. Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .

hierarchical: Hierarchical geometric decomposition which is the same as simple except the user specifies the order in which the directional split is done. specified by the method keyword For each method there are a set of coefficients specified in a sub-dictionary of decompositionDict. used to instruct the decomposition process method simple/hierarchical/metis/manual. simple: simple geometric decomposition in which the domain is split into pieces by direction. where the user directly specifies the allocation of each cell to a particular processor Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . 2 pieces in the x direction. e. The user can specify a weighting for the decomposition between processors which can be useful on machines with differing performance between processors manual: Manual decomposition.POLITECNICO DI MILANO CHALMERS Running in parallel: domain decomposition The user has a choice of four methods of decomposition. then the x-direction etc metis: METIS decomposition which requires no geometric input from the user and attempts to minimize the number of processor boundaries. first in the y-direction. 1 in y etc. named <method>Coeffs. e.g.g.

z directions (nx ny nz) and delta is the cell skew factor. y. 0. delta is the cell skew factor and order is the order of decomposition xyz/xzy/yxz. y. 0.. xyz.001. z directions. Where n is the number of sub-domains in the x. typically 10−3 The coefficients sub-dictionary for the hierarchical method are set as follows: hierarchicalCoeffs { n delta order } (2 2 1). Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . Where n is the number of sub-domains in the x..POLITECNICO DI MILANO CHALMERS Running in parallel: domain decomposition The coefficients sub-dictionary for the simple method are set as follows: simpleCoeffs { n delta } (2 1 1).001.

POLITECNICO DI MILANO CHALMERS Running in parallel: domain decomposition The coefficients sub-dictionary for the metis method are set as follows: metisCoeffs { processorWeights ( 1 . The coefficients sub-dictionary for the manual method contains the reference to a file manualCoeffs { dataFile } "<fileName>".. } It is the list of weighting factors for allocation of cells to processors: <wt1> is the weighting factor for processor 1. It is the name of file containing data of allocation of cells to processors Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . etc.. 1 ).

. ).. . . <root1>.POLITECNICO DI MILANO CHALMERS Running in parallel: domain decomposition Data files may need to be distributed if only local disks are used in order to improve performance The root path to the case directory may differ between machines.. <root0>. for each node roots <nRoots> ( "<root0>" "<root1>" . The paths must then be specified in the decomposeParDict dictionary using distributed and roots keywords The distributed entry should read distributed yes. . where <nRoots> is the number of roots Each of the processorN directories should be placed in the case directory at each of the root paths specified in the decomposeParDict dictionary Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . and the roots entry is a list of root paths.

POLITECNICO DI MILANO CHALMERS Running in parallel: domain decomposition The decomposePar utility is executed in the normal manner by typing decomposePar <root> <case> The output will look like: Calculating distribution of cells Selecting decompositionMethod metis . Processor 0 Number of cells = 6199 Number of faces shared with processor 1 = 71 Number of processor patches = 1 Number of processor faces = 71 Number of boundary faces = 12667 Processor 1 Number of Number of Number of Number of Number of cells = 6026 faces shared with processor 0 = 71 processor patches = 1 processor faces = 71 boundary faces = 12343 Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options ...

POLITECNICO DI MILANO CHALMERS Running in parallel: domain decomposition On completion.. containing the decomposed field descriptions. . a file must be created that contains the host names of the machines. pitzDailyParallel |------> 0 |------> constant |------> processor0 |------> processor1 |------> system openMPI can be run on a local multiprocessor machine very simply but when running on machines across a network. represents a processor number and contains a time directory. 1.. a set of subdirectories will have been created. one for each processor. The file can be given any name and located at any path Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . in the case directory The directories are named processorN where N = 0. and a constant/polyMesh directory containing the decomposed mesh description.

simpleFoam.POLITECNICO DI MILANO CHALMERS Running in parallel: execution An application is run in parallel using the mpirun command: mpirun --hostfile <machines> -np <nProcs> <foamExec> <root> <case> <otherArgs> -parallel > log where: <nProcs> is the number of processors. The <machines> file would contain: hostname1 hostname2 cpu=2 hostname3 In our case it becomes: mpirun -np 2 simpleFoam . one machine per line The names must correspond to a fully resolved hostname in the /etc/hosts file of the machine on which the openMPI is run. the output is redirected to a file named log. and. pitzDailyParallel -parallel > log & Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . <foamExec> is the executable. e. The <machines> file contains the names of the machines listed.g.

POLITECNICO DI MILANO CHALMERS Running in parallel: post-processing When post-processing cases that have been run in parallel the user has two options: reconstruction of the mesh and field data to recreate the complete domain and fields. post-processing each segment of decomposed domain individually Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . which can be post-processed as normal.

Reconstructing volVectorFields U Reconstructing volTensorFields R No point fields No lagrangian fields Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options ... it can be reconstructed for post-processing by merging the sets of time directories from each processorN directory into a single set of time directories The reconstructPar utility performs such a reconstruction by executing the command: reconstructPar <root> <case> In our case it will become: reconstructPar .POLITECNICO DI MILANO CHALMERS Running in parallel: post-processing After a case has been run in parallel... pitzDailyParallel Time = 0 Reconstructing FV fields Reconstructing volScalarFields p .

POLITECNICO DI MILANO The sample utility CHALMERS OpenFOAM provides the sample utility to sample field data for plotting on graphs The sampling locations are specified for a case through a sampleDict dictionary located in the case system directory The data can be written in a range of formats including well-known graphing packages such as Grace/xmgr. gnuplot and jPlot The sampling can be executed by running the utility application sample according to the application syntax sample . pitzDaily The sampleDict dictionary can be generated with the standard set of keyword entries using FoamX. or by copying a detailed sampleDict from a the sample utility folder: $FOAM_UTILITIES/postProcessing/miscellaneous/sample Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .

The choice for the write format depends on the application used to plot the series. constant over cells.) writeFormat raw. no interpolation at all cellPoint : use cell-centre and vertex values cellPointFace : use cell-centre. gamma. The user can choose one of the following: xmgr jplot gnuplot raw Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . The choice for the interpolationScheme can be one of the following: cell : use cell-centre value only. vertex and face values Vertex values are determined from neighboring cell-centre values whereas face values determined using the current face interpolation scheme for the field (linear.POLITECNICO DI MILANO The sampleDict file CHALMERS The sampleDict contains entries to be set according to the user needs interpolationScheme cellPoint. etc.

(0. 1000. the name of samples and how to write point coordinate plus other parameters depending on the method chosen Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . x. In this subdictionary the user can specify the type of sampling method.29 0 0). (-0.0206 0 0).POLITECNICO DI MILANO The sampleDict file CHALMERS The sampleDict file contains a sampleSet subdictionary which defines where the fields should be sampled sampleSets ( uniform { name axis start end nPoints } ) data.

POLITECNICO DI MILANO The sampleDict file CHALMERS The user may choose one of the following sampling methods: uniform: evenly distributed points on line face: one point per face intersection midPoint: one point per cell. in between two face intersections midPointAndFace: combination of face and midPoint curve: specified points.dat for jPlot axis distance. Specifies how to write point coordinates. uses tracking cloud: specified points. not necessary on line. .xy for raw data. including . The name entry is typically a filename. and an extension relating to the output format. uses findCell name lineX1. options are: x/y/z: x/y/z coordinate only xyz: three columns distance: distance from start of sampling line (if uses line) or distance from first specified sampling point Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . After running the sample application the user will find a new folder in the case directory named sample Each data file is given a name containing the field name.agr for Grace/xmgr and . the sample set name.

face. midPoint and midPointAndFace nPoints number of sampling points for uniform list of coordinates for curve and cloud The fields list contains the fields that the user wishes to sample fields ( p mag(U) U.component(n) writes the nth component of the vector/tensor mag(U) writes the magnitude of the vector/tensor Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .POLITECNICO DI MILANO The sampleDict file There are also some type specific options: CHALMERS start and end coordinate for uniform. The sample utility can parse the following restricted set of functions to enable the user to manipulate vector and tensor fields U.component(1) R.component(0) ).

however in the case of the Ux component extraction the user can easily do that for the U probed field Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .POLITECNICO DI MILANO Probes CHALMERS To plot values of fields as functions of the time the user can rely on the new functionObject class This is a modular plugin that evaluates at every time step the specified field at the specified location Function objects are created adding them to a function subdict in the controlDict file The user may find an example of how to modify the controlDict file in $FOAM_TUTORIAL/oodles/pitzDaily/ case This function cannot parse the set of functions as the sample utility does.

0) ).so"). inside the case directory. } ). During the job run it will be created. runTime modifiable! fields ( p ).0253 0. // Fields to be probed.1778 0. runTime modifiable! ( (0.POLITECNICO DI MILANO Probes CHALMERS functions ( probes1 { type probes. // Type of functionObject // Where to load it from (if not already in solver) functionObjectLibs ("libsampling. probeLocations // Locations to be probed. a folder named probes containing the probed values Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options .

iterations. pitzDaily > log Where the log file can be named arbitrarily The script is executed by foamLog <root> <case> <logFile> The files are stored in a subdirectory of the case directory named logs Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . from a log file and present it in a set of files that can be plotted graphically The user must run the application in the following manner: simpleFoam . in particular it is difficult to extract trends over a long period of time The foamLog script is therefore provided to extract data of residuals. Courant number etc.POLITECNICO DI MILANO foamLog CHALMERS There are limitations to monitoring a job by reading the log file.

awk k_0 kFinalRes_0 kIters_0 p_0 pFinalRes_0 pIters_0 Separator_0 Time_0 UyFinalRes_0 Ux_0 UyIters_0 UxFinalRes_0 UxIters_0 Uy_0 Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options . the initial residual takes the variable name <var> and final residual takes ¡var¿FinalRes. the files are presented in two-column format of time and the extracted values >cd pitzDaily >ls contCumulative_0 contGlobal_0 contLocal_0 epsilon_0 epsilonFinalRes_0 epsilonIters_0 executionTime_0 foamLog. By default.POLITECNICO DI MILANO foamLog CHALMERS Once the log file has been created the foamLog must be executed to generate the required statistics foamLog <root> <case> <logFile> The files are stored in a subdirectory of the case directory named logs Each file has the name <var> <subIter> where <var> is the name of the variable specified in the log file and <subIter> is the iteration number within the time step Those variables that are solved for.