Sie sind auf Seite 1von 49

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 ow 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 eld the point eld if exists To visualize the mesh make sure that all the regions are toggled on

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

The post processing tool: paraFoam

When paraView is launched the case is controlled from the left panel, which contains the following: Selection Window lists the modules opened in ParaView, 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, such as times, regions and elds Display panel controls the visual representation of the selected module, e.g. colors Information panel gives case statistics such as mesh geometry and size ParaView operates a tree-based structure in which data can be ltered from the toplevel case module to create sets of sub-modules

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

To improve the quality of the mesh Visualization it is possible to overlap the surface of your mesh

Select the extract parts from the lter menu and then select surface visualization of the mesh. Play with the color option to create the desired contrast

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

Viewing elds: display panel


The Display panel contains the settings for visualizing the data/elds for a given case module. The following points are particularly important: the data range is not automatically updated to the max/min limits of a eld, so the user should take care to select Edit Color Map and Reset range at appropriate intervals, in particular after loading the initial case module the style of legend, e.g. font, 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, e.g. a mesh (if Wireframe is selected), 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, 0 = invisible) the activated eld can be translated, scaled, rotated with respect the other ones In the color windows it is possible to select the eld that the user wants to plot

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

Viewing elds: vectorFields (U)


Selecting the velocity eld from the color window in the display panel, two options are available: point volPointInterpolate, the velocity eld is dened on the grid vertex and interpolated from the cell centers cell U the velocity eld is displayed in the cell center It is possible to visualize only the magnitude of velocity, without any information about the direction of the velocity vector: magU . pitzDaily Time = 50 Reading U Calculating magU mag(U): max: 10.619 min: 0.12244 Then select the magU led 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 eld Alternatively the user may use the calculator lter. Keep in mind that it works only for the selected time step

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

Viewing elds: vectorFields (U)


To visualize the velocity led as a eld of vectors you must act on lters once again:

The user must rst create a lter to select the quantities in the cell centers

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

Viewing elds: vectorFields (U)


Starting from the cell center ltered eld, the user must select the Glyphs lter and then accept

The vector eld will be displayed in the window on the right

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO
Viewing elds: glyphs (U)

CHALMERS

The lter 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, where the glyph length is proportional to the vector magnitude, 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. Putting a number lower than the cell number can speed up the visualization Other option rather than arrows are available: cones, cubes, lines, spheres and arrow2d It is possible to select the glyphs lter directly from the ParaView toolbar:

Glyphs button

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

Viewing elds: contour plots


A contour plot is created by selecting Contour from the Filter menu at the top menu bar

Isosurface button

The lter acts on a given module so that, if the module is the 3D case module itself, the contours will be a set of 2D surfaces that represent a constant value, i.e. isosurfaces The Parameters panel for contours contains the list of constant values, that the user can edit, most conveniently by the Generate range of values window. The Input and Scalars menus present the module and elds, respectively, that are read by the lter

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

Viewing elds: streamlines


Streamlines are created by rst creating an append attributes lter Streamlines are created selecting the tracer lines using the Stream Tracer lter The tracer Seed window species 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 specied in the text boxes below

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO
Viewing elds: probes

CHALMERS

To plot a graph in ParaView, the users must rst extract the internal mesh using the Extract Parts lter 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 elds that are plotted are selected in the Point scalars window of the Probe panel

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO
Viewing elds: probes

CHALMERS

The user can select the probe lter directly by clicking onto the probes button on the toolbar

Sample button

It is possible to write the selected sampled elds onto a csv le. The output will be a comma separated le as follows: volPointInterpolate(p),0.200097,5.12835,8.24178,10.3533,... volPointInterpolate(magU),8.63369,8.13691,7.70859,7.37819,.... volPointInterpolate(epsilon),48.1914,52.6348,59.0361,67.6491,7,... volPointInterpolate(k),1.08187,1.13229,1.19894,1.28333,1.3918,...

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

Viewing elds: Data analysis


To plot eld values in a certain point (cell, vertex, line) as a function of time (plotted time steps) the user can select the lter Data analysis form the lter menu or by clicking onto the Data Analysis button on the toolbar:

Data analysis

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO
Viewing elds: 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, point (interpolated), line, cell ID, point ID Plotted elds 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 elds can be written onto a csv le 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 rst use the Cut lter to create the cutting plane, on which the contours can be plotted

The Cut lter 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 lter 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

POLITECNICO DI MILANO
Clip lter

CHALMERS

The Clip lter works similarly to the Cut one, but keeps the mesh and eld information on one side of the cutting plane

