0% found this document useful (0 votes)
105 views27 pages

Post-Processing: Visualization, Sampling, and Plotting: Eric Paterson Egp@vt - Edu

This document discusses post-processing of simulation data, including visualization, sampling, plotting, and run-time data processing. It outlines tools for visualizing data in software like Paraview and Fieldview, sampling data for graph plotting, calculating forces and coefficients, monitoring min/max values, and processing data during simulations using functions like flowRatePatch. The document provides examples of configuring run-time data processing by including functions in the case controlDict file.

Uploaded by

sid202pk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views27 pages

Post-Processing: Visualization, Sampling, and Plotting: Eric Paterson Egp@vt - Edu

This document discusses post-processing of simulation data, including visualization, sampling, plotting, and run-time data processing. It outlines tools for visualizing data in software like Paraview and Fieldview, sampling data for graph plotting, calculating forces and coefficients, monitoring min/max values, and processing data during simulations using functions like flowRatePatch. The document provides examples of configuring run-time data processing by including functions in the case controlDict file.

Uploaded by

sid202pk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Post-processing: visualization, sampling, and plotting

Eric Paterson
egp@vt.edu

Kevin T. Crofton Department of Aerospace and Ocean Engineering


Virginia Polytechnic Institute and State University

ESOP Workshop
5-8 June 2017
Outline

1 Visualization

2 Command line interface

3 Post-processing functionality

4 Run-time data processing

5 The postProcess utility

6 Sampling and monitoring data

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 2 / 27


Visualization

Visualization of data can be accomplished with the following software


Paraview - open source, originally from LANL
Fieldview from Intelligent Light. VT AOE has an academic partnership.
EnSight - commercial software
Tecplot - commercial sofware
All of these packages permit visualization of contours, vectors, streamlines,
iso-surfaces, etc.
Some have special CFD related functionality, e.g., extraction of vortex cores
(Fieldview)
Reading of decomposed data from parallel simulations is important
Robust and fast client-server capability is a discriminator

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 3 / 27


Command line interface (CLI)

All modes of post-processing access the same functionality implemented in


OpenFOAM in the function object framework. Function objects can be listed by
running foamList with the -functionObjects option.
% foamList -functionObjects
The list represents the underlying post-processing functionality. Almost all the
functionality is packaged into a set of configured tools that are conveniently
integrated within the post-processing CLI.
% postProcess -list
This produces a list of tools that are described in the following sections.

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 4 / 27


Field calculation [1]

CourantNo Calculates the Courant Number field from the flux field.
Lambda2 Calculates and writes the second largest eigenvalue of the sum of the
square of the symmetrical and anti-symmetrical parts of the velocity
gradient tensor.
MachNo Calculates the Mach Number field from the velocity field.
PecletNo Calculates the Peclet Number field from the flux field.
Q Calculates the second invariant of the velocity gradient tensor.
R Calculates the Reynolds stress tensor field and stores it on the database.
components Writes the component scalar fields (e.g. Ux, Uy, Uz) of a field (e.g. U).
div Calculates the divergence of a field.
enstrophy Calculates the enstrophy of the velocity field.
flowType Calculates and writes the flowType of velocity field where: -1 = rotational
flow; 0 = simple shear flow; +1 = planar extensional flow.
Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 5 / 27
Field calculation [2]

grad Calculates the gradient of a field.


mag Calculates the magnitude of a field.
magSqr Calculates the magnitude-squared of a field.
randomise Adds a random component to a field, with a specified perturbation
magnitude.
turbulenceFields Calculates specified turbulence fields and stores it on the database.
vorticity Calculates the vorticity field, i.e. the curl of the velocity field.
wallShearStress Calculates the shear stress at wall patches, outputting the data as a
volVectorField.
writeObjects Writes out specified objects, e.g. fields, stored on the case database.
yPlus Calculates the turbulence y+, outputting the data as a yPlus field.

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 6 / 27


Flow rate calculation

