37 namespace functionObjects
72 cumulative_(getProperty<scalar>(
"cumulative"))
87 dict.readIfPresent(
"phi", phiName_);
109 <<
"Unable to find flux field " << phiName_
116 const scalar deltaT = mesh_.time().deltaTValue();
118 const scalar
local = deltaT*
mag(
error)().weightedAverage(mesh_.V()).value();
119 const scalar global = deltaT*
error.weightedAverage(mesh_.V()).value();
120 cumulative_ += global;
124 writeCurrentTime(
os);
128 << cumulative_ <<
endl;
132 <<
" global = " << global <<
nl 133 <<
" cumulative = " << cumulative_ <<
nl 136 setResult(
"local",
local);
137 setResult(
"global", global);
138 setResult(
"cumulative", cumulative_);
140 setProperty<scalar>(
"cumulative", cumulative_);
virtual OFstream & file()
Return access to the file (if only 1)
defineTypeNameAndDebug(ObukhovLength, 0)
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr char tab
The tab '\t' character(0x09)
Abstract base-class for Time/database function objects.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
Class to handle errors and exceptions in a simple, consistent stream-based manner.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A class for handling words, derived from Foam::string.
continuityError(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Computes local, global and cumulative continuity errors for a flux field.
Calculate the divergence of the given field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
virtual bool write()
Write the continuityError.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
virtual bool read(const dictionary &dict)
Read.
virtual bool execute()
Execute, currently does nothing.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual bool read(const dictionary &)
Read the field min/max data.
virtual void writeFileHeader(Ostream &os)
Output file header information.
virtual bool read(const dictionary &dict)
Read optional controls.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Base class for writing single files from the function objects.