30 template<
class CloudType>
38 patchData_(cloud.mesh(), this->coeffDict()),
39 nEscape_(patchData_.size(), 0),
40 massEscape_(patchData_.size(), 0.0),
41 nStick_(patchData_.size(), 0),
42 massStick_(patchData_.size(), 0.0),
43 writeFields_(this->coeffDict().lookupOrDefault(
"writeFields",
false)),
49 word massEscapeName(this->owner().
name() +
":massEscape");
50 word massStickName(this->owner().
name() +
":massStick");
51 Info<<
" Interaction fields will be written to " << massEscapeName
52 <<
" and " << massStickName <<
endl;
59 Info<<
" Interaction fields will not be written" <<
endl;
65 const word& interactionTypeName =
66 patchData_[
patchi].interactionTypeName();
68 this->wordToInteractionType(interactionTypeName);
72 const word& patchName = patchData_[
patchi].patchName();
74 <<
"Unknown patch interaction type " 75 << interactionTypeName <<
" for patch " << patchName
76 <<
". Valid selections are:" 84 template<
class CloudType>
91 patchData_(pim.patchData_),
92 nEscape_(pim.nEscape_),
93 massEscape_(pim.massEscape_),
95 massStick_(pim.massStick_),
96 writeFields_(pim.writeFields_),
104 template<
class CloudType>
111 template<
class CloudType>
114 if (!massEscapePtr_.valid())
124 this->owner().
name() +
":massEscape",
127 IOobject::READ_IF_PRESENT,
136 return massEscapePtr_();
140 template<
class CloudType>
143 if (!massStickPtr_.valid())
153 this->owner().
name() +
":massStick",
156 IOobject::READ_IF_PRESENT,
165 return massStickPtr_();
169 template<
class CloudType>
175 const scalar trackFraction,
184 bool& active = p.active();
187 this->wordToInteractionType
189 patchData_[patchi].interactionTypeName()
196 scalar dm = p.mass()*p.nParticle();
198 keepParticle =
false;
202 massEscape_[
patchi] += dm;
207 massEscape().boundaryFieldRef()[pI][fI] += dm;
213 scalar dm = p.mass()*p.nParticle();
224 massStick().boundaryFieldRef()[pI][fI] += dm;
236 this->owner().patchData(p, pp, trackFraction, tetIs, nw, Up);
246 U -= (1.0 + patchData_[
patchi].e())*Un*nw;
249 U -= patchData_[
patchi].mu()*Ut;
259 <<
"Unknown interaction type " 260 << patchData_[
patchi].interactionTypeName()
261 <<
"(" << it <<
") for patch " 262 << patchData_[
patchi].patchName()
263 <<
". Valid selections are:" << this->interactionTypeNames_
275 template<
class CloudType>
280 this->getModelProperty(
"nEscape", npe0);
283 this->getModelProperty(
"massEscape", mpe0);
286 this->getModelProperty(
"nStick", nps0);
289 this->getModelProperty(
"massStick", mps0);
311 os <<
" Parcel fate (number, mass) : patch " 312 << patchData_[i].patchName() <<
nl 313 <<
" - escape = " << npe[i]
314 <<
", " << mpe[i] <<
nl 315 <<
" - stick = " << nps[i]
316 <<
", " << mps[i] <<
nl;
319 if (this->writeTime())
321 this->setModelProperty(
"nEscape", npe);
324 this->setModelProperty(
"massEscape", mpe);
327 this->setModelProperty(
"nStick", nps);
330 this->setModelProperty(
"massStick", mps);
Patch interaction specified on a patch-by-patch basis.
volScalarField & massEscape()
Return access to the massEscape field.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
label whichFace(const label l) const
Return label of face in patch from global face label.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual void info(Ostream &os)
Write patch interaction info to stream.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual ~LocalInteraction()
Destructor.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Templated patch interaction model class.
A class for handling words, derived from string.
virtual bool correct(typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle, const scalar trackFraction, const tetIndices &tetIs)
Apply velocity correction.
LocalInteraction(const dictionary &dict, CloudType &owner)
Construct from dictionary.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
errorManip< error > abort(error &err)
ParcelType parcelType
Type of parcel the cloud was instantiated for.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
volScalarField & massStick()
Return access to the massStick field.
word name(const complex &)
Return a string representation of a complex.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
A patch is a list of labels that address the faces in the global face list.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Templated base class for dsmc cloud.
label index() const
Return the index of this patch in the boundaryMesh.
const Time & time() const
Return the top-level database.