Go to the documentation of this file.
36 namespace functionObjects
72 writeFileHeader<scalar>(os, fieldName);
73 writeFileHeader<vector>(os, fieldName);
74 writeFileHeader<sphericalTensor>(os, fieldName);
75 writeFileHeader<symmTensor>(os, fieldName);
76 writeFileHeader<tensor>(os, fieldName);
90 if (!writeResidualFields_)
95 const word residualName(
"initialResidual:" + fieldName);
105 mesh_.time().timeName(),
115 residualFieldNames_.insert(residualName);
122 Foam::functionObjects::solverInfo::solverInfo
132 writeResidualFields_(
false),
133 residualFieldNames_(),
146 initialised_ =
false;
148 fieldSet_.read(
dict);
150 writeResidualFields_ =
151 dict.getOrDefault(
"writeResidualFields",
false);
153 residualFieldNames_.clear();
168 writeFileHeader(file());
170 if (writeResidualFields_)
172 for (
const word& fieldName : fieldSet_.selectionNames())
174 initialiseResidualField<scalar>(fieldName);
175 initialiseResidualField<vector>(fieldName);
176 initialiseResidualField<sphericalTensor>(fieldName);
177 initialiseResidualField<symmTensor>(fieldName);
178 initialiseResidualField<tensor>(fieldName);
185 writeCurrentTime(file());
187 for (
const word& fieldName : fieldSet_.selectionNames())
189 updateSolverInfo<scalar>(fieldName);
190 updateSolverInfo<vector>(fieldName);
191 updateSolverInfo<sphericalTensor>(fieldName);
192 updateSolverInfo<symmTensor>(fieldName);
193 updateSolverInfo<tensor>(fieldName);
204 for (
const word& residualName : residualFieldNames_)
206 const auto* residualPtr =
216 mesh_.time().timeName(),
228 residual.correctBoundaryConditions();
virtual bool updateSelection()
Update the selection using current contents of obr_.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual bool read(const dictionary &)
Read the controls.
A class for handling words, derived from Foam::string.
virtual OFstream & file()
Return access to the file (if only 1)
A primitive field of type <T> with automated input and output.
bool writtenHeader_
Flag to identify whether the header has been written.
static constexpr const zero Zero
Global zero (0)
bool read(const char *buf, int32_t &val)
Same as readInt32.
Ostream & endl(Ostream &os)
Add newline and flush stream.
wordHashSet selectionNames() const
Return the current field selection.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
This boundary condition applies a zero-gradient condition from the patch internal field onto the patc...
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
virtual void writeBreak(Ostream &os) const
Write a break marker to the stream.
virtual bool execute()
Execute, currently does nothing.
word name(const complex &c)
Return string representation of complex.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool read(const dictionary &dict)
Read optional controls.
Macros for easy insertion into run-time selection tables.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
void writeFileHeader(Ostream &os)
Output file header information.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
virtual bool write()
Write the solverInfo.
solverFieldSelection fieldSet_
Fields to process.
defineTypeNameAndDebug(ObukhovLength, 0)
Base class for writing single files from the function objects.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void createResidualField(const word &fieldName)
Create and store a residual field on the mesh database.