36 public Tuple2<wordRe, dictionary>
75 template<
class CloudType>
83 patchInteractionTypes_
88 patchEs_(this->owner().
mesh().poly().
boundary().size(), NaN),
89 patchMus_(this->owner().
mesh().poly().
boundary().size(), NaN),
90 nEscape_(this->owner().
mesh().poly().
boundary().size(), 0),
91 massEscape_(this->owner().
mesh().poly().
boundary().size(), scalar(0)),
92 nStick_(this->owner().
mesh().poly().
boundary().size(), 0),
93 massStick_(this->owner().
mesh().poly().
boundary().size(), scalar(0)),
94 writeFields_(this->typeDict().lookupOrDefault(
"writeFields", false)),
95 massEscapePtr_(nullptr),
96 massStickPtr_(nullptr)
102 const word massEscapeName(this->
owner().
name() +
":massEscape");
103 const word massStickName(this->
owner().
name() +
":massStick");
105 Info<<
" Interaction fields will be written to " << massEscapeName
106 <<
" and " << massStickName <<
endl;
113 Info<<
" Interaction fields will not be written" <<
endl;
129 forAll(patchNameAndDicts, dicti)
134 patchNameAndDicts[dicti].
second()
140 wordList unspecifiedNonConstraintPatches;
145 const bool havePatchDict = patchesDict.
found(patchName);
150 if (!havePatchDict && patchIsConstraint)
152 patchInteractionTypes_[
patchi] =
158 if (!havePatchDict && !patchIsConstraint)
168 if (havePatchDict && patchIsConstraint)
170 if (!patchDict.
found(
"patchType"))
172 patchInteractionTypes_[
patchi] =
182 <<
"Type " << patchType
183 <<
" specified for patch " << patchName
184 <<
" does not match the patch type "
196 <<
"Unknown patch interaction type "
197 << itName <<
" for patch " << patchName
198 <<
". Valid types are:"
203 patchInteractionTypes_[
patchi] = it;
213 if (!unspecifiedNonConstraintPatches.
empty())
216 <<
"No interaction type was specified for non-constraint patches: "
217 << unspecifiedNonConstraintPatches
223 template<
class CloudType>
230 patchInteractionTypes_(pim.patchInteractionTypes_),
231 patchEs_(pim.patchEs_),
232 patchMus_(pim.patchMus_),
233 nEscape_(pim.nEscape_),
234 massEscape_(pim.massEscape_),
235 nStick_(pim.nStick_),
236 massStick_(pim.massStick_),
237 writeFields_(pim.writeFields_),
238 massEscapePtr_(nullptr),
239 massStickPtr_(nullptr)
245 template<
class CloudType>
252 template<
class CloudType>
255 if (!massEscapePtr_.valid())
265 this->owner().
name() +
":massEscape",
277 return massEscapePtr_();
281 template<
class CloudType>
284 if (!massStickPtr_.valid())
294 this->owner().
name() +
":massStick",
306 return massStickPtr_();
310 template<
class CloudType>
320 if (isA<processorPolyPatch>(pp))
325 switch (patchInteractionTypes_[
patchi])
334 const scalar dm =
p.mass()*
p.nParticle();
336 keepParticle =
false;
340 massEscape_[
patchi] += dm;
345 massEscape().boundaryFieldRef()[
patchi][patchFacei] += dm;
353 const scalar dm =
p.mass()*
p.nParticle();
364 massStick().boundaryFieldRef()[
patchi][patchFacei] += dm;
376 this->owner().patchData(
p, pp, nw, Up);
381 const scalar Un =
p.U() & nw;
382 const vector Ut =
p.U() - Un*nw;
386 p.U() -= (1 + patchEs_[
patchi])*Un*nw;
407 template<
class CloudType>
418 this->getModelProperty(
"nEscape", npe0);
421 this->getModelProperty(
"massEscape", mpe0);
424 this->getModelProperty(
"nStick", nps0);
427 this->getModelProperty(
"massStick", mps0);
450 patchInteractionTypes_[
patchi]
454 os <<
" Parcel fate (number, mass) : patch "
455 << this->owner().mesh().poly().boundary()[
patchi].
name() <<
nl
456 <<
" - escape = " << npe[
patchi]
458 <<
" - stick = " << nps[
patchi]
463 if (this->writeTime())
465 this->setModelProperty(
"nEscape", npe);
468 this->setModelProperty(
"massEscape", mpe);
469 massEscape_ = scalar(0);
471 this->setModelProperty(
"nStick", nps);
474 this->setModelProperty(
"massStick", mps);
475 massStick_ = scalar(0);
#define forAll(list, i)
Loop across all elements in list.
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
const fvMesh & mesh() const
Return references to the mesh.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual const fileName & name() const
Return the name of the stream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void append(const T &)
Append an element at the end of the list.
Patch interaction specified on a patch-by-patch basis.
virtual void info(Ostream &os)
Write patch interaction info to stream.
LocalInteraction(const dictionary &dict, CloudType &owner)
Construct from dictionary.
volScalarField & massStick()
Return access to the massStick field.
volScalarField & massEscape()
Return access to the massEscape field.
virtual ~LocalInteraction()
Destructor.
virtual bool correct(typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle)
Apply velocity correction.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Templated patch interaction model class.
static interactionType wordToInteractionType(const word &itWord)
Convert word to interaction result.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
Pre-declare related SubField type.
A List obtained as a section of another List.
A 2-tuple for storing two objects of different types.
const Type2 & second() const
Return second.
const Type1 & first() const
Return first.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
label size() const
Return the number of elements in the UPtrList.
Base class for clouds. Provides a basic evolution algorithm, models, and a database for caching deriv...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
T lookupOrDefault(const word &, const T &) const
Find and return a T, if not found return the given default.
void transfer(dictionary &)
Transfer the contents of the argument and annul the argument.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool isDict(const word &) const
Check if entry is a sub-dictionary.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
const word & name() const
Return const reference to name.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
const polyMesh & poly() const
Return reference to polyMesh.
A class for handling keywords in dictionaries.
label index() const
Return the index of this patch in the boundaryMesh.
const polyBoundaryMesh & boundary() const
Return boundary mesh.
A patch is a list of labels that address the faces in the global face list.
label whichFace(const label l) const
Return label of face in patch from global face label.
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
const dictionary & typeDict() const
Return const access to the coefficients dictionary.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A wordRe is a word, but can also have a regular expression for matching words.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const fvPatchList & patches
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Istream & operator>>(Istream &, pointEdgeDist &)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionSet & dimMass
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList second(const UList< labelPair > &p)
labelList first(const UList< labelPair > &p)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
faceListList boundary(nPatches)