Commit 7283ecbd authored by Chris Greenshields's avatar Chris Greenshields
Browse files

Packaged function objects to plug into OpenFOAM cases

See $FOAM_ETC/caseDicts/postProcessing/README for details
parent 46a44465
Overview
========
- This directory contains files to help post-processing of OpenFOAM cases
- It primariy "packages" functionObject functionality in a convenient form for
users to plug into their OpenFOAM cases
- While some tools are quite generic, e.g. minMax, others are more application-
oriented, e.g. flowRate.
How the tools work
==================
- The configuration of functionObjects includes both required input data and
control parameters for the functionObject
- This creates a lot of input that can be confusing to users
- The tools here are packaged so that the user input is separated from control
parameters
- Control parameters are pre-configured in .cfg files - users can ignore these
files
- For each tool, required user input is all in one file, for the users to copy
into their case and set accordingly
Example of how to use the tools
===============================
Task: monitor flow rate at an outlet patch named "outlet" for a case
Solution:
- locate the flowRatePatch tool in the flowRate directory
- copy the flowRatePatch file into the case system directory (not
flowRatePatch.cfg)
- edit system/flowRatePatch to set the patch name
replace "patch <patchName>;"
with "patch outlet;"
- activate the function object by including the flowRatePatch file in functions
sub-dictionary in the case controlDict file, e.g.
functions
{
#include "flowRatePatch"
... other function objects here ...
}
Current tools
=============
- fields calculate specific fields, e.g. Q
- flowRate tools to calculate flow rate
- forces forces and forceCoeffs for incompressible/compressible flows
- graphs simple sampling for graph plotting, e.g. singleGraph
- minMax range of minimum and maximum field monitoring, e.g. cellMax
- numerical outputs information relating to numerics, e.g. residuals
- pressure calculates different forms of pressure, pressure drop, etc
- probes options for probing data
- scalarTransport for plugin scalar transport calculations
- visualization post-processing VTK files for cutting planes, streamlines,...
- faceSource configuration for some of the tools above
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object faceSource.cfg;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so");
enabled true;
outputControl timeStep;
writeInterval 1;
valueOutput false;
log false;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object faceZoneSource.cfg;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/postProcessing/faceSource/faceSource.cfg"
source faceZone;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object patchSource.cfg;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/postProcessing/faceSource/faceSource.cfg"
source patch;
sourceName $patch;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object surfaceSource.cfg;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/postProcessing/faceSource/faceSource.cfg"
source sampledSurface;
sampledSurfaceDict
{
type sampledTriSurfaceMesh;
surface $triSurface;
source cells;
interpolate true;
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object Lambda2.cfg;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Lambda2
{
#includeEtc "caseDicts/postProcessing/fields/Lambda2.cfg"
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object Lambda2.cfg;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type Lambda2;
functionObjectLibs ("libutilityFunctionObjects.so");
enabled true;
outputControl outputTime;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object Q.cfg;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Q
{
#includeEtc "caseDicts/postProcessing/fields/Q.cfg"
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object Q.cfg;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type Q;
functionObjectLibs ("libutilityFunctionObjects.so");
enabled true;
outputControl outputTime;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object flowRatePatch;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// This packaged function object sums the flux phi on patch faces so the
// calculated volume flow rate for solvers where phi = volumetric flux, and
// mass flow rate for solvers where phi = mass flux.
flowRatePatch
{
patch <patchName>;
#includeEtc "caseDicts/postProcessing/flowRate/flowRatePatch.cfg"
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object flowRatePatch.cfg;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/postProcessing/faceSource/patchSource.cfg"
fields (phi);
operation sum;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object volFlowRateSurface;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// This packaged function object interpolates velocity U onto triangles in
// triSurface file and integrates over the surface area. Triangles need to
// be small (<= cell size) for an accurate integration.
volFlowRateSurface
{
triSurface <triSurfaceFile>;
#includeEtc "caseDicts/postProcessing/flowRate/volFlowRateSurface.cfg"
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object volFlowRateSurface.cfg;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/postProcessing/faceSource/surfaceSource.cfg"
fields (U);
operation areaNormalIntegrate;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object forceCoeffs.cfg;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/postProcessing/forces/forces.cfg"
type forceCoeffs;
rhoInf 1; // Redundant for incompressible
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object forceCoeffsCompressible;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
forceCoeffs
{
patches ( patch1 patch2 );
magUInf 20;
rhoInf 1.225;
lRef 1;
Aref 1;
liftDir (0 0 1);
dragDir (1 0 0);
CofR (0 0 0);
pitchAxis (0 1 0);
#includeEtc "caseDicts/postProcessing/forces/forceCoeffsCompressible.cfg"
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object forceCoeffsCompressible.cfg;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg"
rhoName rho;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object forceCoeffsIncompressible;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
forceCoeffs
{
patches ( patch1 patch2 );
magUInf 20;
lRef 1;
Aref 1;
liftDir (0 0 1);
dragDir (1 0 0);
CofR (0 0 0);
pitchAxis (0 1 0);
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg"
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object forces.cfg;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type forces;
functionObjectLibs ( "libforces.so" );
enabled true;
outputControl timeStep;
outputInterval 1;
pName p;
UName U;
rhoName rhoInf; // Incompressible solver
log off;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object forcesCompressible;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
forces
{
patches ( patch1 patch2 );
CofR (0 0 0);
pitchAxis (0 1 0);
#includeEtc "caseDicts/postProcessing/forces/forcesCompressible.cfg"
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object forcesCompressible.cfg;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/postProcessing/forces/forces.cfg"
rhoName rho;
rhoInf 1; // Redundant
// ************************************************************************* //
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment