37namespace 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;
131 <<
" local = " << local <<
nl
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_);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual bool read()
Re-read model coefficients if they have changed.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Class to handle errors and exceptions in a simple, consistent stream-based manner.
Abstract base-class for Time/database function objects.
Computes local, global and cumulative continuity errors for a flux field.
virtual void writeFileHeader(Ostream &os)
Output file header information.
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Write the continuityError.
virtual bool read(const dictionary &)
Read the field min/max data.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Computes the magnitude of an input field.
Base class for writing single files from the function objects.
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
virtual OFstream & file()
Return access to the file (if only 1)
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
OBJstream os(runTime.globalPath()/outputName)
Calculate the divergence of the given field.
#define WarningInFunction
Report a warning using Foam::Warning.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)
constexpr char tab
The tab '\t' character(0x09)