Go to the documentation of this file.
50 functionObjectName_(
dict.lookup(
"functionObjectName")),
51 fieldNames_(
dict.lookup(
"fields")),
53 window_(
dict.lookupOrDefault<scalar>(
"window", -1)),
54 totalTime_(fieldNames_.size(), obr_.time().deltaTValue()),
55 resetOnRestart_(
false)
61 forAll(fieldNames_, fieldI)
63 const word& fieldName = fieldNames_[fieldI];
65 if (
dict.found(fieldName))
85 bool satisfied =
true;
92 scalar dt = obr_.time().deltaTValue();
94 if (log_)
Info<<
" " <<
type() <<
": " << name_ <<
" averages:" <<
nl;
98 forAll(fieldNames_, fieldI)
100 const word& fieldName(fieldNames_[fieldI]);
102 scalar Dt = totalTime_[fieldI];
103 scalar
alpha = (Dt - dt)/Dt;
108 if (Dt - dt >= window_)
110 alpha = (window_ - dt)/window_;
121 bool processed =
false;
122 calc<scalar>(fieldName,
alpha,
beta, satisfied, processed);
123 calc<vector>(fieldName,
alpha,
beta, satisfied, processed);
124 calc<sphericalTensor>(fieldName,
alpha,
beta, satisfied, processed);
125 calc<symmTensor>(fieldName,
alpha,
beta, satisfied, processed);
126 calc<tensor>(fieldName,
alpha,
beta, satisfied, processed);
130 unprocessedFields.
append(fieldI);
133 totalTime_[fieldI] += dt;
136 if (unprocessedFields.size())
139 <<
"From function object: " << functionObjectName_ <<
nl
140 <<
"Unprocessed fields:" <<
nl;
142 forAll(unprocessedFields, i)
144 label fieldI = unprocessedFields[i];
145 Info<<
" " << fieldNames_[fieldI] <<
nl;
157 dictionary& conditionDict = this->conditionDict();
159 forAll(fieldNames_, fieldI)
161 const word& fieldName = fieldNames_[fieldI];
164 if (conditionDict.
found(fieldName))
167 valueDict.
add(
"totalTime", totalTime_[fieldI],
true);
172 valueDict.
add(
"totalTime", totalTime_[fieldI],
true);
173 conditionDict.
add(fieldName, valueDict);
Base class for run time conditions.
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
virtual bool apply()
Apply the condition.
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)
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
averageCondition(const word &name, const objectRegistry &obr, const dictionary &dict, functionObjectState &state)
Constructor.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void write()
Write.
Registry of regIOobjects.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
virtual ~averageCondition()
Destructor.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Macros for easy insertion into run-time selection tables.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
word name(const complex &)
Return a string representation of a complex.
bool add(entry *, bool mergeEntry=false)
Add a new entry.