Go to the documentation of this file.
39 equationInitialResidualCondition,
70 fieldNames_(
dict.lookup(
"fields")),
72 timeStart_(
dict.lookupOrDefault(
"timeStart", -GREAT)),
73 mode_(operatingModeNames.read(
dict.lookup(
"mode")))
75 if (!fieldNames_.size())
78 <<
"No fields supplied: deactivating" <<
endl;
96 bool satisfied =
false;
103 if ((obr_.time().timeIndex() < 3) || (obr_.time().value() < timeStart_))
109 const fvMesh&
mesh = refCast<const fvMesh>(obr_);
114 forAll(fieldNames_, fieldI)
116 const word& fieldName = fieldNames_[fieldI];
118 if (solverDict.
found(fieldName))
121 const scalar residual = sp.first().initialResidual();
122 result[fieldI] = residual;
128 if (residual < value_)
136 if (residual > value_)
145 <<
"Unhandled enumeration "
146 << operatingModeNames[mode_]
159 <<
"Initial residual data not found for field "
160 << fieldNames_[i] <<
endl;
171 <<
"Initial residual data not found for any fields: "
172 <<
"deactivating" <<
endl;
177 if (satisfied && valid)
182 <<
": satisfied using threshold value: " << value_ <<
nl;
187 if (result[resultI] > 0)
191 Info<<
" field: " << fieldNames_[resultI]
192 <<
", residual: " << result[resultI] <<
nl;
Base class for run time conditions.
A class for handling words, derived from string.
Base class for function objects, adding functionality to read/write state information (data required ...
#define forAll(list, i)
Loop across all elements in list.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
static const NamedEnum< operatingMode, 2 > operatingModeNames
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Registry of regIOobjects.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
const dictionary & solverPerformanceDict() const
Return the dictionary of solver performance data.
A list of keyword definitions, which are a keyword followed by any number of values (e....
virtual bool apply()
Apply the condition.
Macros for easy insertion into run-time selection tables.
Mesh data needed to do the Finite Volume discretisation.
errorManip< error > abort(error &err)
equationInitialResidualCondition(const word &name, const objectRegistry &obr, const dictionary &dict, functionObjectState &state)
Constructor.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
word name(const complex &)
Return a string representation of a complex.
Initialise the NamedEnum HashTable from the static list of names.
virtual void write()
Write.
virtual ~equationInitialResidualCondition()
Destructor.