64 if (volumetricFlowRate_.valid() == massFlowRate_.valid())
67 <<
"keywords volumetricFlowRate and massFlowRate both "
68 << (volumetricFlowRate_.valid() ?
"" :
"un") <<
"defined in "
69 <<
"dictionary " <<
dict.name()
83 volumetricFlowRate_(field.volumetricFlowRate_, false),
84 massFlowRate_(field.massFlowRate_, false)
104 const scalar t1 =
time().value();
105 const scalar t0 = t1 -
time().deltaTValue();
107 if (volumetricFlowRate_.valid())
114 volumetricFlowRate_->integral(t0, t1)
134 massFlowRate_->integral(t0, t1)
135 )*
sum(v/size())/
sum(m/size());
148 const scalar t1 =
time().value();
149 const scalar t0 = t1 -
time().deltaTValue();
157 volumetricFlowRate_.
valid(), v,
158 massFlowRate_.
valid(), m
163 if (volumetricFlowRate_.valid())
168 volumetricFlowRate_->integral(t0, t1)
171 return V/size()/
sum(v()/size());
178 massFlowRate_->integral(t0, t1)
181 return M/size()/
sum(m()/size());
190 if (volumetricFlowRate_.valid())
207 LagrangianScalarFieldSource,
Macros for easy insertion into run-time selection tables.
Run-time selectable general function of one variable.
Base class for Lagrangian injections. Minimal wrapper over LagrangianSource. Implements some utility ...
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
This source condition sets the values of the number field to recover a specified volumetric or mass f...
virtual void write(Ostream &) const
Write.
virtual tmp< LagrangianSubScalarField > value(const LagrangianInjection &, const LagrangianSubMesh &) const
Return the value for an instantaneous injection.
dimensionedScalar Q(const LagrangianInjection &, const LagrangianSubMesh &) const
Return the volumetric flow rate for this time-step.
flowRateNumberLagrangianScalarFieldSource(const regIOobject &, const dictionary &dict)
Construct from internal field and dictionary.
virtual ~flowRateNumberLagrangianScalarFieldSource()
Destructor.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
A class for managing temporary objects.
bool valid() const
Is this temporary object valid,.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const dimensionSet & dimMass
const dimensionSet & dimMassFlux
const dimensionSet & dimVolume
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
makeLagrangianTypeFieldSource(LagrangianVectorFieldSource, coneDiskVelocityLagrangianVectorFieldSource)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet & dimVolumetricFlux