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:
@ -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();
|
||||||
|
|||||||
@ -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/ \
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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;
|
||||||
@ -11,7 +11,7 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/fields/randomise.cfg"
|
#includeEtc "caseDicts/functions/fields/randomise.cfg"
|
||||||
|
|
||||||
field <fieldName>;
|
field <fieldName>;
|
||||||
|
|
||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/forces/forces.cfg"
|
#includeEtc "caseDicts/functions/forces/forces.cfg"
|
||||||
|
|
||||||
type forceCoeffs;
|
type forceCoeffs;
|
||||||
|
|
||||||
@ -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
|
||||||
|
|
||||||
@ -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
|
||||||
|
|
||||||
@ -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
|
||||||
@ -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
|
||||||
|
|
||||||
@ -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
|
||||||
|
|
||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/forces/forces.cfg"
|
#includeEtc "caseDicts/functions/forces/forces.cfg"
|
||||||
|
|
||||||
rho rhoInf;
|
rho rhoInf;
|
||||||
|
|
||||||
@ -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"
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/graphs/graph.cfg"
|
#includeEtc "caseDicts/functions/graphs/graph.cfg"
|
||||||
|
|
||||||
sets
|
sets
|
||||||
(
|
(
|
||||||
@ -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"
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/graphs/graph.cfg"
|
#includeEtc "caseDicts/functions/graphs/graph.cfg"
|
||||||
|
|
||||||
sets
|
sets
|
||||||
(
|
(
|
||||||
@ -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"
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/graphs/graph.cfg"
|
#includeEtc "caseDicts/functions/graphs/graph.cfg"
|
||||||
|
|
||||||
sets
|
sets
|
||||||
(
|
(
|
||||||
@ -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"
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -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"
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -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"
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/graphs/graph.cfg"
|
#includeEtc "caseDicts/functions/graphs/graph.cfg"
|
||||||
|
|
||||||
sets
|
sets
|
||||||
(
|
(
|
||||||
@ -12,7 +12,7 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/numerical/residuals.cfg"
|
#includeEtc "caseDicts/functions/numerical/residuals.cfg"
|
||||||
|
|
||||||
fields (<fieldNames>);
|
fields (<fieldNames>);
|
||||||
|
|
||||||
@ -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
|
||||||
|
|
||||||
@ -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;
|
||||||
@ -11,6 +11,6 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/pressure/totalPressureCompressible.cfg"
|
#includeEtc "caseDicts/functions/pressure/totalPressureCompressible.cfg"
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -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;
|
||||||
@ -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
|
||||||
|
|
||||||
@ -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;
|
||||||
@ -18,6 +18,6 @@ patches (".*");
|
|||||||
|
|
||||||
fields (<fieldNames>);
|
fields (<fieldNames>);
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/probes/boundaryProbes.cfg"
|
#includeEtc "caseDicts/functions/probes/boundaryProbes.cfg"
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -19,6 +19,6 @@ points (<points>);
|
|||||||
|
|
||||||
alpha <alphaName>;
|
alpha <alphaName>;
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/probes/interfaceHeight.cfg"
|
#includeEtc "caseDicts/functions/probes/interfaceHeight.cfg"
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -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
Reference in New Issue
Block a user