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();
73 FatalErrorIn(
"LocalInteraction(const dictionary&, CloudType&)")
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,
179 label patchI = patchData_.applyToPatch(pp.
index());
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().boundaryField()[pI][fI] += dm;
213 scalar dm = p.mass()*p.nParticle();
219 massStick_[patchI] += dm;
224 massStick().boundaryField()[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;
260 "bool LocalInteraction<CloudType>::correct" 262 "typename CloudType::parcelType&, " 268 ) <<
"Unknown interaction type " 269 << patchData_[patchI].interactionTypeName()
270 <<
"(" << it <<
") for patch " 271 << patchData_[patchI].patchName()
272 <<
". Valid selections are:" << this->interactionTypeNames_
284 template<
class CloudType>
289 this->getModelProperty(
"nEscape", npe0);
292 this->getModelProperty(
"massEscape", mpe0);
295 this->getModelProperty(
"nStick", nps0);
298 this->getModelProperty(
"massStick", mps0);
320 os <<
" Parcel fate (number, mass) : patch " 321 << patchData_[i].patchName() <<
nl 322 <<
" - escape = " << npe[i]
323 <<
", " << mpe[i] <<
nl 324 <<
" - stick = " << nps[i]
325 <<
", " << mps[i] <<
nl;
328 if (this->outputTime())
330 this->setModelProperty(
"nEscape", npe);
333 this->setModelProperty(
"massEscape", mpe);
336 this->setModelProperty(
"nStick", nps);
339 this->setModelProperty(
"massStick", mps);
virtual void info(Ostream &os)
Write patch interaction info to stream.
Mesh data needed to do the Finite Volume discretisation.
word name(const complex &)
Return a string representation of a complex.
label index() const
Return the index of this patch in the boundaryMesh.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
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...
ParcelType parcelType
Type of parcel the cloud was instantiated for.
A patch is a list of labels that address the faces in the global face list.
const Time & time() const
Return the top-level database.
Templated patch interaction model class.
virtual bool correct(typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle, const scalar trackFraction, const tetIndices &tetIs)
Apply velocity correction.
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
errorManip< error > abort(error &err)
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
volScalarField & massStick()
Return access to the massStick field.
Patch interaction specified on a patch-by-patch basis.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
LocalInteraction(const dictionary &dict, CloudType &owner)
Construct from dictionary.
virtual ~LocalInteraction()
Destructor.
Templated base class for dsmc cloud.
volScalarField & massEscape()
Return access to the massEscape field.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label whichFace(const label l) const
Return label of face in patch from global face label.