LocalInteraction.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2015-2025 OpenCFD Ltd.
10  Copyright (C) 2026 Keysight Technologies
11 -------------------------------------------------------------------------------
12 License
13  This file is part of OpenFOAM.
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 \*---------------------------------------------------------------------------*/
29 
30 #include "LocalInteraction.H"
31 #include "BaiGosman.C"
32 #include "fvMesh.H"
33 #include "volFields.H"
34 
35 // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
36 
37 template<class CloudType>
39 {
41 
42  forAll(nEscape_, patchi)
43  {
44  const word& patchName = patchData_[patchi].patchName();
45 
46  forAll(nEscape_[patchi], injectori)
47  {
48  const word suffix = Foam::name(injectori);
49  this->writeTabbed(os, patchName + "_nEscape_" + suffix);
50  this->writeTabbed(os, patchName + "_massEscape_" + suffix);
51  this->writeTabbed(os, patchName + "_nStick_" + suffix);
52  this->writeTabbed(os, patchName + "_massStick_" + suffix);
53 
54  if (hasBaiGosman_)
55  {
56  this->writeTabbed(os, patchName + "_nRebound_" + suffix);
57  this->writeTabbed(os, patchName + "_massRebound_" + suffix);
58  this->writeTabbed(os, patchName + "_nSplash_" + suffix);
59  this->writeTabbed(os, patchName + "_massSplash_" + suffix);
60  }
61  }
62  }
63 }
64 
65 
66 template<class CloudType>
68 (
69  const dictionary& dict,
70  CloudType& cloud
71 )
72 :
73  PatchInteractionModel<CloudType>(dict, cloud, typeName),
74  patchData_(cloud.mesh(), this->coeffDict()),
75  nEscape_(patchData_.size()),
76  massEscape_(nEscape_.size()),
77  nStick_(nEscape_.size()),
78  massStick_(nEscape_.size()),
79  nRebound_(nEscape_.size()),
80  massRebound_(nEscape_.size()),
81  nSplash_(nEscape_.size()),
82  massSplash_(nEscape_.size()),
83  writeFields_(this->coeffDict().getOrDefault("writeFields", false)),
84  hasBaiGosman_(false),
85  beiGosman_(*this),
86  injIdToIndex_(),
87  massEscapePtr_(nullptr),
88  massStickPtr_(nullptr)
89 {
90  const bool outputByInjectorId
91  = this->coeffDict().getOrDefault("outputByInjectorId", false);
92 
93  if (writeFields_)
94  {
95  Info<< " Interaction fields will be written to "
96  << IOobject::scopedName(this->owner().name(), "massEscape")
97  << " and "
98  << IOobject::scopedName(this->owner().name(), "massStick") << endl;
99 
100  (void)massEscape();
101  (void)massStick();
102  }
103  else
104  {
105  Info<< " Interaction fields will not be written" << endl;
106  }
107 
108  // Determine the number of injectors and the injector mapping
109  label nInjectors = 0;
110  if (outputByInjectorId)
111  {
112  for (const auto& inj : cloud.injectors())
113  {
114  injIdToIndex_.insert(inj.injectorID(), nInjectors++);
115  }
116  }
117 
118  // The normal case, and safety if injector mapping was somehow null.
119  if (!nInjectors)
120  {
121  nInjectors = 1;
122  }
123 
124  hasBaiGosman_ = hasBaiGosmanPatch();
125 
126  if (hasBaiGosman_)
127  {
128  beiGosman_.initialise
129  (
130  localInteractionModels::parcelHasThermo
131  <
132  typename CloudType::parcelType
133  >()
134  );
135  }
136 
137  // Check that interactions are valid/specified
138  forAll(patchData_, patchi)
139  {
140  const word& interactionTypeName =
141  patchData_[patchi].interactionTypeName();
142 
143  if (!patchData_[patchi].isBaiGosman())
144  {
146  this->wordToInteractionType(interactionTypeName);
147 
149  {
150  const word& patchName = patchData_[patchi].patchName();
152  << "Unknown patch interaction type "
153  << interactionTypeName << " for patch " << patchName
154  << ". Valid selections are:"
157  << nl << exit(FatalError);
158  }
159  }
160 
161  nEscape_[patchi].setSize(nInjectors, Zero);
162  massEscape_[patchi].setSize(nInjectors, Zero);
163  nStick_[patchi].setSize(nInjectors, Zero);
164  massStick_[patchi].setSize(nInjectors, Zero);
165 
166  if (hasBaiGosman_)
167  {
168  nRebound_[patchi].setSize(nInjectors, Zero);
169  massRebound_[patchi].setSize(nInjectors, Zero);
170  nSplash_[patchi].setSize(nInjectors, Zero);
171  massSplash_[patchi].setSize(nInjectors, Zero);
172  }
173  }
174 }
175 
176 
177 template<class CloudType>
179 (
180  const LocalInteraction<CloudType>& pim
181 )
182 :
184  patchData_(pim.patchData_),
185  nEscape_(pim.nEscape_),
186  massEscape_(pim.massEscape_),
187  nStick_(pim.nStick_),
188  massStick_(pim.massStick_),
189  nRebound_(pim.nRebound_),
190  massRebound_(pim.massRebound_),
191  nSplash_(pim.nSplash_),
192  massSplash_(pim.massSplash_),
193  writeFields_(pim.writeFields_),
194  hasBaiGosman_(pim.hasBaiGosman_),
195  beiGosman_(pim.beiGosman_, *this),
196  injIdToIndex_(pim.injIdToIndex_),
197  massEscapePtr_(nullptr),
198  massStickPtr_(nullptr)
199 {}
200 
201 
202 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
203 
204 template<class CloudType>
206 {
207  forAll(patchData_, patchi)
208  {
209  if (patchData_[patchi].isBaiGosman())
210  {
211  return true;
212  }
213  }
214 
215  return false;
216 }
217 
218 
219 template<class CloudType>
221 (
222  const label patchi,
223  const label idx,
224  const scalar mass,
225  const polyPatch& pp,
226  const label facei
227 )
228 {
229  nEscape_[patchi][idx]++;
230  massEscape_[patchi][idx] += mass;
231  this->addToEscapedParcels(mass);
232 
233  if (writeFields_ && facei >= 0)
234  {
235  massEscape().boundaryFieldRef()[pp.index()][facei] += mass;
236  }
237 }
238 
239 
240 template<class CloudType>
242 (
243  const label patchi,
244  const label idx,
245  const scalar mass,
246  const polyPatch& pp,
247  const label facei,
248  const bool incrementCount
249 )
250 {
251  if (incrementCount)
252  {
253  nStick_[patchi][idx]++;
254  }
255 
256  massStick_[patchi][idx] += mass;
257 
258  if (writeFields_ && facei >= 0)
259  {
260  massStick().boundaryFieldRef()[pp.index()][facei] += mass;
261  }
262 }
263 
264 
265 template<class CloudType>
267 (
268  const label patchi,
269  const label idx,
270  const scalar mass
271 )
272 {
273  nRebound_[patchi][idx]++;
274  massRebound_[patchi][idx] += mass;
275 }
276 
277 
278 template<class CloudType>
280 (
281  const label patchi,
282  const label idx,
283  const scalar mass
284 )
285 {
286  nSplash_[patchi][idx]++;
287  massSplash_[patchi][idx] += mass;
288 }
289 
290 
291 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
292 
293 template<class CloudType>
295 {
296  if (!massEscapePtr_)
297  {
298  const fvMesh& mesh = this->owner().mesh();
299 
300  massEscapePtr_.reset
301  (
302  new volScalarField
303  (
304  IOobject
305  (
306  IOobject::scopedName(this->owner().name(), "massEscape"),
307  mesh.time().timeName(),
308  mesh.thisDb(),
312  ),
313  mesh,
315  )
316  );
317  }
318 
319  return *massEscapePtr_;
320 }
321 
322 
323 template<class CloudType>
325 {
326  if (!massStickPtr_)
327  {
328  const fvMesh& mesh = this->owner().mesh();
329 
330  massStickPtr_.reset
331  (
332  new volScalarField
333  (
334  IOobject
335  (
336  IOobject::scopedName(this->owner().name(), "massStick"),
337  mesh.time().timeName(),
338  mesh.thisDb(),
342  ),
343  mesh,
345  )
346  );
347  }
349  return *massStickPtr_;
350 }
351 
352 
353 template<class CloudType>
355 (
356  typename CloudType::parcelType& p,
357  const polyPatch& pp,
358  bool& keepParticle
359 )
360 {
361  const label patchi = patchData_.applyToPatch(pp.index());
362 
363  if (patchi >= 0)
364  {
365  vector& U = p.U();
366 
367  // Location for storing the stats.
368  const label idx =
369  (
370  injIdToIndex_.size()
371  ? injIdToIndex_.lookup(p.typeId(), 0)
372  : 0
373  );
374 
375  if (patchData_[patchi].isBaiGosman())
376  {
377  return beiGosman_.correct
378  (
379  p,
380  pp,
381  patchi,
382  idx,
383  keepParticle,
385  <
386  typename CloudType::parcelType
387  >()
388  );
389  }
390 
393  (
394  patchData_[patchi].interactionTypeName()
395  );
396 
397  switch (it)
398  {
400  {
401  return false;
402  }
404  {
405  keepParticle = false;
406  p.active(false);
407  U = Zero;
408 
409  const scalar dm = p.mass()*p.nParticle();
410 
411  if (hasBaiGosman_)
412  {
413  addEscapeCounters
414  (
415  patchi,
416  idx,
417  dm,
418  pp,
419  pp.whichFace(p.face())
420  );
421  }
422  else
423  {
424  nEscape_[patchi][idx]++;
425  massEscape_[patchi][idx] += dm;
426 
427  if (writeFields_)
428  {
429  const label pI = pp.index();
430  const label fI = pp.whichFace(p.face());
431  massEscape().boundaryFieldRef()[pI][fI] += dm;
432  }
433  }
434  break;
435  }
437  {
438  keepParticle = true;
439  p.active(false);
440  U = Zero;
441 
442  const scalar dm = p.mass()*p.nParticle();
443 
444  if (hasBaiGosman_)
445  {
446  addStickCounters
447  (
448  patchi,
449  idx,
450  dm,
451  pp,
452  pp.whichFace(p.face())
453  );
454  }
455  else
456  {
457  nStick_[patchi][idx]++;
458  massStick_[patchi][idx] += dm;
459 
460  if (writeFields_)
461  {
462  const label pI = pp.index();
463  const label fI = pp.whichFace(p.face());
464  massStick().boundaryFieldRef()[pI][fI] += dm;
465  }
466  }
467  break;
468  }
470  {
471  keepParticle = true;
472  p.active(true);
473 
474  vector nw;
475  vector Up;
476 
477  this->owner().patchData(p, pp, nw, Up);
478 
479  // Calculate motion relative to patch velocity
480  U -= Up;
481 
482  if (mag(Up) > 0 && mag(U) < this->Urmax())
483  {
485  << "Particle U the same as patch "
486  << " The particle has been removed" << nl << endl;
487 
488  keepParticle = false;
489  p.active(false);
490  U = Zero;
491  break;
492  }
493 
494  scalar Un = U & nw;
495  vector Ut = U - Un*nw;
496 
497  if (Un > 0)
498  {
499  U -= (1.0 + patchData_[patchi].e())*Un*nw;
500  }
501 
502  U -= patchData_[patchi].mu()*Ut;
503 
504  // Return velocity to global space
505  U += Up;
506 
507  if (hasBaiGosman_)
508  {
509  addReboundCounters
510  (
511  patchi,
512  idx,
513  p.mass()*p.nParticle()
514  );
515  }
516 
517  break;
518  }
519  default:
520  {
522  << "Unknown interaction type "
523  << patchData_[patchi].interactionTypeName()
524  << "(" << it << ") for patch "
525  << patchData_[patchi].patchName()
526  << ". Valid selections are:" << this->interactionTypeNames_
528  << endl << abort(FatalError);
529  }
530  }
531 
532  return true;
533  }
534 
535  return false;
536 }
537 
538 
539 template<class CloudType>
541 {
543 
544  if (Pstream::parRun())
545  {
546  const bool anyBaiGosman = returnReduceOr(hasBaiGosman_);
547  const bool allBaiGosman = returnReduceAnd(hasBaiGosman_);
548 
549  if (anyBaiGosman != allBaiGosman)
550  {
552  << "Inconsistent BaiGosman configuration across processors."
553  << exit(FatalError);
554  }
555 
556  const label nPatches = patchData_.size();
557  const label minPatches = returnReduce(nPatches, minOp<label>());
558  const label maxPatches = returnReduce(nPatches, maxOp<label>());
559 
560  if (minPatches != maxPatches)
561  {
563  << "Inconsistent localInteraction patch counter dimensions "
564  << "across processors: min = " << minPatches
565  << ", max = " << maxPatches
566  << exit(FatalError);
567  }
568 
569  forAll(nEscape_, patchi)
570  {
571  const label nInjectors = nEscape_[patchi].size();
572  const label minInjectors =
573  returnReduce(nInjectors, minOp<label>());
574  const label maxInjectors =
575  returnReduce(nInjectors, maxOp<label>());
576 
577  if (minInjectors != maxInjectors)
578  {
580  << "Inconsistent localInteraction injector counter "
581  << "dimensions across processors for patch entry "
582  << patchData_[patchi].patchName()
583  << ": min = " << minInjectors
584  << ", max = " << maxInjectors
585  << exit(FatalError);
586  }
587  }
588  }
589 
590  // retrieve any stored data
591  labelListList npe0(patchData_.size());
592  scalarListList mpe0(patchData_.size());
593  labelListList nps0(patchData_.size());
594  scalarListList mps0(patchData_.size());
595  labelListList nRebound0(patchData_.size());
596  scalarListList massRebound0(patchData_.size());
597  labelListList nSplash0(patchData_.size());
598  scalarListList massSplash0(patchData_.size());
599 
600  forAll(patchData_, patchi)
601  {
602  label lsd = nEscape_[patchi].size();
603  npe0[patchi].setSize(lsd, Zero);
604  mpe0[patchi].setSize(lsd, Zero);
605  nps0[patchi].setSize(lsd, Zero);
606  mps0[patchi].setSize(lsd, Zero);
607 
608  if (hasBaiGosman_)
609  {
610  nRebound0[patchi].setSize(lsd, Zero);
611  massRebound0[patchi].setSize(lsd, Zero);
612  nSplash0[patchi].setSize(lsd, Zero);
613  massSplash0[patchi].setSize(lsd, Zero);
614  }
615  }
616 
617 
618  this->getModelProperty("nEscape", npe0);
619  this->getModelProperty("massEscape", mpe0);
620  this->getModelProperty("nStick", nps0);
621  this->getModelProperty("massStick", mps0);
622 
623  if (hasBaiGosman_)
624  {
625  this->getModelProperty("nRebound", nRebound0);
626  this->getModelProperty("massRebound", massRebound0);
627  this->getModelProperty("nSplash", nSplash0);
628  this->getModelProperty("massSplash", massSplash0);
629  }
630 
631  // accumulate current data
632  labelListList npe(nEscape_);
633  forAll(npe, i)
634  {
635  Pstream::listGather(npe[i], sumOp<label>());
636  npe[i] = npe[i] + npe0[i];
637  }
638 
639  scalarListList mpe(massEscape_);
640  forAll(mpe, i)
641  {
642  Pstream::listGather(mpe[i], sumOp<scalar>());
643  mpe[i] = mpe[i] + mpe0[i];
644  }
645 
646  labelListList nps(nStick_);
647  forAll(nps, i)
648  {
649  Pstream::listGather(nps[i], sumOp<label>());
650  nps[i] = nps[i] + nps0[i];
651  }
652 
653  scalarListList mps(massStick_);
654  forAll(nps, i)
655  {
656  Pstream::listGather(mps[i], sumOp<scalar>());
657  mps[i] = mps[i] + mps0[i];
658  }
659 
660  labelListList nRebound(nRebound_);
661  scalarListList massRebound(massRebound_);
662  labelListList nSplash(nSplash_);
663  scalarListList massSplash(massSplash_);
664 
665  if (hasBaiGosman_)
666  {
667  forAll(nRebound, i)
668  {
669  Pstream::listGather(nRebound[i], sumOp<label>());
670  nRebound[i] = nRebound[i] + nRebound0[i];
671  }
672 
673  forAll(massRebound, i)
674  {
675  Pstream::listGather(massRebound[i], sumOp<scalar>());
676  massRebound[i] = massRebound[i] + massRebound0[i];
677  }
678 
679  forAll(nSplash, i)
680  {
681  Pstream::listGather(nSplash[i], sumOp<label>());
682  nSplash[i] = nSplash[i] + nSplash0[i];
683  }
684 
685  forAll(massSplash, i)
686  {
687  Pstream::listGather(massSplash[i], sumOp<scalar>());
688  massSplash[i] = massSplash[i] + massSplash0[i];
689  }
690  }
691 
692  if (injIdToIndex_.size())
693  {
694  // Since injIdToIndex_ is a one-to-one mapping (starting at zero),
695  // can simply invert it.
696  labelList indexToInjector(injIdToIndex_.size());
697  forAllConstIters(injIdToIndex_, iter)
698  {
699  indexToInjector[iter.val()] = iter.key();
700  }
701 
702  forAll(patchData_, patchi)
703  {
704  forAll(mpe[patchi], indexi)
705  {
706  const word& patchName = patchData_[patchi].patchName();
707 
708  Log_<< " Parcel fate: patch " << patchName
709  << " (number, mass)" << nl
710  << " - escape (injector " << indexToInjector[indexi]
711  << " ) = " << npe[patchi][indexi]
712  << ", " << mpe[patchi][indexi] << nl
713  << " - stick (injector " << indexToInjector[indexi]
714  << " ) = " << nps[patchi][indexi]
715  << ", " << mps[patchi][indexi] << nl;
716 
717  if (hasBaiGosman_)
718  {
719  Log_<< " - rebound (injector "
720  << indexToInjector[indexi]
721  << " ) = " << nRebound[patchi][indexi]
722  << ", " << massRebound[patchi][indexi] << nl
723  << " - splash (injector "
724  << indexToInjector[indexi]
725  << " ) = " << nSplash[patchi][indexi]
726  << ", " << massSplash[patchi][indexi] << nl;
727  }
728  }
729  }
730  }
731  else
732  {
733  forAll(patchData_, patchi)
734  {
735  const word& patchName = patchData_[patchi].patchName();
736 
737  Log_<< " Parcel fate: patch " << patchName
738  << " (number, mass)" << nl
739  << " - escape = "
740  << npe[patchi][0] << ", " << mpe[patchi][0] << nl
741  << " - stick = "
742  << nps[patchi][0] << ", " << mps[patchi][0] << nl;
743 
744  if (hasBaiGosman_)
745  {
746  Log_<< " - rebound = "
747  << nRebound[patchi][0] << ", "
748  << massRebound[patchi][0] << nl
749  << " - splash = "
750  << nSplash[patchi][0] << ", "
751  << massSplash[patchi][0] << nl;
752  }
753  }
754  }
755 
756  forAll(npe, patchi)
757  {
758  forAll(npe[patchi], injectori)
759  {
760  this->file()
761  << tab << npe[patchi][injectori]
762  << tab << mpe[patchi][injectori]
763  << tab << nps[patchi][injectori]
764  << tab << mps[patchi][injectori];
765 
766  if (hasBaiGosman_)
767  {
768  this->file()
769  << tab << nRebound[patchi][injectori]
770  << tab << massRebound[patchi][injectori]
771  << tab << nSplash[patchi][injectori]
772  << tab << massSplash[patchi][injectori];
773  }
774  }
775  }
776 
777  this->file() << endl;
778 
779  if (this->writeTime())
780  {
781  this->setModelProperty("nEscape", npe);
782  this->setModelProperty("massEscape", mpe);
783  this->setModelProperty("nStick", nps);
784  this->setModelProperty("massStick", mps);
785 
786  if (hasBaiGosman_)
787  {
788  this->setModelProperty("nRebound", nRebound);
789  this->setModelProperty("massRebound", massRebound);
790  this->setModelProperty("nSplash", nSplash);
791  this->setModelProperty("massSplash", massSplash);
792  }
793 
794  nEscape_ = Zero;
795  massEscape_ = Zero;
796  nStick_ = Zero;
797  massStick_ = Zero;
798 
799  if (hasBaiGosman_)
800  {
801  nRebound_ = Zero;
802  massRebound_ = Zero;
803  nSplash_ = Zero;
804  massSplash_ = Zero;
805  }
806  }
807 }
808 
809 
810 // ************************************************************************* //
Patch interaction specified on a patch-by-patch basis.
Definition: BaiGosman.H:48
label nPatches
Definition: readKivaGrid.H:394
volScalarField & massEscape()
Return access to the massEscape field.
PatchInteractionModel(CloudType &owner)
Construct null from owner.
virtual OFstream & file()
Return access to the file (if only 1)
Definition: writeFile.C:269
dictionary dict
DSMCCloud< dsmcParcel > CloudType
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:652
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:518
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:1774
constexpr char tab
The tab &#39;\t&#39; character(0x09)
Definition: Ostream.H:49
virtual void addToEscapedParcels(const scalar mass)
Add to escaped parcels.
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:360
virtual bool writeTime() const
Flag to indicate when to write a property.
List< labelList > labelListList
List of labelList.
Definition: labelList.H:38
virtual void info()
Write patch interaction info.
Templated patch interaction model class.
const CloudType & owner() const
Return const access to the owner cloud.
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:400
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:72
virtual void info()
Write patch interaction info.
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
Definition: IOobjectI.H:50
static void listGather(UList< T > &values, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Gather (reduce) list elements, applying bop to each list element.
dynamicFvMesh & mesh
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
#define Log_
Report write to Foam::Info if the class log switch is true.
void setModelProperty(const word &entryName, const Type &value)
Add generic property to the sub-model.
List< scalarList > scalarListList
List of scalarList.
Definition: scalarList.H:35
A class for handling words, derived from Foam::string.
Definition: word.H:63
bool returnReduceAnd(const bool value, const int communicator=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
const scalar & Urmax() const
Return Urmax.
Reading is optional [identical to LAZY_READ].
LocalInteraction(const dictionary &dict, CloudType &owner)
Construct from dictionary.
bool getModelProperty(const word &entryName, Type &value) const
Retrieve generic property from the sub-model.
const dictionary & coeffDict() const
Return const access to the coefficients dictionary.
Definition: subModelBase.C:122
bool returnReduceOr(const bool value, const int communicator=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
errorManip< error > abort(error &err)
Definition: errorManip.H:139
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:290
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
Definition: Time.C:713
volScalarField & massStick()
Return access to the massStick field.
auto & name
const fvMesh & mesh() const
Return reference to the mesh.
Definition: DSMCCloudI.H:37
decomposeUsingBbs false
Use bounding boxes (default) or unique decomposition of triangles (i.e. do not duplicate triangles) ...
U
Definition: pEqn.H:72
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
return returnReduce(nRefine-oldNRefine, sumOp< label >())
Automatically write from objectRegistry::writeObject()
virtual void writeFileHeader(Ostream &os)
Output file header information.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
virtual void writeFileHeader(Ostream &os)
Output file header information.
messageStream Info
Information stream (stdout output on master, null elsewhere)
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
List< label > labelList
A List of labels.
Definition: List.H:61
volScalarField & p
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:188
Request registration (bool: true)
static interactionType wordToInteractionType(const word &itWord)
Convert word to interaction result.
virtual bool correct(typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle)
Apply velocity correction.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
forAllConstIters(mixture.phases(), phase)
Definition: pEqn.H:28
static const word beiGosmanTypeName
BaiGosman type keyword used in patch entries.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127
virtual void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.
Definition: writeFile.C:333