Skip to content

Commit

Permalink
Packaged function objects to plug into OpenFOAM cases
Browse files Browse the repository at this point in the history
See $FOAM_ETC/caseDicts/postProcessing/README for details
  • Loading branch information
Chris Greenshields committed May 17, 2015
1 parent 344a6fe commit ff63a1b
Show file tree
Hide file tree
Showing 67 changed files with 1,912 additions and 0 deletions.
52 changes: 52 additions & 0 deletions etc/caseDicts/postProcessing/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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
27 changes: 27 additions & 0 deletions etc/caseDicts/postProcessing/faceSource/faceSource.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / 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;

// ************************************************************************* //
21 changes: 21 additions & 0 deletions etc/caseDicts/postProcessing/faceSource/faceZoneSource.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / 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;

// ************************************************************************* //
22 changes: 22 additions & 0 deletions etc/caseDicts/postProcessing/faceSource/patchSource.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / 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;

// ************************************************************************* //
29 changes: 29 additions & 0 deletions etc/caseDicts/postProcessing/faceSource/surfaceSource.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / 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;
}

// ************************************************************************* //
22 changes: 22 additions & 0 deletions etc/caseDicts/postProcessing/fields/Lambda2
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / 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"
}

// ************************************************************************* //
23 changes: 23 additions & 0 deletions etc/caseDicts/postProcessing/fields/Lambda2.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / 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;

// ************************************************************************* //
22 changes: 22 additions & 0 deletions etc/caseDicts/postProcessing/fields/Q
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / 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"
}

// ************************************************************************* //
23 changes: 23 additions & 0 deletions etc/caseDicts/postProcessing/fields/Q.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / 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;

// ************************************************************************* //
28 changes: 28 additions & 0 deletions etc/caseDicts/postProcessing/flowRate/flowRatePatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / 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"
}

// ************************************************************************* //
22 changes: 22 additions & 0 deletions etc/caseDicts/postProcessing/flowRate/flowRatePatch.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / 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;

// ************************************************************************* //
28 changes: 28 additions & 0 deletions etc/caseDicts/postProcessing/flowRate/volFlowRateSurface
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / 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"
}

// ************************************************************************* //
22 changes: 22 additions & 0 deletions etc/caseDicts/postProcessing/flowRate/volFlowRateSurface.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / 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;

// ************************************************************************* //
22 changes: 22 additions & 0 deletions etc/caseDicts/postProcessing/forces/forceCoeffs.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / 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

// ************************************************************************* //
Loading

0 comments on commit ff63a1b

Please sign in to comment.