flowRatePatch Calculates the flow rate through a specified patch by summing the flux
on patch faces. For solvers where the flux is volumetric, the flow rate is
volumetric; where flux is mass flux, the flow rate is mass flow rate.
fvolFlowRateSurface Calculates volumetric flow rate through a specified triangulated
surface by interpolating velocity onto the triangles and integrating over
the surface area. Triangles need to be small for an accurate result.

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 7 / 27


Forces and force coefficients

forceCoeffsCompressible Calculates lift, drag and moment coefficients by summing


forces on specified patches for a case where the solver is compressible
(pressure is in units M/(LT2 ), e.g. Pa).
forceCoeffsIncompressible Calculates lift, drag and moment coefficients by summing
forces on specified patches for a case where the solver is incompressible
(pressure is kinematic, e.g. m2 /s2 ).
forcesCompressible Calculates pressure and viscous forces over specified patches for a
case where the solver is compressible (pressure is in units M/(LT2 ), e.g.
Pa).
forcesIncompressible Calculates pressure and viscous forces over specified patches for a
case where the solver is incompressible (pressure is kinematic, e.g. m2 /s2 ).

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 8 / 27


Sampling for graph plotting

singleGraph Writes graph data for specified fields along a line, specified by start and
end points.

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 9 / 27


Monitoring minima and maxima

cellMax Writes out the maximum cell value for one or more fields.
ccellMin Writes out the minimum cell value for one or more fields.
cfaceMax Writes out the maximum face value for one or more fields.
cfaceMin Writes out the minimum face value for one or more fields.
cminMaxComponents Writes out the minimum and maximum values, by component for
non-scalar fields, and the locations where they occur.
cminMaxMagnitude Writes out the minimum and maximum values, by magnitude for
non-scalar fields, and the locations where they occur.

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 10 / 27


Numerical data

residuals For specified fields, writes out the initial residuals for the first solution of
each time step; for non-scalar fields (e.g. vectors), writes the largest of
the residuals for each component (e.g. x, y, z).

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 11 / 27


Pressure tools

pressureDifferencePatch Calculates the difference between the average pressures on 2


specified patches.
pressureDifferenceSurface Interpolates pressures onto 2 specified triangulated surfaces
and calculates the difference between the average pressures.
staticPressure Calculates the pressure field in units M/(LT?2) (e.g. Pa) from kinematic
pressure by scaling by a specified density.
totalPressureCompressible Calculates the total pressure field for a case where the solver
is compressible (pressure is in units M/(LT?2), e.g. Pa).
totalPressureIncompressible Calculates the total pressure field for a case where the
solver is incompressible (pressure is kinematic, e.g. m?2/s?2).

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 12 / 27


Probes

boundaryCloud Writes out values of fields at a cloud of points, interpolated to specified


boundary patches.
internalCloud Writes out values of fields interpolated to a specified cloud of points.
probes Writes out values of fields from cells nearest to specified locations.

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 13 / 27


Pluggable solvers

scalarTransport Solves a transport equation for a scalar field.

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 14 / 27


Visualization tools

streamlines Writes out files of streamlines with interpolated field data in VTK format.
surfaces Writes out surface files with interpolated field data in VTK format, e.g.
cutting planes, iso-surfaces and patch boundary surfaces.ld.

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 15 / 27


Run–time data processing [1]

When a user wishes to process data during a simulation, they need to configure
the case accordingly.
The configuration process is as follows, using an example of monitoring flow rate
at an outlet patch named outlet.
Firstly, the user should include the flowRatePatch function in functions
sub-dictionary in the case controlDict file, using the #includeFunc directive.
functions
{
#i n c l u d e F u n c flowRatePatch
}
That will include the functionality in the flowRatePatch configuration file,
located in the directory hierarchy beginning with
$FOAM_ETC/caseDicts/postProcessing .
Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 16 / 27
Run–time data processing [2]

The configuration of flowRatePatch requires the name of the patch to be


supplied. Option 1 for doing this is that the user copies the flowRatePatch file
into their case system directory by
% cp $FOAM_ETC/caseDicts/postProcessing/flowRate/flowRatePatch system
and edits the patch name, in the copied file, as outlet .
When the solver is run, it will pick up an included function in the local case system
directory, in precedence over $FOAM_ETC/caseDicts/postProcessing. The
flow rate through the patch will be calculated and written out into a file within a
directory named postProcessing

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 17 / 27


