158#ifndef functionObjects_fieldAverage_H
159#define functionObjects_fieldAverage_H
168namespace functionObjects
172class fieldAverageItem;
180 public fvMeshFunctionObject
243 template<
class Type1,
class Type2>
247 template<
class Type1,
class Type2>
261 template<
class Type1,
class Type2>
265 template<
class Type1,
class Type2>
269 template<
class Type1,
class Type2>
340 virtual bool write();
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
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,...
const word & name() const noexcept
Return the name of this functionObject.
Helper class to describe what form of averaging to apply. A set will be applied to each base field in...
Computes ensemble- and/or time-based field averages, with optional windowing, for a user-specified se...
Switch periodicRestart_
Periodically restart the averaging process.
TypeName("fieldAverage")
Runtime type information.
label prevTimeIndex_
Time at last call, prevents repeated averaging.
void writeAveragingProperties()
Write averaging properties - steps and time.
void restart()
Restart averaging for restartOnOutput.
void initialize()
Reset lists (clear existing values) and initialize averaging.
Switch restartOnRestart_
Restart the averaging process on restart.
virtual ~fieldAverage()=default
Destructor.
Switch restartOnOutput_
Restart the averaging process on output.
label periodIndex_
Index for periodic restart.
void writeFields() const
Write fields.
virtual void calcAverages()
Main calculation routine.
void addMeanSqrToPrime2MeanType(const fieldAverageItem &item) const
Add mean-squared field value to prime-squared mean field.
void addMeanFieldType(fieldAverageItem &item)
Add mean average field to database.
scalar restartPeriod_
Restart period.
void addMeanField(fieldAverageItem &item)
Add mean average field to database.
scalar restartTime_
Specific restart time.
bool initialised_
Initialised flag.
void calculatePrime2MeanFields() const
Calculate prime-squared average fields.
List< scalar > totalTime_
Total time counter.
List< fieldAverageItem > faItems_
List of field average items, describing what averages to be.
List< label > totalIter_
Iteration steps counter.
void operator=(const fieldAverage &)=delete
No copy assignment.
fieldAverage(const fieldAverage &)=delete
No copy construct.
void addPrime2MeanFieldType(fieldAverageItem &item)
Add prime-squared average field to database.
void storeWindowFieldType(fieldAverageItem &item)
virtual void writeAverages() const
Write averages.
void readAveragingProperties()
Read averaging properties - steps and time.
void writeFieldType(const word &fieldName) const
Write fields.
virtual bool execute()
Calculate the field averages.
virtual bool write()
Write the field averages.
void calculateMeanFields() const
Calculate mean average fields.
void restoreWindowFields(const fieldAverageItem &item)
void addPrime2MeanField(fieldAverageItem &item)
Add prime-squared average field to database.
virtual bool read(const dictionary &)
Read the field average data.
void addMeanSqrToPrime2Mean() const
Add mean-squared field value to prime-squared mean field.
void restoreWindowFieldsType(const fieldAverageItem &item)
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
A class for handling words, derived from Foam::string.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.