32 template<
class CloudType>
37 { resetMode::timeStep,
"timeStep" },
38 { resetMode::writeTime,
"writeTime" },
43 template<
class CloudType>
46 autoPtr<volScalarField>& fieldPtr,
47 const word& fieldName,
48 const dimensionSet& dims
53 fieldPtr->primitiveFieldRef() = 0.0;
57 const fvMesh&
mesh = this->owner().mesh();
65 this->owner().
name() +
":" + this->modelName() +
":" + fieldName,
66 mesh.time().timeName(),
68 IOobject::READ_IF_PRESENT,
79 template<
class CloudType>
82 clearOrReset(massPtr_,
"mass",
dimMass);
83 clearOrReset(countPtr_,
"count",
dimless);
87 template<
class CloudType>
110 if (resetMode_ == resetMode::writeTime)
119 template<
class CloudType>
124 const word& modelName
132 resetModeNames_.getOrDefault
144 template<
class CloudType>
153 resetMode_(pii.resetMode_)
159 template<
class CloudType>
162 const typename parcelType::trackingData&
165 if (resetMode_ == resetMode::timeStep)
172 template<
class CloudType>
180 const label patchi =
pp.index();
181 const label facei =
pp.whichFace(
p.face());
183 massPtr_->boundaryFieldRef()[patchi][facei] +=
p.nParticle()*
p.mass();
184 countPtr_->boundaryFieldRef()[patchi][facei] += 1;
bool none(const UList< bool > &bools)
True if no entries are 'true'.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const dimensionSet dimless
Dimensionless.
void clearOrReset(autoPtr< volScalarField > &fieldPtr, const word &fieldName, const dimensionSet &dims) const
Helper function to clear or reset fields.
static const Enum< resetMode > resetModeNames_
PatchInteractionFields(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual void postPatch(const parcelType &p, const polyPatch &pp, bool &keepParticle)
Post-patch hook.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Creates volume fields whose boundaries are used to store patch interaction statistics.
A class for handling words, derived from Foam::string.
errorManip< error > abort(error &err)
virtual void write()
Write post-processing info.
virtual void preEvolve(const typename parcelType::trackingData &td)
Pre-evolve hook.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
void reset()
Create|read|reset the fields.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Templated base class for dsmc cloud.
Templated cloud function object base class.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
static constexpr const zero Zero
Global zero (0)