ENH: function object clean-up

This commit is contained in:
Andrew Heather
2016-10-19 15:28:55 +01:00
parent 4408d47075
commit 95347013a8
23 changed files with 110 additions and 326 deletions

View File

@ -22,10 +22,10 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::ddt2 Foam::functionObjects::ddt2
Group Group
grpFVFunctionObjects grpFieldFunctionObjects
Description Description
This function object calculates the magnitude squared This function object calculates the magnitude squared

View File

@ -25,7 +25,7 @@ Class
Foam::functionObjects::externalCoupled Foam::functionObjects::externalCoupled
Group Group
grpUtilitiesFunctionObjects grpFieldFunctionObjects
Description Description
This functionObject provides a simple interface for explicit coupling with This functionObject provides a simple interface for explicit coupling with

View File

@ -28,6 +28,7 @@ Group
grpFieldFunctionObjects grpFieldFunctionObjects
Description Description
Base class for field expression function objects
See also See also
Foam::functionObjects::fvMeshFunctionObject Foam::functionObjects::fvMeshFunctionObject

View File

@ -22,9 +22,10 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::surfaceInterpolate Foam::functionObjects::surfaceInterpolate
Group grpFieldFunctionObjects Group
grpFieldFunctionObjects
Description Description
Linearly interpolates volume fields to generate surface fields. Linearly interpolates volume fields to generate surface fields.

View File

@ -25,7 +25,7 @@ Class
Foam::functionObjects::turbulenceFields Foam::functionObjects::turbulenceFields
Group Group
grpUtilitiesFunctionObjects grpFieldFunctionObjects
Description Description
Stores turbulence fields on the mesh database for further manipulation. Stores turbulence fields on the mesh database for further manipulation.

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::valueAverage Foam::functionObjects::valueAverage
Group Group
grpFieldFunctionObjects grpFieldFunctionObjects

View File

