Post Processing and Advanced Running Options
Short Description
Download Post Processing and Advanced Running Options...
Description
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
Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options
POLITECNICO DI MILANO
CHALMERS
Before starting 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
CHALMERS
Viewing the mesh 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
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 fields 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 filtered from the toplevel case module to create sets of sub-modules
Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options
POLITECNICO DI MILANO
CHALMERS
Viewing the mesh
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
CHALMERS
Viewing the mesh 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. Play with the color option to create the desired contrast
Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options
POLITECNICO DI MILANO
CHALMERS
Viewing fields: display panel The Display panel contains the settings for visualizing the data/fields 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 field, 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 field can be translated, scaled, 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
POLITECNICO DI MILANO
CHALMERS
Viewing fields: vectorFields (U) Selecting the velocity field from the color window in the display panel, two options are available: point volPointInterpolate, 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, 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 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. 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 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
POLITECNICO DI MILANO
CHALMERS
Viewing fields: vectorFields (U) Starting from the cell center filtered field, 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: glyphs (U) 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, 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 filter directly from the ParaView toolbar:
Glyphs button
Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options
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, 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 fields, respectively, 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
CHALMERS
Viewing fields: probes 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
POLITECNICO DI MILANO
CHALMERS
Viewing fields: probes
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. The output will be a comma separated file 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 fields: Data analysis To plot field values in a certain point (cell, vertex, 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
POLITECNICO DI MILANO
CHALMERS
Viewing fields: probes
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 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
CHALMERS
Cut planes 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
POLITECNICO DI MILANO
CHALMERS
Clip filter
The Clip filter works similarly to the Cut one, 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
CHALMERS
Threshold
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
POLITECNICO DI MILANO
CHALMERS
Visualizing Lagrangian 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 file menu, open, and selecting the VTK directory. By clicking on the *.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
POLITECNICO DI MILANO
CHALMERS
Visualizing Lagrangian 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
POLITECNICO DI MILANO
CHALMERS
The 3D view button 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 fields, 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 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 .
Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options
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; // 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 [-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_*.*
Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options
POLITECNICO DI MILANO
CHALMERS
Data manipulation
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
POLITECNICO DI MILANO
CHALMERS
Running in parallel
The method of parallel computing used by OpenFOAM is known as domain decomposition, 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; running the application in parallel; and, post-processing the decomposed case
Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options
POLITECNICO DI MILANO
CHALMERS
Running in parallel
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
POLITECNICO DI MILANO
CHALMERS
Running in parallel: domain decomposition The user has a choice of four methods of decomposition, specified by the method keyword For each method there are a set of coefficients specified in a sub-dictionary of decompositionDict, named 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 specifies the order in which the directional split is done, e.g. first 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 specifies 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 coefficients 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 10−3 The coefficients 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 coefficients 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: is the weighting factor for processor 1, etc. The coefficients sub-dictionary for the manual method contains the reference to a file manualCoeffs { dataFile }
"";
It is the name of file 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 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. The paths must then be specified 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, , , . . . , for each node roots ( "" "" ... ); where 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
POLITECNICO DI MILANO
CHALMERS
Running in parallel: domain decomposition The decomposePar utility is executed in the normal manner by typing decomposePar 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 field 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 file must be created that contains the host names of the machines. The file 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 -np -parallel > log where: is the number of processors; is the executable, e.g. simpleFoam; and, the output is redirected to a file named log. The file contains the names of the machines listed, 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 file 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 field data to recreate the complete domain and fields, 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 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
CHALMERS
The sample utility 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
POLITECNICO DI MILANO
CHALMERS
The sampleDict file 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 field (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
CHALMERS
The sampleDict file The sampleDict file contains a sampleSet subdictionary which defines where the fields 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
CHALMERS
The sampleDict file 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, not necessary on line, uses tracking cloud: specified points, uses findCell name
lineX1;
The name entry is typically a filename. 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, 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;
Specifies 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 first specified sampling point
Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options
POLITECNICO DI MILANO
CHALMERS
The sampleDict file There are also some type specific options: 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 fields list contains the fields 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 fields 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
CHALMERS
Probes
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, 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
CHALMERS
Probes 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
CHALMERS
foamLog
There are limitations to monitoring a job by reading the log file, 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, iterations, Courant number etc. 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 . pitzDaily > log Where the log file can be named arbitrarily The script is executed by foamLog The files are stored in a subdirectory of the case directory named logs
Gianluca Montenegro/ OpenFOAM postprocessing and advanced running options
POLITECNICO DI MILANO
CHALMERS
foamLog Once the log file has been created the foamLog must be executed to generate the required statistics foamLog The files are stored in a subdirectory of the case directory named logs Each file has the name where is the name of the variable specified in the log file and is the iteration number within the time step Those variables that are solved for, the initial residual takes the variable name and final residual takes ¡var¿FinalRes. By default, 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.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
View more...
Comments