Go to the documentation of this file.
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>
104 template<
class CloudType>
111 template<
class CloudType>
114 if (!massEscapePtr_.valid())
124 this->owner().
name() +
":massEscape",
125 mesh.time().timeName(),
127 IOobject::READ_IF_PRESENT,
136 return massEscapePtr_();
140 template<
class CloudType>
143 if (!massStickPtr_.valid())
153 this->owner().
name() +
":massStick",
154 mesh.time().timeName(),
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;
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>
282 this->getModelProperty(
"nEscape", npe0);
285 this->getModelProperty(
"massEscape", mpe0);
288 this->getModelProperty(
"nStick", nps0);
291 this->getModelProperty(
"massStick", mps0);
313 os <<
" Parcel fate: patch " << patchData_[i].patchName()
314 <<
" (number, mass)" <<
nl
315 <<
" - escape = " << npe[i]
316 <<
", " << mpe[i] <<
nl
317 <<
" - stick = " << nps[i]
318 <<
", " << mps[i] <<
nl;
321 if (this->outputTime())
323 this->setModelProperty(
"nEscape", npe);
326 this->setModelProperty(
"massEscape", mpe);
329 this->setModelProperty(
"nStick", nps);
332 this->setModelProperty(
"massStick", mps);
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const patchInteractionDataList patchData_
List of participating patches.
A class for handling words, derived from string.
#define forAll(list, i)
Loop across all elements in list.
List< scalar > massStick_
Mass of parcels stuck to patches.
List< label > nEscape_
Number of parcels escaped.
Ostream & endl(Ostream &os)
Add newline and flush stream.
LocalInteraction(const dictionary &dict, CloudType &owner)
Construct from dictionary.
Switch writeFields_
Flag to output data as fields.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A patch is a list of labels that address the faces in the global face list.
Templated base class for dsmc cloud.
virtual ~LocalInteraction()
Destructor.
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.
Generic dimensioned Type class.
Mesh data needed to do the Finite Volume discretisation.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
errorManip< error > abort(error &err)
Patch interaction specified on a patch-by-patch basis.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
A cloud is a collection of lagrangian particles.
virtual bool correct(typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle, const scalar trackFraction, const tetIndices &tetIs)
Apply velocity correction.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label whichFace(const label l) const
Return label of face in patch from global face label.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
ParcelType parcelType
Type of parcel the cloud was instantiated for.
List< scalar > massEscape_
Mass of parcels escaped.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Generic GeometricField class.
volScalarField & massEscape()
Return access to the massEscape field.
label index() const
Return the index of this patch in the boundaryMesh.
volScalarField & massStick()
Return access to the massStick field.
word name(const complex &)
Return a string representation of a complex.
List< label > nStick_
Number of parcels stuck to patches.