Run–time data processing [3]

Option 2 for specifying the patch name is to provide the name as an argument to
the flowRatePatch in the #includeFunc directive, using the syntax
keyword=entry.
functions
{
#i n c l u d e F u n c f l o w R a t e P a t c h ( name=o u t l e t )
}
I personally like Option 1. It requires the code to be copied into the system
directory and is more explicit and aids my memory in what was done if I come
back to the case after some length of time.
Also, some functions require the setting of many parameters, e.g.
forces , forceCoeffs , surfaces , etc. For those functions, it is more reliable
and convenient to copy and configure the function using Option 1 rather than
through arguments.
Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 18 / 27
The postProcess utility[1]

The user can execute post-processing functions after the simulation is complete
using the postProcess utility.
Let us illustrate the use of postProcess using the pitzDaily case from the
tutorials directory.
The case can be copied, e.g. into the user’s run directory; the user can then go
into the case directory, generate the mesh with blockMesh and then run
simpleFoam

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 19 / 27


The postProcess utility [2]

% run
% cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily
% cd pitzDaily
% blockMesh
% simpleFoam
% postProcess -func "mag(U)"
% postProcess -func "flowRatePatch(name=outlet)"

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 20 / 27


Sampling and monitoring data

There are a set of general post-processing functions for sampling data across the
domain for graphs and visualization.
Several functions also provide data in a single file, in the form of time versus
values, that can be plotted onto graphs.
This time-value data can be monitored during a simulation with the
foamMonitor script.

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 21 / 27


Probing data [1]

The functions for probing data are boundaryCloud , internalCloud and probes
All functions work on the basis that the user provides some point locations and a list of fields,
and the function writes out values of the fields at those locations
This time-value data can be monitored during a simulation with the foamMonitor script.
probes identifies the nearest cells to the probe locations and writes out the cell values;
data is written into a single file in time-value format, suitable for plotting a graph.
boundaryCloud and internalCloud interpolate field data to the probe locations, with the
locations being snapped onto boundaries for boundaryCloud ; data sets are
written to separate files at scheduled write times
Generally probes is more suitable for monitoring values at smaller numbers of locations, whereas
the cloud functions are typically for sampling at large numbers of locations.

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 22 / 27


Probing data [2]

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 23 / 27


Sampling for graphs [1]

The singleGraph function samples data for graph plotting. To use it, the
singleGraph file should be copied into the system directory to be configured.
% cp -r $FOAM_ETC/caseDicts/postProcessing/graphs/singleGraph system
The start and end points of the line, along which data is sampled, should be edited
The configuration is completed by adding the #includeFunc directive to
functions in the the controlDict file.

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 24 / 27


Sampling for graphs [2]

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 25 / 27


Sampling for visualisation

The surfaces and streamlines functions can be used to generate files for
visualization. The use of streamlines is already configured in the pitzDaily
case.
The surfaces function is configured by copying the surfaces file to the
system directory.
% cp -r $FOAM_ETC/caseDicts/postProcessing/visualization/surfaces system
The file is configured with a set of example surfaces that includes cutting planes,
isosurfaces and patch surfaces. We can edit the file to produce a cutting plane
along the pitzDaily geometry, normal to the z-direction.
The function can be included as normal from the by adding the includeFunc
directive to functions in the the controlDict file.

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 26 / 27


Live monitoring of data

Functions like probes produce a singe file of time-value data, suitable for graph
plotting.
When the function is executed during a simulation, the user may wish to monitor
the data live on screen.
The foamMonitor script enables this; to discover its functionality, the user run it
with the -help option. The help option includes an example of monitoring residuals
that we can demonstrate in this section.
To use the foamMonitor , you will need gnuplot on the server, and the ability
to push the X-window to the client.
foamMonitor -l postProcessing/residuals/0/residuals.dat

Eric Paterson (Virginia Tech AOE) postProcessing 5-8 June 2017 27 / 27

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy