functionObjectList: Moved the functions entry from controlDict into a functions file

for consistency with fvModels and fvConstraints, to simplify code and case
maintenance and to avoid the potentially complex functions entries being
unnecessarily parsed by utilities for which functionObject evaluation is
disabled.

The functions entry in controlDict is still read if the functions file is not
present for backward-compatibility, but it is advisable to migrate cases to use
the new functions file.
This commit is contained in:
Henry Weller
2024-01-20 14:46:28 +00:00
parent f47e1b0bab
commit de363dde05
170 changed files with 460 additions and 510 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation \\ / A nd | Copyright (C) 2022-2024 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -279,19 +279,10 @@ int main(int argc, char *argv[])
} }
} }
// Externally stored dictionary for functionObjectList
// if not constructed from runTime
dictionary functionsControlDict("controlDict");
// Construct functionObjectList // Construct functionObjectList
autoPtr<functionObjectList> functionsPtr autoPtr<functionObjectList> functionsPtr
( (
functionObjectList::New functionObjectList::New(args, runTime)
(
args,
runTime,
functionsControlDict
)
); );
forAll(timeDirs, timei) forAll(timeDirs, timei)
@ -303,12 +294,7 @@ int main(int argc, char *argv[])
if (mesh.readUpdate() != fvMesh::UNCHANGED) if (mesh.readUpdate() != fvMesh::UNCHANGED)
{ {
// Update functionObjectList if mesh changes // Update functionObjectList if mesh changes
functionsPtr = functionObjectList::New functionsPtr = functionObjectList::New(args, runTime);
(
args,
runTime,
functionsControlDict
);
} }
FatalIOError.throwExceptions(); FatalIOError.throwExceptions();

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org # \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2018-2024 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -119,7 +119,7 @@ listArgs () {
# Prioritise suggestion locations # Prioritise suggestion locations
_tests="\ _tests="\
caseDicts/postProcessing/ \ caseDicts/functions/ \
caseDicts/preProcessing/ \ caseDicts/preProcessing/ \
caseDicts/general/ \ caseDicts/general/ \
caseDicts/mesh/ \ caseDicts/mesh/ \

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org # \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2018-2024 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -163,7 +163,7 @@ listArgs() {
_tests="\ _tests="\
fields/fvPatchFields/ \ fields/fvPatchFields/ \
fvMesh/fvPatches/ \ fvMesh/fvPatches/ \
caseDicts/postProcessing/" caseDicts/functions/"
_n=0 _n=0
for _t in $_tests for _t in $_tests

View File

@ -10,7 +10,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/fields/fieldAverage.cfg" #includeEtc "caseDicts/functions/fields/fieldAverage.cfg"
mean yes; mean yes;
prime2Mean no; prime2Mean no;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/fields/randomise.cfg" #includeEtc "caseDicts/functions/fields/randomise.cfg"
field <fieldName>; field <fieldName>;

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/forces/forces.cfg" #includeEtc "caseDicts/functions/forces/forces.cfg"
type forceCoeffs; type forceCoeffs;

View File

@ -12,7 +12,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg" #includeEtc "caseDicts/functions/forces/forceCoeffs.cfg"
patches (<patchNames>); // Names of patches on which to calculate forces patches (<patchNames>); // Names of patches on which to calculate forces

View File

@ -12,7 +12,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/forces/forceCoeffsIncompressible.cfg" #includeEtc "caseDicts/functions/forces/forceCoeffsIncompressible.cfg"
patches (<patchNames>); // Names of patches on which to calculate forces patches (<patchNames>); // Names of patches on which to calculate forces

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg" #includeEtc "caseDicts/functions/forces/forceCoeffs.cfg"
rho rhoInf; rho rhoInf;
rhoInf 1; // Redundant, but currently read in rhoInf 1; // Redundant, but currently read in

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/forces/forces.cfg" #includeEtc "caseDicts/functions/forces/forces.cfg"
patches (<patchNames>); // Names of patches on which to calculate forces patches (<patchNames>); // Names of patches on which to calculate forces

View File

@ -12,7 +12,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/forces/forcesIncompressible.cfg" #includeEtc "caseDicts/functions/forces/forcesIncompressible.cfg"
patches (<patchNames>); // Names of patches on which to calculate forces patches (<patchNames>); // Names of patches on which to calculate forces

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/forces/forces.cfg" #includeEtc "caseDicts/functions/forces/forces.cfg"
rho rhoInf; rho rhoInf;

View File

@ -21,6 +21,6 @@ axis distance; // The independent variable of the graph. Can be "x",
// "y", "z", "xyz" (all coordinates written out), or // "y", "z", "xyz" (all coordinates written out), or
// "distance" (from the start point). // "distance" (from the start point).
#includeEtc "caseDicts/postProcessing/graphs/graphCell.cfg" #includeEtc "caseDicts/functions/graphs/graphCell.cfg"
// ************************************************************************* // // ************************************************************************* //

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/graphs/graph.cfg" #includeEtc "caseDicts/functions/graphs/graph.cfg"
sets sets
( (

View File

@ -21,6 +21,6 @@ axis distance; // The independent variable of the graph. Can be "x",
// "y", "z", "xyz" (all coordinates written out), or // "y", "z", "xyz" (all coordinates written out), or
// "distance" (from the start point). // "distance" (from the start point).
#includeEtc "caseDicts/postProcessing/graphs/graphCellFace.cfg" #includeEtc "caseDicts/functions/graphs/graphCellFace.cfg"
// ************************************************************************* // // ************************************************************************* //

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/graphs/graph.cfg" #includeEtc "caseDicts/functions/graphs/graph.cfg"
sets sets
( (

View File

@ -21,6 +21,6 @@ axis distance; // The independent variable of the graph. Can be "x",
// "y", "z", "xyz" (all coordinates written out), or // "y", "z", "xyz" (all coordinates written out), or
// "distance" (from the start point). // "distance" (from the start point).
#includeEtc "caseDicts/postProcessing/graphs/graphFace.cfg" #includeEtc "caseDicts/functions/graphs/graphFace.cfg"
// ************************************************************************* // // ************************************************************************* //

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/graphs/graph.cfg" #includeEtc "caseDicts/functions/graphs/graph.cfg"
sets sets
( (

View File

@ -27,6 +27,6 @@ fields (<fieldsNames>); // Fields to average
//weightField <weightFieldName>; // Field or fields with which to weight //weightField <weightFieldName>; // Field or fields with which to weight
//weightFields (<weightFieldNames>); // the average //weightFields (<weightFieldNames>); // the average
#includeEtc "caseDicts/postProcessing/graphs/graphLayerAverage.cfg" #includeEtc "caseDicts/functions/graphs/graphLayerAverage.cfg"
// ************************************************************************* // // ************************************************************************* //

View File

@ -32,6 +32,6 @@ axis default; // The independent variable of the graph. Can be
fields (<fieldNames>); fields (<fieldNames>);
#includeEtc "caseDicts/postProcessing/graphs/graphPatchCutLayerAverage.cfg" #includeEtc "caseDicts/functions/graphs/graphPatchCutLayerAverage.cfg"
// ************************************************************************* // // ************************************************************************* //

View File

@ -22,6 +22,6 @@ axis distance; // The independent variable of the graph. Can be "x",
// "y", "z", "xyz" (all coordinates written out), or // "y", "z", "xyz" (all coordinates written out), or
// "distance" (from the start point). // "distance" (from the start point).
#includeEtc "caseDicts/postProcessing/graphs/graphUniform.cfg" #includeEtc "caseDicts/functions/graphs/graphUniform.cfg"
// ************************************************************************* // // ************************************************************************* //

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/graphs/graph.cfg" #includeEtc "caseDicts/functions/graphs/graph.cfg"
sets sets
( (

View File

@ -12,7 +12,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/numerical/residuals.cfg" #includeEtc "caseDicts/functions/numerical/residuals.cfg"
fields (<fieldNames>); fields (<fieldNames>);

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/pressure/staticPressureIncompressible.cfg" #includeEtc "caseDicts/functions/pressure/staticPressureIncompressible.cfg"
rhoInf <rhoInf>; // Density with which to scale the kinematic pressure rhoInf <rhoInf>; // Density with which to scale the kinematic pressure

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/pressure/pressure.cfg" #includeEtc "caseDicts/functions/pressure/pressure.cfg"
calcTotal no; calcTotal no;
calcCoeff no; calcCoeff no;

View File

@ -11,6 +11,6 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/pressure/totalPressureCompressible.cfg" #includeEtc "caseDicts/functions/pressure/totalPressureCompressible.cfg"
// ************************************************************************* // // ************************************************************************* //

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/pressure/pressure.cfg" #includeEtc "caseDicts/functions/pressure/pressure.cfg"
calcTotal yes; calcTotal yes;
calcCoeff no; calcCoeff no;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/pressure/totalPressureIncompressible.cfg" #includeEtc "caseDicts/functions/pressure/totalPressureIncompressible.cfg"
rhoInf <rhoInf>; // Density with which to scale the kinematic pressure rhoInf <rhoInf>; // Density with which to scale the kinematic pressure

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/pressure/pressure.cfg" #includeEtc "caseDicts/functions/pressure/pressure.cfg"
calcTotal yes; calcTotal yes;
calcCoeff no; calcCoeff no;

View File

@ -18,6 +18,6 @@ patches (".*");
fields (<fieldNames>); fields (<fieldNames>);
#includeEtc "caseDicts/postProcessing/probes/boundaryProbes.cfg" #includeEtc "caseDicts/functions/probes/boundaryProbes.cfg"
// ************************************************************************* // // ************************************************************************* //

View File

@ -19,6 +19,6 @@ points (<points>);
alpha <alphaName>; alpha <alphaName>;
#includeEtc "caseDicts/postProcessing/probes/interfaceHeight.cfg" #includeEtc "caseDicts/functions/probes/interfaceHeight.cfg"
// ************************************************************************* // // ************************************************************************* //

View File

@ -16,6 +16,6 @@ fields (<fieldNames>);
ordered no; ordered no;
#includeEtc "caseDicts/postProcessing/probes/internalProbes.cfg" #includeEtc "caseDicts/functions/probes/internalProbes.cfg"
// ************************************************************************* // // ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show More