functionObject: Added executeAtStart
By default most functionObjects now execute and write at the start-time except those that perform averaging (fieldAverage, dsmcFields) which cannot be executed until the end of the first time-step. There is also a new optional functionObject dictionary entry "executeAtStart" which defaults to true but can be set false if the execution and results of the functionObject are not required or appropriate at the start-time. A result of this change is that time logs of forces, sampling etc. now include a values for time 0.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -151,7 +151,7 @@ void Foam::functionObjects::fieldAverage::calcAverages()
|
||||
periodIndex_++;
|
||||
}
|
||||
|
||||
Log << type() << " " << name() << " write:" << nl
|
||||
Log << type() << " " << name() << nl
|
||||
<< " Calculating averages" << nl;
|
||||
|
||||
addMeanSqrToPrime2Mean<scalar, scalar>();
|
||||
|
||||
@ -286,6 +286,12 @@ public:
|
||||
//- Read the field average data
|
||||
virtual bool read(const dictionary&);
|
||||
|
||||
//- Do not average at the start of the run
|
||||
virtual bool executeAtStart() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//- Calculate the field averages
|
||||
virtual bool execute();
|
||||
|
||||
|
||||
@ -89,6 +89,12 @@ public:
|
||||
//- Read the dsmcFields data
|
||||
virtual bool read(const dictionary&);
|
||||
|
||||
//- Do not evaluate the state at the start of the run
|
||||
virtual bool executeAtStart() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//- Do nothing
|
||||
virtual bool execute();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user