ENH: converted mass flow rate to DataEntry for steady cloud operation

This commit is contained in:
andy 2012-08-01 16:52:25 +01:00
parent e6f521bec0
commit e915b5cee3
2 changed files with 11 additions and 1 deletions

View File

@ -284,6 +284,7 @@ Foam::InjectionModel<CloudType>::InjectionModel(CloudType& owner)
SOI_(0.0),
volumeTotal_(0.0),
massTotal_(0.0),
massFlowRate_(owner.db().time(), "massFlowRate"),
massInjected_(this->template getModelProperty<scalar>("massInjected")),
nInjections_(this->template getModelProperty<label>("nInjections")),
parcelsAddedTotal_
@ -310,6 +311,7 @@ Foam::InjectionModel<CloudType>::InjectionModel
SOI_(0.0),
volumeTotal_(0.0),
massTotal_(0.0),
massFlowRate_(owner.db().time(), "massFlowRate"),
massInjected_(this->template getModelProperty<scalar>("massInjected")),
nInjections_(this->template getModelProperty<scalar>("nInjections")),
parcelsAddedTotal_
@ -335,7 +337,8 @@ Foam::InjectionModel<CloudType>::InjectionModel
}
else
{
this->coeffDict().lookup("massFlowRate") >> massTotal_;
massFlowRate_.reset(this->coeffDict());
massTotal_ = massFlowRate_.value(owner.db().time().value());
}
const word parcelBasisType = this->coeffDict().lookup("parcelBasisType");
@ -384,6 +387,7 @@ Foam::InjectionModel<CloudType>::InjectionModel
SOI_(im.SOI_),
volumeTotal_(im.volumeTotal_),
massTotal_(im.massTotal_),
massFlowRate_(im.massFlowRate_),
massInjected_(im.massInjected_),
nInjections_(im.nInjections_),
parcelsAddedTotal_(im.parcelsAddedTotal_),
@ -594,6 +598,8 @@ void Foam::InjectionModel<CloudType>::injectSteadyState
const polyMesh& mesh = this->owner().mesh();
typename TrackData::cloudType& cloud = td.cloud();
massTotal_ = massFlowRate_.value(mesh.time().value());
// Reset counters
time0_ = 0.0;
label parcelsAdded = 0;

View File

@ -53,6 +53,7 @@ SourceFiles
#include "runTimeSelectionTables.H"
#include "SubModelBase.H"
#include "vector.H"
#include "TimeDataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -102,6 +103,9 @@ protected:
//- Total mass to inject [kg]
scalar massTotal_;
//- Mass flow rate profile for steady calculations
TimeDataEntry<scalar> massFlowRate_;
//- Total mass injected to date [kg]
scalar massInjected_;