ENH: Check if the Lagragian cloud is active before reading massTotal & SOI in InjectionModel.C

If the cloud was inactive, massTotal and SOI were needed even for steady Lagrangian
This commit is contained in:
sergio
2016-11-17 11:48:13 -08:00
parent 2d36cc97a7
commit c659d99368

View File

@ -318,16 +318,19 @@ Foam::InjectionModel<CloudType>::InjectionModel
Info<< " injector ID: " << injectorID_ << endl;
}
if (owner.solution().transient())
if (owner.solution().active())
{
this->coeffDict().lookup("massTotal") >> massTotal_;
this->coeffDict().lookup("SOI") >> SOI_;
}
else
{
massFlowRate_.reset(this->coeffDict());
massTotal_ = massFlowRate_.value(owner.db().time().value());
this->coeffDict().readIfPresent("SOI", SOI_);
if (owner.solution().transient())
{
this->coeffDict().lookup("massTotal") >> massTotal_;
this->coeffDict().lookup("SOI") >> SOI_;
}
else
{
massFlowRate_.reset(this->coeffDict());
massTotal_ = massFlowRate_.value(owner.db().time().value());
this->coeffDict().readIfPresent("SOI", SOI_);
}
}
SOI_ = owner.db().time().userTimeToTime(SOI_);