mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -68,12 +68,6 @@ void Foam::fieldAverage::initialize()
|
||||
resetFields(prime2MeanScalarFields_);
|
||||
resetFields(prime2MeanSymmTensorFields_);
|
||||
|
||||
totalIter_.clear();
|
||||
totalIter_.setSize(faItems_.size(), 1);
|
||||
|
||||
totalTime_.clear();
|
||||
totalTime_.setSize(faItems_.size(), obr_.time().deltaTValue());
|
||||
|
||||
|
||||
// Add mean fields to the field lists
|
||||
forAll(faItems_, fieldI)
|
||||
@ -150,11 +144,21 @@ void Foam::fieldAverage::initialize()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ensure first averaging works unconditionally
|
||||
prevTimeIndex_ = -1;
|
||||
|
||||
initialised_ = true;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fieldAverage::calcAverages()
|
||||
{
|
||||
if (!initialised_)
|
||||
{
|
||||
initialize();
|
||||
}
|
||||
|
||||
const label currentTimeIndex =
|
||||
static_cast<const fvMesh&>(obr_).time().timeIndex();
|
||||
|
||||
@ -248,6 +252,12 @@ void Foam::fieldAverage::writeAveragingProperties() const
|
||||
|
||||
void Foam::fieldAverage::readAveragingProperties()
|
||||
{
|
||||
totalIter_.clear();
|
||||
totalIter_.setSize(faItems_.size(), 1);
|
||||
|
||||
totalTime_.clear();
|
||||
totalTime_.setSize(faItems_.size(), obr_.time().deltaTValue());
|
||||
|
||||
if (resetOnRestart_)
|
||||
{
|
||||
Info<< "fieldAverage: starting averaging at time "
|
||||
@ -258,7 +268,7 @@ void Foam::fieldAverage::readAveragingProperties()
|
||||
IOobject propsDictHeader
|
||||
(
|
||||
"fieldAveragingProperties",
|
||||
obr_.time().timeName(),
|
||||
obr_.time().timeName(obr_.time().startTime().value()),
|
||||
"uniform",
|
||||
obr_,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
@ -290,6 +300,7 @@ void Foam::fieldAverage::readAveragingProperties()
|
||||
<< " time = " << totalTime_[fieldI] << endl;
|
||||
}
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
@ -358,6 +369,8 @@ void Foam::fieldAverage::read(const dictionary& dict)
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
initialised_ = false;
|
||||
|
||||
dict.readIfPresent("resetOnRestart", resetOnRestart_);
|
||||
dict.readIfPresent("resetOnOutput", resetOnOutput_);
|
||||
dict.lookup("fields") >> faItems_;
|
||||
@ -371,16 +384,6 @@ void Foam::fieldAverage::execute()
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
if (!initialised_)
|
||||
{
|
||||
initialize();
|
||||
|
||||
// ensure first averaging works unconditionally
|
||||
prevTimeIndex_ = -1;
|
||||
|
||||
initialised_ = true;
|
||||
}
|
||||
|
||||
calcAverages();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user