32 template<
class CloudType>
35 template<
class CloudType>
42 template<
class CloudType>
48 typename CloudType::parcelType& p = iter();
52 p.torque() = vector::zero;
57 template<
class CloudType>
60 PstreamBuffers pBufs(Pstream::nonBlocking);
62 label startOfRequests = Pstream::nRequests();
66 realRealInteraction();
68 il_.receiveReferredData(pBufs, startOfRequests);
70 realReferredInteraction();
74 template<
class CloudType>
80 typename CloudType::parcelType* pA_ptr = NULL;
81 typename CloudType::parcelType* pB_ptr = NULL;
83 List<DynamicList<typename CloudType::parcelType*> >& cellOccupancy =
84 this->owner().cellOccupancy();
89 forAll(cellOccupancy[realCellI], a)
91 pA_ptr = cellOccupancy[realCellI][a];
93 forAll(dil[realCellI], interactingCells)
95 List<typename CloudType::parcelType*> cellBParcels =
96 cellOccupancy[dil[realCellI][interactingCells]];
101 pB_ptr = cellBParcels[
b];
103 evaluatePair(*pA_ptr, *pB_ptr);
108 forAll(cellOccupancy[realCellI], aO)
110 pB_ptr = cellOccupancy[realCellI][aO];
116 evaluatePair(*pA_ptr, *pB_ptr);
124 template<
class CloudType>
130 List<IDLList<typename CloudType::parcelType> >& referredParticles =
131 il_.referredParticles();
133 List<DynamicList<typename CloudType::parcelType*> >& cellOccupancy =
134 this->owner().cellOccupancy();
139 IDLList<typename CloudType::parcelType>& refCellRefParticles =
140 referredParticles[refCellI];
142 const labelList& realCells = ril[refCellI];
148 typename IDLList<typename CloudType::parcelType>,
156 forAll(realCells, realCellI)
158 List<typename CloudType::parcelType*> realCellParcels =
159 cellOccupancy[realCells[realCellI]];
161 forAll(realCellParcels, realParcelI)
165 *realCellParcels[realParcelI],
175 template<
class CloudType>
178 const polyMesh& mesh = this->owner().mesh();
184 const labelList& patchID = mesh.boundaryMesh().patchID();
188 List<DynamicList<typename CloudType::parcelType*> >& cellOccupancy =
189 this->owner().cellOccupancy();
192 DynamicList<point> flatSitePoints;
193 DynamicList<scalar> flatSiteExclusionDistancesSqr;
194 DynamicList<WallSiteData<vector> > flatSiteData;
195 DynamicList<point> otherSitePoints;
196 DynamicList<scalar> otherSiteDistances;
197 DynamicList<WallSiteData<vector> > otherSiteData;
198 DynamicList<point> sharpSitePoints;
199 DynamicList<scalar> sharpSiteExclusionDistancesSqr;
200 DynamicList<WallSiteData<vector> > sharpSiteData;
205 const labelList& realWallFaces = directWallFaces[realCellI];
208 forAll(cellOccupancy[realCellI], cellParticleI)
210 flatSitePoints.clear();
211 flatSiteExclusionDistancesSqr.clear();
212 flatSiteData.clear();
213 otherSitePoints.clear();
214 otherSiteDistances.clear();
215 otherSiteData.clear();
216 sharpSitePoints.clear();
217 sharpSiteExclusionDistancesSqr.clear();
218 sharpSiteData.clear();
220 typename CloudType::parcelType& p =
221 *cellOccupancy[realCellI][cellParticleI];
223 const point& pos = p.position();
225 scalar r = wallModel_->pREff(p);
229 forAll(realWallFaces, realWallFaceI)
231 label realFaceI = realWallFaces[realWallFaceI];
233 pointHit nearest = mesh.faces()[realFaceI].nearestPoint
239 if (nearest.distance() < r)
241 vector normal = mesh.faceAreas()[realFaceI];
243 normal /=
mag(normal);
245 const vector& nearPt = nearest.rawPoint();
249 scalar normalAlignment = normal & pW/(
mag(pW) + SMALL);
252 label patchI = patchID[realFaceI - mesh.nInternalFaces()];
255 realFaceI - mesh.boundaryMesh()[patchI].start();
257 WallSiteData<vector> wSD
260 U.boundaryField()[patchI][patchFaceI]
263 bool particleHit =
false;
264 if (normalAlignment > cosPhiMinFlatWall)
272 !duplicatePointInList
276 sqr(r*flatWallDuplicateExclusion)
280 flatSitePoints.append(nearPt);
282 flatSiteExclusionDistancesSqr.append
284 sqr(r) -
sqr(nearest.distance())
287 flatSiteData.append(wSD);
294 otherSitePoints.append(nearPt);
296 otherSiteDistances.append(nearest.distance());
298 otherSiteData.append(wSD);
306 this->owner().functions().postFace(p, realFaceI, keep);
307 this->owner().functions().postPatch
310 mesh.boundaryMesh()[patchI],
312 p.currentTetIndices(),
322 const labelList& cellRefWallFaces = il_.rwfilInverse()[realCellI];
324 forAll(cellRefWallFaces, rWFI)
326 label refWallFaceI = cellRefWallFaces[rWFI];
328 const referredWallFace& rwf =
329 il_.referredWallFaces()[refWallFaceI];
333 pointHit nearest = rwf.nearestPoint(pos, pts);
335 if (nearest.distance() < r)
337 vector normal = rwf.normal(pts);
339 normal /=
mag(normal);
341 const vector& nearPt = nearest.rawPoint();
345 scalar normalAlignment = normal & pW/
mag(pW);
349 WallSiteData<vector> wSD
352 il_.referredWallData()[refWallFaceI]
355 bool particleHit =
false;
356 if (normalAlignment > cosPhiMinFlatWall)
364 !duplicatePointInList
368 sqr(r*flatWallDuplicateExclusion)
372 flatSitePoints.append(nearPt);
374 flatSiteExclusionDistancesSqr.append
376 sqr(r) -
sqr(nearest.distance())
379 flatSiteData.append(wSD);
386 otherSitePoints.append(nearPt);
388 otherSiteDistances.append(nearest.distance());
390 otherSiteData.append(wSD);
414 sortedOrder(otherSiteDistances, sortedOtherSiteIndices);
416 forAll(sortedOtherSiteIndices, siteI)
418 label orderedIndex = sortedOtherSiteIndices[siteI];
420 const point& otherPt = otherSitePoints[orderedIndex];
424 !duplicatePointInList
428 flatSiteExclusionDistancesSqr
437 !duplicatePointInList
441 sharpSiteExclusionDistancesSqr
445 sharpSitePoints.append(otherPt);
447 sharpSiteExclusionDistancesSqr.append
449 sqr(r) -
sqr(otherSiteDistances[orderedIndex])
452 sharpSiteData.append(otherSiteData[orderedIndex]);
470 template<
class CloudType>
473 const DynamicList<point>& existingPoints,
474 const point& pointToTest,
475 scalar duplicateRangeSqr
480 if (
magSqr(existingPoints[i] - pointToTest) < duplicateRangeSqr)
490 template<
class CloudType>
493 const DynamicList<point>& existingPoints,
494 const point& pointToTest,
500 if (
magSqr(existingPoints[i] - pointToTest) < duplicateRangeSqr[i])
510 template<
class CloudType>
517 typename CloudType::parcelType& p = iter();
519 p.collisionRecords().update();
524 template<
class CloudType>
527 typename CloudType::parcelType& pA,
528 typename CloudType::parcelType& pB
531 pairModel_->evaluatePair(pA, pB);
535 template<
class CloudType>
538 typename CloudType::parcelType& p,
539 const List<point>& flatSitePoints,
540 const List<WallSiteData<vector> >& flatSiteData,
541 const List<point>& sharpSitePoints,
542 const List<WallSiteData<vector> >& sharpSiteData
545 wallModel_->evaluateWall
558 template<
class CloudType>
588 this->coeffDict().lookupOrDefault
590 "writeReferredParticleCloud",
594 this->coeffDict().lookupOrDefault(
"UName",
word(
"U"))
599 template<
class CloudType>
608 il_(cm.
owner().mesh())
617 template<
class CloudType>
624 template<
class CloudType>
627 label nSubCycles = 1;
629 if (pairModel_->controlsTimestep())
636 nSubCycles =
max(nSubCycles, nPairSubCycles);
639 if (wallModel_->controlsTimestep())
646 nSubCycles =
max(nSubCycles, nWallSubCycles);
653 template<
class CloudType>
660 template<
class CloudType>
dimensionedScalar sqrt(const dimensionedScalar &ds)
Templated wall interaction class.
const CloudType & owner() const
Return const access to the owner cloud.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
vector point
Point is a vector.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
dimensioned< scalar > mag(const dimensioned< Type > &)
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
#define forAllIter(Container, container, iter)
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.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none.
DSMCCloud< dsmcParcel > CloudType
PairCollision(const dictionary &dict, CloudType &owner)
Construct from components.
A list of keyword definitions, which are a keyword followed by any number of values (e...
vectorField pointField
pointField is a vectorField.
PointHit< point > pointHit
virtual bool controlsWallInteraction() const
Indicates whether model determines wall collisions or not,.
stressControl lookup("compactNormalStress") >> compactNormalStress
Templated collision model class.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
virtual label nSubCycles() const
Return the number of times to subcycle the current.
virtual ~PairCollision()
Destructor.
List< scalar > scalarList
A List of scalars.
GeometricField< vector, fvPatchField, volMesh > volVectorField
const List< DynamicList< molecule * > > & cellOccupancy
List< label > labelList
A List of labels.
Vector< scalar > vector
A scalar version of the templated Vector.
Templated pair interaction class.
Templated base class for dsmc cloud.
dimensionedScalar pos(const dimensionedScalar &ds)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
List< labelList > labelListList
A List of labelList.