Changed way to execute calculation every Nth step.

This commit is contained in:
Thomas Lichtenegger
2021-07-27 07:38:33 +02:00
parent 2a83785bcb
commit 215125fb2b
2 changed files with 5 additions and 1 deletions

View File

@ -47,6 +47,7 @@ reactionHeat::reactionHeat
propsDict_(dict.subDict(typeName + "Props")),
interpolation_(propsDict_.lookupOrDefault<bool>("interpolation",false)),
verbose_(propsDict_.lookupOrDefault<bool>("verbose",false)),
execution_(true),
mesh_(sm.mesh()),
maxSource_(1e30),
reactionHeatName_(propsDict_.lookupOrDefault<word>("reactionHeatName","reactionHeat")),
@ -94,7 +95,8 @@ reactionHeat::~reactionHeat()
void reactionHeat::calcEnergyContribution()
{
loopCounter_++;
if (loopCounter_ % Nevery_ != 0)
execution_ = (particleCloud_.dataExchangeM().couplingStep() % Nevery_ == 0);
if (!execution_)
{
return;
}

View File

@ -50,6 +50,8 @@ protected:
bool verbose_;
bool execution_;
const fvMesh& mesh_;
scalar maxSource_;