foamPostProcess: New volAverage and volIntegrate packaged function objects

These additions mean that the volume-weighted average or volume integral
of a field can be conveniently post-processed. This can be done
interactively using foamPostProcess:

    foamPostProcess -func "volAverage(U)"
    foamPostProcess -func "volIntegrate(rho)"

Or at run-time by adding to the functions sub-section of the
controlDict:

    #includeFunc volAverage(U)
    #includeFunc volIntegrate(rho)
This commit is contained in:
Will Bainbridge
2023-04-19 14:23:56 +01:00
parent 99b36f646a
commit 5c7131288c
14 changed files with 84 additions and 20 deletions

View File

@ -10,7 +10,7 @@ Description
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/minMax/cellMax.cfg"
#includeEtc "caseDicts/postProcessing/volFieldValue/cellMax.cfg"
fields (<fieldNames>);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/minMax/cellMinMax.cfg"
#includeEtc "caseDicts/postProcessing/volFieldValue/volValue.cfg"
operation max;

View File

@ -10,7 +10,7 @@ Description
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/minMax/cellMaxMag.cfg"
#includeEtc "caseDicts/postProcessing/volFieldValue/cellMaxMag.cfg"
fields (<fieldNames>);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/minMax/cellMinMax.cfg"
#includeEtc "caseDicts/postProcessing/volFieldValue/volValue.cfg"
operation maxMag;

View File

@ -10,7 +10,7 @@ Description
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/minMax/cellMin.cfg"
#includeEtc "caseDicts/postProcessing/volFieldValue/cellMin.cfg"
fields (<fieldNames>);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/minMax/cellMinMax.cfg"
#includeEtc "caseDicts/postProcessing/volFieldValue/volValue.cfg"
operation min;

View File

@ -10,7 +10,7 @@ Description
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/minMax/cellMinMag.cfg"
#includeEtc "caseDicts/postProcessing/volFieldValue/cellMinMag.cfg"
fields (<fieldNames>);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/minMax/cellMinMax.cfg"
#includeEtc "caseDicts/postProcessing/volFieldValue/volValue.cfg"
operation minMag;

View File

@ -0,0 +1,17 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
-------------------------------------------------------------------------------
Description
Writes out the volume-weighted average of one or more fields.
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/volFieldValue/volAverage.cfg"
fields (<fieldNames>);
// ************************************************************************* //

View File

@ -0,0 +1,13 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/volFieldValue/volValue.cfg"
operation volAverage;
// ************************************************************************* //

View File

@ -0,0 +1,17 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
-------------------------------------------------------------------------------
Description
Writes out the volume integral of one or more fields.
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/volFieldValue/volIntegrate.cfg"
fields (<fieldNames>);
// ************************************************************************* //

View File

@ -0,0 +1,13 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/volFieldValue/volValue.cfg"
operation volIntegrate;
// ************************************************************************* //

View File

@ -267,17 +267,6 @@ lagrangianFunctions
//#includeFunc dsmcFields
}
minMaxFunctions
{
#includeFunc cellMin(epsilon)
#includeFunc cellMax(k)
#includeFunc cellMinMag(U, writeLocation=yes)
#includeFunc cellMaxMag(U, writeLocation=yes)
}
numericalFunctions
{
#includeFunc residuals(p, U, h, k, epsilon)
@ -410,6 +399,21 @@ surfaceFieldValueFunctions
)
}
volFieldValueFunctions
{
#includeFunc cellMin(epsilon)
#includeFunc cellMax(k)
#includeFunc cellMinMag(U, writeLocation=yes)
#includeFunc cellMaxMag(U, writeLocation=yes)
#includeFunc volAverage(p)
#includeFunc volIntegrate(rho)
}
functions
{
$combustionFunctions;
@ -419,7 +423,6 @@ functions
$forcesFunctions;
$graphsFunctions;
$lagrangianFunctions;
$minMaxFunctions;
$numericalFunctions;
$pressureFunctions;
$probesFunctions;
@ -427,6 +430,7 @@ functions
$streamlinesFunctions;
$surfaceFunctions;
$surfaceFieldValueFunctions;
$volFieldValueFunctions;
}
// ************************************************************************* //