107 #ifndef functionObjects_fieldAverage_H 108 #define functionObjects_fieldAverage_H 116 namespace functionObjects
120 class fieldAverageItem;
128 public fvMeshFunctionObject
221 template<
class Type1,
class Type2>
225 template<
class Type1,
class Type2>
243 template<
class Type1,
class Type2>
247 template<
class Type1,
class Type2>
251 template<
class Type1,
class Type2>
255 template<
class Type1,
class Type2>
313 return baseTypeNames_[
base_];
355 virtual bool write();
void writeAveragingProperties() const
Write averaging properties - steps and time.
void addPrime2MeanFieldType(const label fieldi)
Add prime-squared average field to database.
void addMeanField(const label fieldi)
Add mean average field to database.
void initialise()
Reset lists (clear existing values) and initialise averaging.
void addMeanSqrToPrime2MeanType(const label fieldi) const
Add mean-squared field value to prime-squared mean field.
Switch timeBase() const
Return true if base is time.
virtual bool read(const dictionary &)
Read the field average data.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Switch mean_
Compute mean flag.
virtual bool write()
Write the field averages.
PtrList< fieldAverageItem > faItems_
List of field average items, describing what averages to be.
Switch prime2Mean_
Compute prime-squared mean flag.
List< scalar > totalTime_
Total time counter.
static const NamedEnum< baseType, 2 > baseTypeNames_
Averaging base type names.
Switch periodicRestart_
Periodically restart the averaging process.
scalar restartPeriod_
Restart period.
virtual bool executeAtStart() const
Do not average at the start of the run.
baseType base_
Averaging base type.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
void calculatePrime2MeanFieldType(const label fieldi) const
Calculate prime-squared average fields.
void addMeanFieldType(const label fieldi)
Add mean average field to database.
void operator=(const fieldAverage &)=delete
Disallow default bitwise assignment.
virtual bool execute()
Calculate the field averages.
void calculateMeanFieldType(const label fieldi) const
Calculate mean average fields.
void calculatePrime2MeanFields() const
Calculate prime-squared average fields.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
scalar window_
Averaging window - defaults to -1 for 'all iters/time'.
label prevTimeIndex_
Time at last call, prevents repeated averaging.
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.
const word base() const
Return averaging base type name.
void writeFieldType(const word &fieldName) const
Write fields.
void readAveragingProperties()
Read averaging properties - steps and time.
A class for handling words, derived from string.
Calculates average quantities for a user-specified selection of volumetric and surface fields...
virtual void calcAverages()
Main calculation routine.
word windowName_
Averaging window name - defaults to 'window'.
void calculateMeanFields() const
Calculate mean average fields.
const word & windowName() const
virtual wordList fields() const
Return the list of fields required.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Switch restartOnRestart_
Restart the averaging process on restart.
void addPrime2MeanField(const label fieldi)
Add prime-squared average field to database.
void resetFields()
Checkout fields (causes deletion) from the database.
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.
Switch iterBase() const
Return true if base is iter.
TypeName("fieldAverage")
Runtime type information.
void addMeanSqrToPrime2Mean() const
Add mean-squared field value to prime-squared mean field.
virtual ~fieldAverage()
Destructor.
bool initialised_
Initialised flag.
virtual void writeAverages() const
Write averages.
baseType
Enumeration defining the averaging base type.