KinematicCloud.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) 2016-2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "KinematicCloud.H"
30 #include "integrationScheme.H"
31 #include "interpolation.H"
32 #include "subCycleTime.H"
33 
34 #include "InjectionModelList.H"
35 #include "DispersionModel.H"
36 #include "PatchInteractionModel.H"
38 #include "SurfaceFilmModel.H"
39 #include "profiling.H"
40 
41 #include "PackingModel.H"
42 #include "ParticleStressModel.H"
43 #include "DampingModel.H"
44 #include "IsotropyModel.H"
45 #include "TimeScaleModel.H"
46 
47 // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
48 
49 template<class CloudType>
51 {
52  dispersionModel_.reset
53  (
55  (
56  subModelProperties_,
57  *this
58  ).ptr()
59  );
60 
61  patchInteractionModel_.reset
62  (
64  (
65  subModelProperties_,
66  *this
67  ).ptr()
68  );
69 
70  stochasticCollisionModel_.reset
71  (
73  (
74  subModelProperties_,
75  *this
76  ).ptr()
77  );
78 
79  surfaceFilmModel_.reset
80  (
82  (
83  subModelProperties_,
84  *this
85  ).ptr()
86  );
87 
88  packingModel_.reset
89  (
91  (
92  subModelProperties_,
93  *this
94  ).ptr()
95  );
96 
97  dampingModel_.reset
98  (
100  (
101  subModelProperties_,
102  *this
103  ).ptr()
104  );
105 
106  isotropyModel_.reset
107  (
109  (
110  subModelProperties_,
111  *this
112  ).ptr()
113  );
114 
115  UIntegrator_.reset
116  (
118  (
119  "U",
120  solution_.integrationSchemes()
121  ).ptr()
122  );
123 }
124 
125 
126 template<class CloudType>
127 template<class TrackCloudType>
129 (
130  TrackCloudType& cloud,
131  typename parcelType::trackingData& td
132 )
133 {
134  addProfiling(prof, "cloud::solve");
135 
136  log = solution_.log();
137 
138  if (solution_.steadyState())
139  {
140  cloud.storeState();
141 
142  cloud.preEvolve(td);
143 
144  evolveCloud(cloud, td);
145 
146  if (solution_.coupled())
147  {
148  cloud.relaxSources(cloud.cloudCopy());
149  }
150  }
151  else
152  {
153  cloud.preEvolve(td);
154 
155  evolveCloud(cloud, td);
156 
157  if (solution_.coupled())
158  {
159  cloud.scaleSources();
160  }
161  }
162 
163  cloud.info();
164 
165  cloud.postEvolve(td);
166 
167  if (solution_.steadyState())
168  {
169  cloud.restoreState();
170  }
171 }
172 
173 
174 template<class CloudType>
176 {
177  if (!cellOccupancyPtr_)
178  {
179  cellOccupancyPtr_.reset
180  (
181  new List<DynamicList<parcelType*>>(mesh_.nCells())
182  );
183  }
184  else if (cellOccupancyPtr_().size() != mesh_.nCells())
185  {
186  // If the size of the mesh has changed, reset the
187  // cellOccupancy size
188 
189  cellOccupancyPtr_().setSize(mesh_.nCells());
190  }
191 
192  List<DynamicList<parcelType*>>& cellOccupancy = cellOccupancyPtr_();
193 
194  for (auto& list : cellOccupancy)
195  {
196  list.clear();
197  }
198 
199  for (parcelType& p : *this)
200  {
201  cellOccupancy[p.cell()].append(&p);
202  }
203 }
204 
205 
206 template<class CloudType>
208 {
209  // Only build the cellOccupancy if the pointer is set, i.e. it has
210  // been requested before.
211 
212  if (cellOccupancyPtr_)
213  {
214  buildCellOccupancy();
215  }
216 }
217 
218 
219 template<class CloudType>
220 template<class TrackCloudType>
222 (
223  TrackCloudType& cloud,
224  typename parcelType::trackingData& td
225 )
226 {
227  if (solution_.coupled())
228  {
229  cloud.resetSourceTerms();
230  }
231 
232  if (solution_.transient())
233  {
234  label preInjectionSize = this->size();
235 
236  this->surfaceFilm().inject(cloud);
237 
238  // Update the cellOccupancy if the size of the cloud has changed
239  // during the injection.
240  if (preInjectionSize != this->size())
241  {
242  updateCellOccupancy();
243  preInjectionSize = this->size();
244  }
245 
246  injectors_.inject(cloud, td);
247 
248  // Assume that motion will update the cellOccupancy as necessary
249  // before it is required.
250  cloud.motion(cloud, td);
251 
252  stochasticCollision().update(td, solution_.trackTime());
253  }
254  else
255  {
256 // this->surfaceFilm().injectSteadyState(cloud);
257 
258  injectors_.injectSteadyState(cloud, td, solution_.trackTime());
259 
260  td.part() = parcelType::trackingData::tpLinearTrack;
261  CloudType::move(cloud, td, solution_.trackTime());
262  }
263 }
264 
265 
266 template<class CloudType>
268 (
269  const typename parcelType::trackingData& td
270 )
271 {
272  Log_<< endl;
273 
274  if (debug)
275  {
276  this->writePositions();
277  }
278 
279  this->dispersion().cacheFields(false);
280 
281  this->patchInteraction().postEvolve();
282 
283  forces_.cacheFields(false);
284 
285  functions_.postEvolve(td);
286 
287  solution_.nextIter();
288 
289  if (this->db().time().writeTime())
290  {
291  outputProperties_.writeObject
292  (
293  IOstreamOption
294  (
295  IOstreamOption::ASCII,
296  this->db().time().writeCompression()
297  ),
298  true
299  );
300  }
301 
302  if (this->dampingModel().active())
303  {
304  this->dampingModel().cacheFields(false);
305  }
306  if (this->packingModel().active())
307  {
308  this->packingModel().cacheFields(false);
309  }
310 }
311 
312 
313 template<class CloudType>
314 void Foam::KinematicCloud<CloudType>::cloudReset(KinematicCloud<CloudType>& c)
315 {
316  CloudType::cloudReset(c);
317 
318  rndGen_ = c.rndGen_;
319 
320  forces_.transfer(c.forces_);
321 
322  functions_.transfer(c.functions_);
323 
324  injectors_.transfer(c.injectors_);
325 
326  dispersionModel_.reset(c.dispersionModel_.ptr());
327  patchInteractionModel_.reset(c.patchInteractionModel_.ptr());
328  stochasticCollisionModel_.reset(c.stochasticCollisionModel_.ptr());
329  surfaceFilmModel_.reset(c.surfaceFilmModel_.ptr());
330 
331  packingModel_.reset(c.packingModel_.ptr());
332  dampingModel_.reset(c.dampingModel_.ptr());
333  isotropyModel_.reset(c.isotropyModel_.ptr());
334 
335  UIntegrator_.reset(c.UIntegrator_.ptr());
336 }
337 
338 
339 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
340 
341 template<class CloudType>
343 (
344  const word& cloudName,
345  const volScalarField& rho,
346  const volVectorField& U,
347  const volScalarField& mu,
348  const dimensionedVector& g,
349  bool readFields
350 )
351 :
352  CloudType(rho.mesh(), cloudName, false),
353  kinematicCloud(),
354  cloudCopyPtr_(nullptr),
355  mesh_(rho.mesh()),
356  particleProperties_
357  (
358  IOobject
359  (
360  cloudName + "Properties",
361  mesh_.time().constant(),
362  mesh_,
363  IOobject::MUST_READ_IF_MODIFIED,
364  IOobject::NO_WRITE
365  )
366  ),
367  outputProperties_
368  (
369  IOobject
370  (
371  cloudName + "OutputProperties",
372  mesh_.time().timeName(),
373  "uniform"/cloud::prefix/cloudName,
374  mesh_,
375  IOobject::READ_IF_PRESENT,
376  IOobject::NO_WRITE
377  )
378  ),
379  solution_(mesh_, particleProperties_.subDict("solution")),
380  constProps_(particleProperties_),
381  subModelProperties_
382  (
383  particleProperties_.subOrEmptyDict
384  (
385  "subModels",
386  keyType::REGEX,
387  solution_.active()
388  )
389  ),
390  rndGen_(Pstream::myProcNo()),
391  cellOccupancyPtr_(),
392  cellLengthScale_(mag(cbrt(mesh_.V()))),
393  rho_(rho),
394  U_(U),
395  mu_(mu),
396  g_(g),
397  pAmbient_(0.0),
398  forces_
399  (
400  *this,
401  mesh_,
402  subModelProperties_.subOrEmptyDict
403  (
404  "particleForces",
405  keyType::REGEX,
406  solution_.active()
407  ),
408  solution_.active()
409  ),
410  functions_
411  (
412  *this,
413  particleProperties_.subOrEmptyDict("cloudFunctions"),
414  solution_.active()
415  ),
416  injectors_
417  (
418  subModelProperties_.subOrEmptyDict("injectionModels"),
419  *this
420  ),
421  dispersionModel_(nullptr),
422  patchInteractionModel_(nullptr),
423  stochasticCollisionModel_(nullptr),
424  surfaceFilmModel_(nullptr),
425 
426  packingModel_(nullptr),
427  dampingModel_(nullptr),
428  isotropyModel_(nullptr),
429 
430  UIntegrator_(nullptr),
431  UTrans_
432  (
433  new volVectorField::Internal
434  (
435  IOobject
436  (
437  this->name() + ":UTrans",
438  this->db().time().timeName(),
439  this->db(),
440  IOobject::READ_IF_PRESENT,
441  IOobject::AUTO_WRITE
442  ),
443  mesh_,
445  )
446  ),
447  UCoeff_
448  (
449  new volScalarField::Internal
450  (
451  IOobject
452  (
453  this->name() + ":UCoeff",
454  this->db().time().timeName(),
455  this->db(),
456  IOobject::READ_IF_PRESENT,
457  IOobject::AUTO_WRITE
458  ),
459  mesh_,
461  )
462  ),
463  log(true)
464 {
465  if (solution_.active())
466  {
467  setModels();
468 
469  if (readFields)
470  {
471  parcelType::readFields(*this);
472  this->deleteLostParticles();
473  }
474  }
475 
476  if (solution_.resetSourcesOnStartup())
477  {
478  resetSourceTerms();
479  }
480 }
481 
482 
483 template<class CloudType>
485 (
486  KinematicCloud<CloudType>& c,
487  const word& name
488 )
489 :
490  CloudType(c.mesh_, name, c),
491  kinematicCloud(),
492  cloudCopyPtr_(nullptr),
493  mesh_(c.mesh_),
494  particleProperties_(c.particleProperties_),
495  outputProperties_(c.outputProperties_),
496  solution_(c.solution_),
497  constProps_(c.constProps_),
498  subModelProperties_(c.subModelProperties_),
499  rndGen_(c.rndGen_, true),
500  cellOccupancyPtr_(nullptr),
501  cellLengthScale_(c.cellLengthScale_),
502  rho_(c.rho_),
503  U_(c.U_),
504  mu_(c.mu_),
505  g_(c.g_),
506  pAmbient_(c.pAmbient_),
507  forces_(c.forces_),
508  functions_(c.functions_),
509  injectors_(c.injectors_),
510  dispersionModel_(c.dispersionModel_->clone()),
511  patchInteractionModel_(c.patchInteractionModel_->clone()),
512  stochasticCollisionModel_(c.stochasticCollisionModel_->clone()),
513  surfaceFilmModel_(c.surfaceFilmModel_->clone()),
514 
515  packingModel_(c.packingModel_->clone()),
516  dampingModel_(c.dampingModel_->clone()),
517  isotropyModel_(c.isotropyModel_->clone()),
518 
519  UIntegrator_(c.UIntegrator_->clone()),
520  UTrans_
521  (
522  new volVectorField::Internal
523  (
524  IOobject
525  (
526  this->name() + ":UTrans",
527  this->db().time().timeName(),
528  this->db(),
529  IOobject::NO_READ,
530  IOobject::NO_WRITE,
531  false
532  ),
533  c.UTrans_()
534  )
535  ),
536  UCoeff_
537  (
538  new volScalarField::Internal
539  (
540  IOobject
541  (
542  name + ":UCoeff",
543  this->db().time().timeName(),
544  this->db(),
545  IOobject::NO_READ,
546  IOobject::NO_WRITE,
547  false
548  ),
549  c.UCoeff_()
550  )
551  ),
552  log(c.log)
553 {}
554 
555 
556 template<class CloudType>
558 (
559  const fvMesh& mesh,
560  const word& name,
562 )
563 :
564  CloudType(mesh, name, IDLList<parcelType>()),
565  kinematicCloud(),
566  cloudCopyPtr_(nullptr),
567  mesh_(mesh),
568  particleProperties_
569  (
570  IOobject
571  (
572  name + "Properties",
573  mesh_.time().constant(),
574  mesh_,
575  IOobject::NO_READ,
576  IOobject::NO_WRITE,
577  false
578  )
579  ),
580  outputProperties_
581  (
582  IOobject
583  (
584  name + "OutputProperties",
585  mesh_.time().timeName(),
586  "uniform"/cloud::prefix/name,
587  mesh_,
588  IOobject::NO_READ,
589  IOobject::NO_WRITE,
590  false
591  )
592  ),
593  solution_(mesh),
594  constProps_(),
595  subModelProperties_(),
596  rndGen_(),
597  cellOccupancyPtr_(nullptr),
598  cellLengthScale_(c.cellLengthScale_),
599  rho_(c.rho_),
600  U_(c.U_),
601  mu_(c.mu_),
602  g_(c.g_),
603  pAmbient_(c.pAmbient_),
604  forces_(*this, mesh),
605  functions_(*this),
606  injectors_(*this),
607  dispersionModel_(nullptr),
608  patchInteractionModel_(nullptr),
609  stochasticCollisionModel_(nullptr),
610  surfaceFilmModel_(nullptr),
611 
612  packingModel_(nullptr),
613  dampingModel_(nullptr),
614  isotropyModel_(nullptr),
615 
616  UIntegrator_(nullptr),
617  UTrans_(nullptr),
618  UCoeff_(nullptr),
619  log(c.log)
620 {}
621 
622 
623 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
624 
625 template<class CloudType>
627 (
628  parcelType& parcel,
629  const scalar lagrangianDt
630 )
631 {
632  // If rho0 is given in the const properties
633  if (constProps_.rho0() != -1)
634  {
635  parcel.rho() = constProps_.rho0();
636  }
637 }
638 
639 
640 template<class CloudType>
642 (
643  parcelType& parcel,
644  const scalar lagrangianDt,
645  const bool fullyDescribed
646 )
647 {
648  const scalar carrierDt = mesh_.time().deltaTValue();
649  parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
650 
651  if (parcel.typeId() == -1)
652  {
653  parcel.typeId() = constProps_.parcelTypeId();
654  }
655 
656  if (parcel.rho() == -1)
657  {
659  << "The kinematic cloud needs rho0 in the constantProperties "
660  << " dictionary. " << nl
661  << abort(FatalError);
662  }
663 }
664 
665 
666 template<class CloudType>
668 {
669  cloudCopyPtr_.reset
670  (
671  static_cast<KinematicCloud<CloudType>*>
672  (
673  clone(this->name() + "Copy").ptr()
674  )
675  );
676 }
677 
678 
679 template<class CloudType>
681 {
682  cloudReset(cloudCopyPtr_());
683  cloudCopyPtr_.clear();
684 }
685 
686 
687 template<class CloudType>
689 {
690  UTrans().field() = Zero;
691  UCoeff().field() = 0.0;
692 }
693 
694 
695 template<class CloudType>
696 template<class Type>
698 (
700  const DimensionedField<Type, volMesh>& field0,
701  const word& name
702 ) const
703 {
704  const scalar coeff = solution_.relaxCoeff(name);
705  field = field0 + coeff*(field - field0);
706 }
707 
708 
709 template<class CloudType>
710 template<class Type>
712 (
714  const word& name
715 ) const
716 {
717  const scalar coeff = solution_.relaxCoeff(name);
718  field *= coeff;
719 }
720 
721 
722 template<class CloudType>
724 (
725  const KinematicCloud<CloudType>& cloudOldTime
726 )
727 {
728  this->relax(UTrans_(), cloudOldTime.UTrans(), "U");
729  this->relax(UCoeff_(), cloudOldTime.UCoeff(), "U");
730 }
731 
732 
733 template<class CloudType>
735 {
736  this->scale(UTrans_(), "U");
737  this->scale(UCoeff_(), "U");
738 }
739 
740 
741 template<class CloudType>
743 (
744  const typename parcelType::trackingData& td
745 )
746 {
747  // force calculation of mesh dimensions - needed for parallel runs
748  // with topology change due to lazy evaluation of valid mesh dimensions
749  label nGeometricD = mesh_.nGeometricD();
750 
751  Log_<< "\nSolving" << nGeometricD << "-D cloud " << this->name() << endl;
752 
753  this->dispersion().cacheFields(true);
754  forces_.cacheFields(true);
755 
756  pAmbient_ = constProps_.dict().template
757  getOrDefault<scalar>("pAmbient", pAmbient_);
758 
759  if (this->dampingModel().active() || this->packingModel().active())
760  {
761  const_cast<typename parcelType::trackingData&>(td).updateAverages(*this);
762  }
763 
764  if (this->dampingModel().active())
765  {
766  this->dampingModel().cacheFields(true);
767  }
768  if (this->packingModel().active())
769  {
770  this->packingModel().cacheFields(true);
771  }
772 
773  updateCellOccupancy();
774 
775  functions_.preEvolve(td);
776 }
777 
778 
779 template<class CloudType>
781 {
782  if (solution_.canEvolve())
783  {
784  typename parcelType::trackingData td(*this);
785  solve(*this, td);
786  }
787 }
788 
789 
790 template<class CloudType>
791 template<class TrackCloudType>
793 (
794  TrackCloudType& cloud,
795  typename parcelType::trackingData& td
796 )
797 {
798  td.part() = parcelType::trackingData::tpLinearTrack;
799  CloudType::move(cloud, td, solution_.trackTime());
800 
801  if (isotropyModel_->active())
802  {
803  td.updateAverages(cloud);
804  isotropyModel_->calculate();
805  }
807  updateCellOccupancy();
808 }
809 
810 
811 template<class CloudType>
813 (
814  const parcelType& p,
815  const polyPatch& pp,
816  vector& nw,
817  vector& Up
818 ) const
819 {
820  p.patchData(nw, Up);
821 
822  // If this is a wall patch, then there may be a non-zero tangential velocity
823  // component; the lid velocity in a lid-driven cavity case, for example. We
824  // want the particle to interact with this velocity, so we look it up in the
825  // velocity field and use it to set the wall-tangential component.
826  if (isA<wallPolyPatch>(pp))
827  {
828  const label patchi = pp.index();
829  const label patchFacei = pp.whichFace(p.face());
830 
831  // We only want to use the boundary condition value only if it is set
832  // by the boundary condition. If the boundary values are extrapolated
833  // (e.g., slip conditions) then they represent the motion of the fluid
834  // just inside the domain rather than that of the wall itself.
835  if (U_.boundaryField()[patchi].fixesValue())
836  {
837  const vector Uw1(U_.boundaryField()[patchi][patchFacei]);
838  const vector& Uw0 =
839  U_.oldTime().boundaryField()[patchi][patchFacei];
840 
841  const scalar f = p.currentTimeFraction();
842 
843  const vector Uw(Uw0 + f*(Uw1 - Uw0));
844 
845  const tensor nnw(nw*nw);
846 
847  Up = (nnw & Up) + Uw - (nnw & Uw);
848  }
849  }
850 }
851 
852 
853 template<class CloudType>
855 {
856  updateCellOccupancy();
857  injectors_.updateMesh();
858  cellLengthScale_ = mag(cbrt(mesh_.V()));
859 }
860 
861 
862 template<class CloudType>
864 {
866 
867  updateMesh();
868 }
869 
870 
871 template<class CloudType>
873 {
874  const vector linearMomentum =
875  returnReduce(linearMomentumOfSystem(), sumOp<vector>());
876 
877  const scalar linearKineticEnergy =
878  returnReduce(linearKineticEnergyOfSystem(), sumOp<scalar>());
879 
880  const label nTotParcel = returnReduce(this->size(), sumOp<label>());
881 
882  const scalar particlePerParcel =
883  (
884  nTotParcel
885  ? (returnReduce(totalParticlePerParcel(), sumOp<scalar>()) / nTotParcel)
886  : 0
887  );
888 
889  Log_<< "Cloud: " << this->name() << nl
890  << " Current number of parcels = " << nTotParcel << nl
891  << " Current mass in system = "
892  << returnReduce(massInSystem(), sumOp<scalar>()) << nl
893  << " Linear momentum = " << linearMomentum << nl
894  << " |Linear momentum| = " << mag(linearMomentum) << nl
895  << " Linear kinetic energy = " << linearKineticEnergy << nl
896  << " Average particle per parcel = " << particlePerParcel << nl;
897 
898 
899  injectors_.info();
900  this->surfaceFilm().info();
901  this->patchInteraction().info();
902 
903  if (this->packingModel().active())
904  {
905  tmp<volScalarField> alpha = this->theta();
906 
907  if (this->db().time().writeTime())
908  {
909  alpha().write();
910  }
911 
912  const scalar alphaMin = gMin(alpha().primitiveField());
913  const scalar alphaMax = gMax(alpha().primitiveField());
914 
915  Log_<< " Min cell volume fraction = " << alphaMin << nl
916  << " Max cell volume fraction = " << alphaMax << endl;
917 
918  if (alphaMax < SMALL)
919  {
920  return;
921  }
922 
923  scalar nMin = GREAT;
924 
925  forAll(this->mesh().cells(), celli)
926  {
927  const label n = this->cellOccupancy()[celli].size();
928 
929  if (n > 0)
930  {
931  const scalar nPack = n*alphaMax/alpha()[celli];
932 
933  if (nPack < nMin)
934  {
935  nMin = nPack;
936  }
937  }
938  }
939 
940  reduce(nMin, minOp<scalar>());
942  Log_<< " Min dense number of parcels = " << nMin << endl;
943  }
944 }
945 
946 
947 template<class CloudType>
949 {
950  parcelType::readObjects(*this, obr);
951 }
952 
953 
954 template<class CloudType>
956 {
957  parcelType::writeObjects(*this, obr);
958 }
959 
960 
961 // ************************************************************************* //
Template class for intrusive linked lists.
Definition: ILList.H:48
#define addProfiling(name, descr)
Define profiling trigger with specified name and description string.
rDeltaTY field()
label whichFace(const label facei) const noexcept
Return label of face in patch from global face label.
Definition: polyPatch.H:563
DSMCCloud< dsmcParcel > CloudType
void scaleSources()
Apply scaling to (transient) cloud sources.
void setModels()
Set cloud sub-models.
void relaxSources(const KinematicCloud< CloudType > &cloudOldTime)
Apply relaxation to (steady state) cloud sources.
void storeState()
Store the current cloud state.
dimensionedScalar log(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
UEqn relax()
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:578
Type gMin(const FieldField< Field, Type > &f)
void evolveCloud(TrackCloudType &cloud, typename parcelType::trackingData &td)
Evolve the cloud.
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:49
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
void postEvolve(const typename parcelType::trackingData &td)
Post-evolve.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:487
void relax(DimensionedField< Type, volMesh > &field, const DimensionedField< Type, volMesh > &field0, const word &name) const
Relax field.
volVectorField::Internal & UTrans()
Return reference to momentum source.
Base class for packing models.
virtual void writeObjects(objectRegistry &obr) const
Write particle fields as objects into the obr registry.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:85
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
void updateCellOccupancy()
Update (i.e. build) the cellOccupancy if it has.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:157
void buildCellOccupancy()
Build the cellOccupancy.
Templated patch interaction model class.
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:413
CEqn solve()
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:84
word timeName
Definition: getTimeIndex.H:3
void updateMesh()
Update mesh.
dimensionedScalar alphaMax("alphaMax", dimless/dimTime, laminarTransport)
dynamicFvMesh & mesh
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:52
#define Log_
Report write to Foam::Info if the class log switch is true.
const cellShapeList & cells
volScalarField::Internal & UCoeff()
Return coefficient for carrier phase U equation.
void resetSourceTerms()
Reset the cloud source terms.
const word cloudName(propsDict.get< word >("cloud"))
A class for handling words, derived from Foam::string.
Definition: word.H:63
void motion(TrackCloudType &cloud, typename parcelType::trackingData &td)
Particle motion.
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:53
virtual void readObjects(const objectRegistry &obr)
Read particle fields from objects in the obr registry.
dimensionedScalar cbrt(const dimensionedScalar &ds)
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
errorManip< error > abort(error &err)
Definition: errorManip.H:139
Base cloud calls templated on particle type.
Definition: Cloud.H:51
const uniformDimensionedVectorField & g
regionModels::surfaceFilmModel & surfaceFilm
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int debug
Static debugging option.
Type gMax(const FieldField< Field, Type > &f)
labelList f(nPoints)
Templated wall surface film model class.
const dimensionedScalar mu
Atomic mass unit.
Base class for collisional return-to-isotropy models.
void preEvolve(const typename parcelType::trackingData &td)
Pre-evolve.
Virtual abstract base class for templated KinematicCloud.
Templated base class for kinematic cloud.
void patchData(const parcelType &p, const polyPatch &pp, vector &normal, vector &Up) const
Calculate the patch normal and velocity to interact with,.
const List< DynamicList< molecule * > > & cellOccupancy
U
Definition: pEqn.H:72
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
void evolve()
Evolve the cloud.
Templated stochastic collision model class.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:79
const dimensionedScalar c
Speed of light in a vacuum.
Base class for dispersion modelling.
void info()
Print cloud information.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
void restoreState()
Reset the current cloud to the previously stored state.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
label n
void scale(DimensionedField< Type, volMesh > &field, const word &name) const
Scale field.
label index() const noexcept
The index of this patch in the boundaryMesh.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type.
void cloudReset(KinematicCloud< CloudType > &c)
Reset state of cloud.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Registry of regIOobjects.
virtual void autoMap(const mapPolyMesh &)
Remap the cells of particles corresponding to the.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Tensor of scalars, i.e. Tensor<scalar>.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:166
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:67
Base class for collisional damping models.
void solve(TrackCloudType &cloud, typename parcelType::trackingData &td)
Solve the cloud - calls all evolution functions.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:157
const dimensionSet dimVelocity