158 #ifndef functionObjects_fieldAverage_H 159 #define functionObjects_fieldAverage_H 168 namespace functionObjects
172 class 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();
virtual bool read(const dictionary &)
Read the field average data.
void storeWindowFieldType(fieldAverageItem &item)
virtual ~fieldAverage()=default
Destructor.
void restoreWindowFieldsType(const fieldAverageItem &item)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
virtual bool write()
Write the field averages.
List< scalar > totalTime_
Total time counter.
Switch periodicRestart_
Periodically restart the averaging process.
scalar restartPeriod_
Restart period.
void operator=(const fieldAverage &)=delete
No copy assignment.
void addMeanField(fieldAverageItem &item)
Add mean average field to database.
virtual bool execute()
Calculate the field averages.
void calculatePrime2MeanFields() const
Calculate prime-squared average fields.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
label prevTimeIndex_
Time at last call, prevents repeated averaging.
const word & name() const noexcept
Return the name of this functionObject.
void writeFields() const
Write fields.
Switch restartOnOutput_
Restart the averaging process on output.
List< label > totalIter_
Iteration steps counter.
fieldAverage(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
void writeFieldType(const word &fieldName) const
Write fields.
void addMeanSqrToPrime2MeanType(const fieldAverageItem &item) const
Add mean-squared field value to prime-squared mean field.
void readAveragingProperties()
Read averaging properties - steps and time.
A class for handling words, derived from Foam::string.
Computes ensemble- and/or time-based field averages, with optional windowing, for a user-specified se...
List< fieldAverageItem > faItems_
List of field average items, describing what averages to be.
virtual void calcAverages()
Main calculation routine.
void writeAveragingProperties()
Write averaging properties - steps and time.
void calculateMeanFields() const
Calculate mean average fields.
void addPrime2MeanField(fieldAverageItem &item)
Add prime-squared average field to database.
void initialize()
Reset lists (clear existing values) and initialize averaging.
Switch restartOnRestart_
Restart the averaging process on restart.
label periodIndex_
Index for periodic restart.
Helper class to describe what form of averaging to apply. A set will be applied to each base field in...
void restart()
Restart averaging for restartOnOutput.
TypeName("fieldAverage")
Runtime type information.
void addMeanSqrToPrime2Mean() const
Add mean-squared field value to prime-squared mean field.
bool initialised_
Initialised flag.
void addPrime2MeanFieldType(fieldAverageItem &item)
Add prime-squared average field to database.
virtual void writeAverages() const
Write averages.
scalar restartTime_
Specific restart time.
void restoreWindowFields(const fieldAverageItem &item)
void addMeanFieldType(fieldAverageItem &item)
Add mean average field to database.