@ -22,10 +22,10 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::zeroGradient Foam::functionObjects::zeroGradient
Group Group
grpFVFunctionObjects grpFieldFunctionObjects
Description Description
This function object creates a volume field with zero-gradient This function object creates a volume field with zero-gradient

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -21,13 +21,13 @@ License
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
OpenFOAM. If not, see <http://www.gnu.org/licenses/>. OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\defgroup grpFieldFunctionObjects Field function objects \defgroup grpSolversFunctionObjects Solver function objects
@{ @{
\ingroup grpFunctionObjects \ingroup grpFunctionObjects
This group contains field-based function objects This group contains solver-based function objects
Function objects in this group are packaged into the Function objects in this group are packaged into the
libfieldFunctionObjects.so library. libsolverFunctionObjects.so library.
@} @}
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -36,6 +36,8 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{
namespace functionObjects
{ {
defineTypeNameAndDebug(codedFunctionObject, 0); defineTypeNameAndDebug(codedFunctionObject, 0);
@ -46,10 +48,11 @@ namespace Foam
dictionary dictionary
); );
} }
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::codedFunctionObject::prepare void Foam::functionObjects::codedFunctionObject::prepare
( (
dynamicCode& dynCode, dynamicCode& dynCode,
const dynamicCodeContext& context const dynamicCodeContext& context
@ -90,25 +93,26 @@ void Foam::codedFunctionObject::prepare
} }
Foam::dlLibraryTable& Foam::codedFunctionObject::libs() const Foam::dlLibraryTable& Foam::functionObjects::codedFunctionObject::libs() const
{ {
return const_cast<Time&>(time_).libs(); return const_cast<Time&>(time_).libs();
} }
Foam::string Foam::codedFunctionObject::description() const Foam::string Foam::functionObjects::codedFunctionObject::description() const
{ {
return "functionObject " + name(); return "functionObject " + name();
} }
void Foam::codedFunctionObject::clearRedirect() const void Foam::functionObjects::codedFunctionObject::clearRedirect() const
{ {
redirectFunctionObjectPtr_.clear(); redirectFunctionObjectPtr_.clear();
} }
const Foam::dictionary& Foam::codedFunctionObject::codeDict() const const Foam::dictionary&
Foam::functionObjects::codedFunctionObject::codeDict() const
{ {
return dict_; return dict_;
} }
@ -116,7 +120,7 @@ const Foam::dictionary& Foam::codedFunctionObject::codeDict() const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::codedFunctionObject::codedFunctionObject Foam::functionObjects::codedFunctionObject::codedFunctionObject
( (
const word& name, const word& name,
const Time& time, const Time& time,
@ -137,13 +141,14 @@ Foam::codedFunctionObject::codedFunctionObject
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::codedFunctionObject::~codedFunctionObject() Foam::functionObjects::codedFunctionObject::~codedFunctionObject()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::functionObject& Foam::codedFunctionObject::redirectFunctionObject() const Foam::functionObject&
Foam::functionObjects::codedFunctionObject::redirectFunctionObject() const
{ {
if (!redirectFunctionObjectPtr_.valid()) if (!redirectFunctionObjectPtr_.valid())
{ {
@ -161,28 +166,28 @@ Foam::functionObject& Foam::codedFunctionObject::redirectFunctionObject() const
} }
bool Foam::codedFunctionObject::execute() bool Foam::functionObjects::codedFunctionObject::execute()
{ {
updateLibrary(name_); updateLibrary(name_);
return redirectFunctionObject().execute(); return redirectFunctionObject().execute();
} }
bool Foam::codedFunctionObject::write() bool Foam::functionObjects::codedFunctionObject::write()
{ {
updateLibrary(name_); updateLibrary(name_);
return redirectFunctionObject().write(); return redirectFunctionObject().write();
} }
bool Foam::codedFunctionObject::end() bool Foam::functionObjects::codedFunctionObject::end()
{ {
updateLibrary(name_); updateLibrary(name_);
return redirectFunctionObject().end(); return redirectFunctionObject().end();
} }
bool Foam::codedFunctionObject::read(const dictionary& dict) bool Foam::functionObjects::codedFunctionObject::read(const dictionary& dict)
{ {
functionObject::read(dict); functionObject::read(dict);

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::codedFunctionObject Foam::functionObjects::codedFunctionObject
Group Group
grpUtilitiesFunctionObjects grpUtilitiesFunctionObjects
@ -80,6 +80,8 @@ SourceFiles
namespace Foam namespace Foam
{ {
namespace functionObjects
{
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class codedFunctionObject Declaration Class codedFunctionObject Declaration
@ -186,6 +188,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace functionObjects
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -25,6 +25,9 @@ License
@{ @{
\ingroup grpFunctionObjects \ingroup grpFunctionObjects
This group contains utility-based function objects This group contains utility-based function objects
Function objects in this group are packaged into the
libutilityFunctionObjects.so library.
@} @}
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -66,10 +66,6 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of classes
class objectRegistry;
namespace functionObjects namespace functionObjects
{ {

View File

@ -33,37 +33,30 @@ using namespace Foam::constant;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{
namespace functionObjects
{ {
defineTypeNameAndDebug(thermoCoupleProbes, 0); defineTypeNameAndDebug(thermoCoupleProbes, 0);
addToRunTimeSelectionTable(functionObject, thermoCoupleProbes, dictionary); addToRunTimeSelectionTable(functionObject, thermoCoupleProbes, dictionary);
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::thermoCoupleProbes::readDict(const dictionary& dict)
{
rho_ = readScalar(dict.lookup("rho"));
Cp_ = readScalar(dict.lookup("Cp"));
d_ = readScalar(dict.lookup("d"));
epsilon_ = readScalar(dict.lookup("epsilon"));
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::thermoCoupleProbes::thermoCoupleProbes Foam::functionObjects::thermoCoupleProbes::thermoCoupleProbes
( (
const word& name, const word& name,
const Time& runTime, const Time& runTime,
const dictionary& dict, const dictionary& dict,
const bool loadFromFiles, const bool loadFromFiles,
const bool doFindElements const bool readFields
) )
: :
probes(name, runTime, dict, loadFromFiles, doFindElements), probes(name, runTime, dict, loadFromFiles, false),
ODESystem(), ODESystem(),
radName_(dict.lookup("radName")), UName_(dict.lookup("U")),
radiationFieldName_(dict.lookup("radiationField")),
thermo_ thermo_
( (
mesh_.lookupObject<fluidThermo>(basicThermo::dictName) mesh_.lookupObject<fluidThermo>(basicThermo::dictName)
@ -71,8 +64,10 @@ Foam::thermoCoupleProbes::thermoCoupleProbes
odeSolver_(ODESolver::New(*this, dict)), odeSolver_(ODESolver::New(*this, dict)),
Ttc_(this->size(), 0.0) Ttc_(this->size(), 0.0)
{ {
if (readFields)
readDict(dict); {
read(dict);
}
// Check if the property exist (resume old calculation) // Check if the property exist (resume old calculation)
// or of it is new. // or of it is new.
@ -85,35 +80,24 @@ Foam::thermoCoupleProbes::thermoCoupleProbes
} }
else else
{ {
Ttc_ = probes::sample(thermo_.T()); Ttc_ = probes::sample(thermo_.T());
}
// Initialize thermocouple at initial T (room temperature)
if (doFindElements)
{
// Find the elements
findElements(mesh_);
// Open the probe streams
prepare();
} }
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::thermoCoupleProbes::~thermoCoupleProbes() Foam::functionObjects::thermoCoupleProbes::~thermoCoupleProbes()
{} {}
Foam::label Foam::thermoCoupleProbes::nEqns() const Foam::label Foam::functionObjects::thermoCoupleProbes::nEqns() const
{ {
return this->size(); return this->size();
} }
void Foam::thermoCoupleProbes::derivatives void Foam::functionObjects::thermoCoupleProbes::derivatives
( (
const scalar x, const scalar x,
const scalarField& y, const scalarField& y,
@ -128,14 +112,14 @@ void Foam::thermoCoupleProbes::derivatives
scalarField Cpc(y.size(), 0.0); scalarField Cpc(y.size(), 0.0);
scalarField kappac(y.size(), 0.0); scalarField kappac(y.size(), 0.0);
if (radName_ != "none") if (radiationFieldName_ != "none")
{ {
G = sample(mesh_.lookupObject<volScalarField>(radName_)); G = sample(mesh_.lookupObject<volScalarField>(radiationFieldName_));
} }
Tc = probes::sample(thermo_.T()); Tc = probes::sample(thermo_.T());
Uc = mag(this->sample(mesh_.lookupObject<volVectorField>("U"))); Uc = mag(this->sample(mesh_.lookupObject<volVectorField>(UName_)));
rhoc = this->sample(thermo_.rho()()); rhoc = this->sample(thermo_.rho()());
kappac = this->sample(thermo_.kappa()()); kappac = this->sample(thermo_.kappa()());
@ -150,8 +134,8 @@ void Foam::thermoCoupleProbes::derivatives
const scalar sigma = physicoChemical::sigma.value(); const scalar sigma = physicoChemical::sigma.value();
scalar area = 4*constant::mathematical::pi*sqr(d_/2); scalar area = 4*constant::mathematical::pi*sqr(0.5*d_);
scalar volume = (4/3)*constant::mathematical::pi*pow(d_/2, 3); scalar volume = (4/3)*constant::mathematical::pi*pow3(0.5*d_);
dydx = dydx =
(epsilon_*(G/4 - sigma*pow(y, 4.0))*area + htc*(Tc - y)*area) (epsilon_*(G/4 - sigma*pow(y, 4.0))*area + htc*(Tc - y)*area)
@ -159,7 +143,7 @@ void Foam::thermoCoupleProbes::derivatives
} }
void Foam::thermoCoupleProbes::jacobian void Foam::functionObjects::thermoCoupleProbes::jacobian
( (
const scalar x, const scalar x,
const scalarField& y, const scalarField& y,
@ -168,18 +152,20 @@ void Foam::thermoCoupleProbes::jacobian
) const ) const
{ {
derivatives(x, y, dfdt); derivatives(x, y, dfdt);
for (label i=0; i<nEqns(); i++)
const label n = nEqns();
for (label i=0; i<n; i++)
{ {
for (label j=0; j<nEqns(); j++) for (label j=0; j<n; j++)
{ {
dfdy(i, j) = 0.0; dfdy(i, j) = 0.0;
} }
} }
} }
bool Foam::thermoCoupleProbes::write() bool Foam::functionObjects::thermoCoupleProbes::write()
{ {
if (this->size()) if (this->size())
{ {
@ -190,11 +176,12 @@ bool Foam::thermoCoupleProbes::write()
setProperty(typeName, probeDict); setProperty(typeName, probeDict);
return true; return true;
} }
return false;
return false;
} }
bool Foam::thermoCoupleProbes::execute() bool Foam::functionObjects::thermoCoupleProbes::execute()
{ {
if (this->size()) if (this->size())
{ {
@ -208,11 +195,18 @@ bool Foam::thermoCoupleProbes::execute()
} }
bool Foam::thermoCoupleProbes::read(const dictionary& dict) bool Foam::functionObjects::thermoCoupleProbes::read(const dictionary& dict)
{ {
readDict(dict); if (probes::read(dict))
probes::read(dict); {
return true; rho_ = readScalar(dict.lookup("rho"));
Cp_ = readScalar(dict.lookup("Cp"));
d_ = readScalar(dict.lookup("d"));
epsilon_ = readScalar(dict.lookup("epsilon"));
return true;
}
return false;
} }

View File

@ -24,10 +24,17 @@ License
Class Class
Foam::functionObjects::thermoCoupleProbes Foam::functionObjects::thermoCoupleProbes
Description Group
Sample probe for temperature using a thermocouple. Uses the correlation: grpUtilitiesFunctionObjects
Nu = 2.0 + (0.4*sqrt(Re) + 0.06*pow(Re, 2/3))*pow(Pr, 0.4) Description
Sample probe for temperature using a thermocouple.
Uses the correlation:
\f[
Nu = 2.0 + \left(0.4 Re^{0.5} + 0.06 Re^{2/3}\right)*Pr^{0.4}
\f]
Example of function object specification: Example of function object specification:
\verbatim \verbatim
@ -47,14 +54,14 @@ Description
d 1e-3; d 1e-3;
epsilon 0.85; epsilon 0.85;
radName G; radiationField G;
functionObjectLibs ("libsampling.so"); libs ("libutilityFunctionObjects.so");
outputControl timeStep; writeControl timeStep;
outputInterval 1; writeInterval 1;
probeLocations probeLocations
( (
( 0.5 0.5 0.5 ) (0.5 0.5 0.5)
); );
fields fields
( (
@ -69,8 +76,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef thermoCoupleProbes_H #ifndef functionObjects_hermoCoupleProbes_H
#define thermoCoupleProbes_H #define functionObjects_hermoCoupleProbes_H
#include "probes.H" #include "probes.H"
#include "ODESystem.H" #include "ODESystem.H"
@ -82,9 +89,11 @@ SourceFiles
namespace Foam namespace Foam
{ {
namespace functionObjects
{
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class thermoCoupleProbes Declaration Class thermoCoupleProbes Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class thermoCoupleProbes class thermoCoupleProbes
@ -108,8 +117,11 @@ protected:
//- Thermocouple emissivity //- Thermocouple emissivity
scalar epsilon_; scalar epsilon_;
//- Name for the incident radiation field //- Name of the velocity field
word radName_; word UName_;
//- Name of the incident radiation field
word radiationFieldName_;
//- Fluid thermo reference //- Fluid thermo reference
const fluidThermo& thermo_; const fluidThermo& thermo_;
@ -131,10 +143,6 @@ protected:
); );
//- Read dictionary settings
void readDict(const dictionary& dict);
private: private:
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
@ -160,7 +168,7 @@ public:
const Time& runTime, const Time& runTime,
const dictionary& dict, const dictionary& dict,
const bool loadFromFiles = false, const bool loadFromFiles = false,
const bool findElements = true const bool readFields = true
); );
@ -202,6 +210,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace functionObjects
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -29,7 +29,7 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type> template<class Type>
void Foam::thermoCoupleProbes::sampleAndWrite void Foam::functionObjects::thermoCoupleProbes::sampleAndWrite
( (
const GeometricField<Type, fvPatchField, volMesh>& vField const GeometricField<Type, fvPatchField, volMesh>& vField
) )
@ -50,4 +50,6 @@ void Foam::thermoCoupleProbes::sampleAndWrite
probeStream << endl; probeStream << endl;
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -46,10 +46,6 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of classes
class objectRegistry;
namespace functionObjects namespace functionObjects
{ {

View File

@ -1,30 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\defgroup grpIOFunctionObjects Input/output function objects
@{
\ingroup grpFunctionObjects
This group contains input/output-based function objects
@}
\*---------------------------------------------------------------------------*/

View File

@ -1,33 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\defgroup grpCloudFunctionObjects Cloud function objects
@{
\ingroup grpFunctionObjects
This group contains cloud-based function objects.
Function objects in this group are packaged into the
libcloudFunctionObjects.so library.
@}
\*---------------------------------------------------------------------------*/

View File

@ -1,100 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
\page pagePostProcessing Post-processing
\section secFunctionObjects Function objects
OpenFOAM includes a collection of \ref grpFunctionObjects that offer users the
opportunity to closely manage their computational analyses. These objects can
be applied to manipulate the workflow process, and provide a mechanism to
extract predicted field and derived quantities at run-time. Alternatively,
the actions can be executed afterwards using the \c execFlowFunctionObjects
utility.
\linebreak
The current range of features comprises of:
- \ref grpCloudFunctionObjects
- \ref grpFieldFunctionObjects
- \ref grpForcesFunctionObjects
- \ref grpFVFunctionObjects
- \ref grpGraphicsFunctionObjects
- \ref grpIOFunctionObjects
- \ref grpJobControlFunctionObjects
- \ref grpUtilitiesFunctionObjects
- \ref grpThermophysicalFunctionObjects
\linebreak
\subsection secFieldFunctionObjectUsage Using function objects
Function objects are defined by additional entries in the
$FOAM_CASE/system/controlDict input dictionary. Each object is listed in a
\c functions sub-dictionary entry, e.g. the following shows the input options
applicable to `output' -type objects:
\verbatim
functions
{
myFunctionObject // user-defined name of function object entry
{
type functionObjectType;
functionObjectLibs ("libMyFunctionObjectlib.so");
region defaultRegion;
enabled yes;
timeStart 0;
timeEnd 10;
evaluateControl timeStep;
evaluateInterval 1;
outputControl outputTime;
outputInterval 1;
...
}
}
\endverbatim
Where:
\table
Property | Description | Required | Default value
type | type of function object | yes |
functionObjectLibs | libraries containing object implementation | yes |
region | name of region for multi-region cases | no |
enabled | on/off switch | no | yes
timeStart| start time | no |
timeEnd | end time | no |
evaluateControl | when to evaluate: either 'outputTime' or 'timeStep'| no | timeStep
evaluateInterval| steps between evaluation when evaluateControl=timeStep | no | 1
outputControl | when to output: either 'outputTime' or 'timeStep'| no | timeStep
outputInterval| steps between output when outputControl=timeStep | no | 1
\endtable
The sub-dictionary name \c myFunctionObject is chosen by the user, and is
typically used as the name of the output directory for any derived data. The
\c type entry defines the type of function object properties that follow.
Since the function objects are packaged into separate libraries, the user must
tell the code where to find the function object implementation, identified
using the \c functionObjectLibs entry.
\*---------------------------------------------------------------------------*/

View File

@ -1,33 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\defgroup grpForcesFunctionObjects Forces function objects
@{
\ingroup grpFunctionObjects
This group contains force-based function objects
Function objects in this group are packaged into the
libforcesFunctionObjects.so library.
@}
\*---------------------------------------------------------------------------*/

View File

@ -1,30 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\defgroup grpJobControlFunctionObjects Job control function objects
@{
\ingroup grpFunctionObjects
This group contains job control-based function objects
@}
\*---------------------------------------------------------------------------*/