The Clip lter allows the user to specify a cutting Plane, Sphere, Box or on the basis of a value for a scalar eld 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
Threshold

CHALMERS

The Threshold lter allows to visualize only the cells having the values of the selected eld within a specied range The range can be specied by means of moving the Upper threshold and lower threshold bars

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

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 . 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 le menu, open, and selecting the VTK directory. By clicking on the *.vtk le 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 les contained in the lagrangian directory inside the VTK folder

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO
Visualizing Lagrangian

CHALMERS

To display the particles the user must lter the lagrangian eld with the Glyphs lter 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

POLITECNICO DI MILANO
The 3D view button

CHALMERS

There are settings controlling the 3D view Properties, selected from the View menu, 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, where white is often a preferred choice for printed material Use parallel projection which is the usual choice for CFD, especially for 2D cases the level of detail (LOD) which controls the rendering of the image while it is being manipulated, e.g. translated, resized, rotated; lowering the levels set by the sliders, 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, for subsequent retrieval using the left mouse button

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

Viewing sets with paraview


The user may create sets (pintSet, faceSet and cellSet) to perform certain additional operation over the elds, i.e. moving certain points or applying a source term only in a certain area A set, i.e. a cellSet, 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 le 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 .

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

Viewing sets with paraview


The user must modify the cellSetDict le in the following way: // Name of set to operate on name myCellSet; // One of clear/new/invert/add/delete|subset/list action new; topoSetSources ( // Cells with cell centre within box boxToCell { box (-0.05 -0.25 -0.001) (0.1 0.25 0.001); } ); To create the cell set the user must run the cellSet application cellSet . pitzDaily

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

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 . pitzDaily -cellSet myCellSet To know all the available option of the foamToVTK application type foamToVTK and press enter. 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 le with the name of the cellSet: myCellSet_*.*

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

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 dened utilities An example could be the ptot utilities which calculates the total pressure starting from the velocity and pressure eld $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

POLITECNICO DI MILANO
Running in parallel

CHALMERS

The method of parallel computing used by OpenFOAM is known as domain decomposition, in which the geometry and associated elds are broken into pieces and allocated to separate processors for solution The rst 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 rst entry is numberOfSubdomains which species 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 elds; running the application in parallel; and, post-processing the decomposed case

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

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 le 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 elds 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 elds are broken up according to a set of parameters specied in a dictionary named decomposeParDict that must be located in the system directory of the case of interest In the decomposeParDict le 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

POLITECNICO DI MILANO

CHALMERS

Running in parallel: domain decomposition


The user has a choice of four methods of decomposition, specied by the method keyword For each method there are a set of coefcients specied in a sub-dictionary of decompositionDict, named <method>Coeffs, 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, e.g. 2 pieces in the x direction, 1 in y etc. hierarchical: Hierarchical geometric decomposition which is the same as simple except the user species the order in which the directional split is done, e.g. rst in the y-direction, 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. 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, where the user directly species the allocation of each cell to a particular processor

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

Running in parallel: domain decomposition


The coefcients sub-dictionary for the simple method are set as follows: simpleCoeffs { n delta }

(2 1 1); 0.001;

Where n is the number of sub-domains in the x, y, z directions (nx ny nz) and delta is the cell skew factor, typically 103 The coefcients sub-dictionary for the hierarchical method are set as follows: hierarchicalCoeffs { n delta order }

(2 2 1); 0.001; xyz;

Where n is the number of sub-domains in the x, y, z directions, delta is the cell skew factor and order is the order of decomposition xyz/xzy/yxz...

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

Running in parallel: domain decomposition


The coefcients sub-dictionary for the metis method are set as follows: metisCoeffs { processorWeights ( 1 ... 1 ); } It is the list of weighting factors for allocation of cells to processors: <wt1> is the weighting factor for processor 1, etc. The coefcients sub-dictionary for the manual method contains the reference to a le manualCoeffs { dataFile }

"<fileName>";

It is the name of le containing data of allocation of cells to processors

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

Running in parallel: domain decomposition


