34template<
class CloudType>
39 QPtr_->primitiveFieldRef() = 0.0;
52 mesh.time().timeName(),
65template<
class CloudType>
68 const label globalPatchi
71 return patchIDs_.find(globalPatchi);
75template<
class CloudType>
85 <<
"QPtr not valid" << abort(FatalError);
92template<
class CloudType>
100 CloudFunctionObject<CloudType>(
dict, owner, modelName, typeName),
103 p_(this->coeffDict().getScalar(
"p")),
104 psi_(this->coeffDict().template getOrDefault<scalar>(
"psi", 2.0)),
105 K_(this->coeffDict().template getOrDefault<scalar>(
"K", 2.0))
110 this->
coeffDict().
template get<wordRes>(
"patches")
121 <<
"Cannot find any patch names matching "
135template<
class CloudType>
143 patchIDs_(pe.patchIDs_),
152template<
class CloudType>
155 const typename parcelType::trackingData&
td
162template<
class CloudType>
167 const typename parcelType::trackingData&
td
170 const label patchi =
pp.index();
172 const label localPatchi = applyToPatch(patchi);
174 if (localPatchi != -1)
180 this->owner().patchData(
p,
pp, nw, Up);
191 const scalar magU =
mag(
U);
195 const scalar
alpha = mathematical::piByTwo -
acos(nw & Udir);
197 const scalar coeff =
p.nParticle()*
p.mass()*
sqr(magU)/(p_*psi_*K_);
199 const label patchFacei =
pp.whichFace(
p.face());
200 scalar& Q = QPtr_->boundaryFieldRef()[patchi][patchFacei];
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Templated cloud function object base class.
CloudFunctionObject(CloudType &owner)
Construct null from owner.
const CloudType & owner() const
Return const access to the owner cloud.
const fvMesh & mesh() const
Return reference to the mesh.
particle::trackingData trackingData
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
@ READ_IF_PRESENT
Reading is optional [identical to LAZY_READ].
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Creates particle erosion field, Q.
label applyToPatch(const label globalPatchi) const
Returns local patchi if patch is in patchIds_ list.
virtual void write()
Write post-processing info.
virtual void preEvolve(const typename parcelType::trackingData &td)
Pre-evolve hook.
void resetQ()
Create|read|reset the Q field.
virtual bool postPatch(const parcelType &p, const polyPatch &pp, const typename parcelType::trackingData &td)
Post-patch hook.
ParticleErosion(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
bool empty() const noexcept
True if List is empty (ie, size() is zero).
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Volume discretisation.
wordList names() const
Return a list of patch names.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A patch is a list of labels that address the faces in the global face list.
const dictionary & coeffDict() const
Return const access to the coefficients dictionary.
const dictionary & dict() const
Return const access to the cloud dictionary.
const word & modelName() const
Return const access to the name of the sub-model.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
A List of wordRe with additional matching capabilities.
static labelList matching(const wordRe &select, const UList< StringType > &input, const bool invert=false)
Determine the list indices for all matches.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
#define WarningInFunction
Report a warning using Foam::Warning.
List< word > wordList
List of word.
DSMCCloud< dsmcParcel > CloudType
dimensionedScalar tan(const dimensionedScalar &ds)
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar sin(const dimensionedScalar &ds)
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
const dimensionSet dimVolume(pow3(dimLength))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar acos(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a).
wordList patchNames(nPatches)