Data les 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. The paths must then be specied in the decomposeParDict dictionary using distributed and roots keywords The distributed entry should read distributed yes; and the roots entry is a list of root paths, <root0>, <root1>, . . . , for each node roots <nRoots> ( "<root0>" "<root1>" ... ); 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 specied in the decomposeParDict dictionary

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

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, a set of subdirectories will have been created, one for each processor, in the case directory The directories are named processorN where N = 0, 1, ... represents a processor number and contains a time directory, containing the decomposed eld descriptions, and a constant/polyMesh directory containing the decomposed mesh description. 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, a le must be created that contains the host names of the machines. The le can be given any name and located at any path

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

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; <foamExec> is the executable, e.g. simpleFoam; and, the output is redirected to a le named log. The <machines> le contains the names of the machines listed, one machine per line The names must correspond to a fully resolved hostname in the /etc/hosts le of the machine on which the openMPI is run. The <machines> le would contain: hostname1 hostname2 cpu=2 hostname3 In our case it becomes: mpirun -np 2 simpleFoam . pitzDailyParallel -parallel > log &

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

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 eld data to recreate the complete domain and elds, which can be post-processed as normal; post-processing each segment of decomposed domain individually

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO

CHALMERS

Running in parallel: post-processing


After a case has been run in parallel, 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 . pitzDailyParallel Time = 0 Reconstructing FV fields Reconstructing volScalarFields p ..... Reconstructing volVectorFields U Reconstructing volTensorFields R No point fields No lagrangian fields

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO
The sample utility

CHALMERS

OpenFOAM provides the sample utility to sample eld data for plotting on graphs The sampling locations are specied 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

POLITECNICO DI MILANO
The sampleDict le

CHALMERS

The sampleDict contains entries to be set according to the user needs interpolationScheme cellPoint; The choice for the interpolationScheme can be one of the following: cell : use cell-centre value only, constant over cells, no interpolation at all cellPoint : use cell-centre and vertex values cellPointFace : use cell-centre, 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 eld (linear, gamma, etc.) writeFormat raw; The choice for the write format depends on the application used to plot the series. The user can choose one of the following: xmgr jplot gnuplot raw

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO
The sampleDict le

CHALMERS

The sampleDict le contains a sampleSet subdictionary which denes where the elds should be sampled sampleSets ( uniform { name axis start end nPoints } )

data; x; (-0.0206 0 0); (0.29 0 0); 1000;

In this subdictionary the user can specify the type of sampling method, 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

POLITECNICO DI MILANO
The sampleDict le

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: specied points, not necessary on line, uses tracking cloud: specied points, uses ndCell name lineX1;

The name entry is typically a lename. After running the sample application the user will nd a new folder in the case directory named sample Each data le is given a name containing the eld name, the sample set name, and an extension relating to the output format, including .xy for raw data, .agr for Grace/xmgr and .dat for jPlot axis distance; Species how to write point coordinates, 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 rst specied sampling point

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO
The sampleDict le
There are also some type specic options:

CHALMERS

start and end coordinate for uniform, face, midPoint and midPointAndFace nPoints number of sampling points for uniform list of coordinates for curve and cloud The elds list contains the elds that the user wishes to sample fields ( p mag(U) U.component(1) R.component(0) ); The sample utility can parse the following restricted set of functions to enable the user to manipulate vector and tensor elds 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
Probes

CHALMERS

To plot values of elds 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 specied eld at the specied location Function objects are created adding them to a function subdict in the controlDict le The user may nd an example of how to modify the controlDict le in $FOAM_TUTORIAL/oodles/pitzDaily/ case This function cannot parse the set of functions as the sample utility does, however in the case of the Ux component extraction the user can easily do that for the U probed eld

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO
Probes

CHALMERS

functions ( probes1 { type probes; // Type of functionObject // Where to load it from (if not already in solver) functionObjectLibs ("libsampling.so"); probeLocations // Locations to be probed. runTime modifiable! ( (0.1778 0.0253 0.0) ); // Fields to be probed. runTime modifiable! fields ( p ); } ); During the job run it will be created, inside the case directory, a folder named probes containing the probed values

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO
foamLog

CHALMERS

There are limitations to monitoring a job by reading the log le, in particular it is difcult to extract trends over a long period of time The foamLog script is therefore provided to extract data of residuals, iterations, Courant number etc. from a log le and present it in a set of les that can be plotted graphically The user must run the application in the following manner: simpleFoam . pitzDaily > log Where the log le can be named arbitrarily The script is executed by foamLog <root> <case> <logFile> The les are stored in a subdirectory of the case directory named logs

Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options

POLITECNICO DI MILANO
foamLog

CHALMERS

Once the log le has been created the foamLog must be executed to generate the required statistics foamLog <root> <case> <logFile> The les are stored in a subdirectory of the case directory named logs Each le has the name <var> <subIter> where <var> is the name of the variable specied in the log le and <subIter> is the iteration number within the time step Those variables that are solved for, the initial residual takes the variable name <var> and nal residual takes varFinalRes. By default, the les 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.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

Das könnte Ihnen auch gefallen