extractEulerianParticles.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) 2015-2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
29 #include "regionSplit2D.H"
30 #include "mathematicalConstants.H"
31 #include "volFields.H"
32 #include "surfaceFields.H"
33 #include "surfaceInterpolate.H"
34 #include "pairPatchAgglomeration.H"
35 #include "emptyPolyPatch.H"
36 #include "coupledPolyPatch.H"
37 #include "binned.H"
39 
40 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace functionObjects
45 {
46  defineTypeNameAndDebug(extractEulerianParticles, 0);
48  (
49  functionObject,
50  extractEulerianParticles,
51  dictionary
52  );
53 }
54 }
55 
56 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
57 
59 {
61 
63  if (zoneID_ == -1)
64  {
66  << "Unable to find faceZone " << faceZoneName_
67  << ". Available faceZones are: " << mesh_.faceZones().names()
68  << exit(FatalError);
69  }
70 
71  const faceZone& fz = mesh_.faceZones()[zoneID_];
72  const label nFaces = fz.size();
73  const label allFaces = returnReduce(nFaces, sumOp<label>());
74 
75  if (allFaces < nInjectorLocations_)
76  {
78  << "faceZone " << faceZoneName_
79  << ": Number of faceZone faces (" << allFaces
80  << ") is less than the number of requested locations ("
81  << nInjectorLocations_ << ")."
82  << exit(FatalError);
83  }
84 
85  Info<< type() << " " << name() << " output:" << nl
86  << " faceZone : " << faceZoneName_ << nl
87  << " faces : " << allFaces << nl
88  << endl;
89 
90  // Initialise old iteration blocked faces
91  // Note: for restart, this info needs to be written/read
92  regions0_.setSize(fz.size(), -1);
93 }
94 
95 
97 {
99 
100  if (!nInjectorLocations_)
101  {
102  return;
103  }
104 
105  const faceZone& fz = mesh_.faceZones()[zoneID_];
106 
107  // Agglomerate faceZone faces into nInjectorLocations_ global locations
109  (
110  IndirectList<face>(mesh_.faces(), fz),
111  mesh_.points()
112  );
113 
114  const label nFaces = fz.size();
115  label nLocations = nInjectorLocations_;
116 
117  if (Pstream::parRun())
118  {
119  label nGlobalFaces = returnReduce(nFaces, sumOp<label>());
120  scalar fraction = scalar(nFaces)/scalar(nGlobalFaces);
121  nLocations = ceil(fraction*nInjectorLocations_);
122  if (debug)
123  {
124  Pout<< "nFaces:" << nFaces
125  << ", nGlobalFaces:" << nGlobalFaces
126  << ", fraction:" << fraction
127  << ", nLocations:" << nLocations
128  << endl;
129  }
130  }
131 
133  (
134  patch.localFaces(),
135  patch.localPoints(),
136  10,
137  50,
138  nLocations,
139  labelMax,
140  180
141  );
142 
143  ppa.agglomerate();
144 
145  label nCoarseFaces = 0;
146  if (nFaces != 0)
147  {
148  fineToCoarseAddr_ = ppa.restrictTopBottomAddressing();
149  nCoarseFaces = max(fineToCoarseAddr_) + 1;
150  }
151 
152  globalCoarseFaces_ = globalIndex(nCoarseFaces);
153 
154  Info<< "Created " << returnReduce(nCoarseFaces, sumOp<label>())
155  << " coarse faces" << endl;
156 }
157 
158 
161 {
163 
164  const surfaceScalarField& phi
165  (
166  mesh_.lookupObject<surfaceScalarField>(phiName_)
167  );
168 
169  if (phi.dimensions() == dimMass/dimTime)
170  {
171  const volScalarField& rho =
172  mesh_.lookupObject<volScalarField>(rhoName_);
173 
174  return phi/fvc::interpolate(rho);
175  }
176 
177  return phi;
178 }
179 
180 
182 (
183  const surfaceScalarField& alphaf,
184  const faceZone& fz,
185  boolList& blockedFaces
186 )
187 {
189 
190  // Initialise storage for patch and patch-face indices where faceZone
191  // intersects mesh patch(es)
192  patchIDs_.setSize(fz.size(), -1);
193  patchFaceIDs_.setSize(fz.size(), -1);
194 
195  label nBlockedFaces = 0;
196  forAll(fz, localFacei)
197  {
198  const label facei = fz[localFacei];
199 
200  if (mesh_.isInternalFace(facei))
201  {
202  if (alphaf[facei] > alphaThreshold_)
203  {
204  blockedFaces[localFacei] = true;
205  }
206  }
207  else
208  {
209  label patchi = mesh_.boundaryMesh().whichPatch(facei);
210  label patchFacei = -1;
211 
212  const polyPatch& pp = mesh_.boundaryMesh()[patchi];
213  const scalarField& alphafp = alphaf.boundaryField()[patchi];
214  const auto* cpp = isA<coupledPolyPatch>(pp);
215 
216  if (cpp)
217  {
218  patchFacei = (cpp->owner() ? pp.whichFace(facei) : -1);
219  }
220  else if (!isA<emptyPolyPatch>(pp))
221  {
222  patchFacei = pp.whichFace(facei);
223  }
224 
225  if (patchFacei == -1)
226  {
227  patchi = -1;
228  }
229  else if (alphafp[patchFacei] > alphaThreshold_)
230  {
231  blockedFaces[localFacei] = true;
232  }
233 
234  patchIDs_[localFacei] = patchi;
235  patchFaceIDs_[localFacei] = patchFacei;
236  }
237  }
238 
239  DebugInFunction << "Number of blocked faces: " << nBlockedFaces << endl;
240 }
241 
242 
244 (
245  const scalar time,
246  const label regioni
247 )
248 {
249  DebugInFunction << "collectParticle: " << regioni << endl;
250 
251  const label particlei = regionToParticleMap_[regioni];
252  eulerianParticle p = particles_[particlei];
253 
254  if (p.faceIHit != -1 && nInjectorLocations_)
255  {
256  // Use coarse face index for tag output
257  label coarseFacei = fineToCoarseAddr_[p.faceIHit];
258  p.faceIHit = globalCoarseFaces_.toGlobal(coarseFacei);
259  }
260 
262 
263  const scalar pDiameter = cbrt(6.0*p.V/constant::mathematical::pi);
264 
265  if ((pDiameter > minDiameter_) && (pDiameter < maxDiameter_))
266  {
267  if (Pstream::master())
268  {
269  const scalar d = cbrt(6.0*p.V/constant::mathematical::pi);
270  const point position = p.VC/(p.V + ROOTVSMALL);
271  const vector U = p.VU/(p.V + ROOTVSMALL);
272  label tag = -1;
273  if (nInjectorLocations_)
274  {
275  tag = p.faceIHit;
276  }
277 
279  (
280  mesh_,
281  position,
282  tag,
283  time,
284  d,
285  U,
286  false // not looking to set cell owner etc.
287  );
288 
289  cloud_.addParticle(ip);
290 
291  collectedVolume_ += p.V;
292  }
293 
294  ++nCollectedParticles_;
295  }
296  else
297  {
298  // Discard particles over/under diameter threshold
299  ++nDiscardedParticles_;
300  discardedVolume_ += p.V;
301  }
302 }
303 
304 
306 (
307  const label nNewRegions,
308  const scalar time,
309  labelList& regionFaceIDs
310 )
311 {
313 
314  // Determine mapping between old and new regions so that we can
315  // accumulate particle info
316  labelList oldToNewRegion(particles_.size(), -1);
317  labelList newToNewRegion(identity(nNewRegions));
318 
319  forAll(regionFaceIDs, facei)
320  {
321  label newRegioni = regionFaceIDs[facei];
322  label oldRegioni = regions0_[facei];
323 
324  if (newRegioni != -1 && oldRegioni != -1)
325  {
326  // If old region has split into multiple regions we need to
327  // renumber new regions to maintain connectivity with old regions
328  newToNewRegion[newRegioni] =
329  max(newRegioni, oldToNewRegion[oldRegioni]);
330  oldToNewRegion[oldRegioni] = newRegioni;
331  }
332  }
333 
334  // Create map from new regions to slots in particles list
335  // - filter through new-to-new addressing to identify new particles
336  Pstream::listCombineGather(newToNewRegion, maxEqOp<label>());
337  Pstream::listCombineScatter(newToNewRegion);
338 
339  label nParticle = -1;
340  labelHashSet newRegions;
341  Map<label> newRegionToParticleMap;
342  forAll(newToNewRegion, newRegioni0)
343  {
344  label newRegioni = newToNewRegion[newRegioni0];
345  if (newRegions.insert(newRegioni))
346  {
347  ++nParticle;
348  }
349 
350  // New particle slot
351  newRegionToParticleMap.insert(newRegioni0, nParticle);
352  }
353 
354  // Accumulate old region data or create a new particle if there is no
355  // mapping from the old-to-new region
356  Pstream::listCombineGather(oldToNewRegion, maxEqOp<label>());
357  Pstream::listCombineScatter(oldToNewRegion);
358  List<eulerianParticle> newParticles(newRegionToParticleMap.size());
359  forAll(oldToNewRegion, oldRegioni)
360  {
361  label newRegioni = oldToNewRegion[oldRegioni];
362  if (newRegioni == -1)
363  {
364  // No mapping from old-to-new - collect new particle
365  DebugInfo
366  << "Collecting particle from oldRegion:" << oldRegioni
367  << endl;
368 
369  collectParticle(time, oldRegioni);
370  }
371  else
372  {
373  // Combine existing particle into new particle
374  label newParticlei = newRegionToParticleMap[newRegioni];
375  label oldParticlei = regionToParticleMap_[oldRegioni];
376 
377  DebugInfo
378  << "Combining newRegioni: " << newRegioni
379  << "(p:" << newParticlei << ") and "
380  << "oldRegioni: " << oldRegioni
381  << "(p:" << oldParticlei << ")"
382  << endl;
383 
384  newParticles[newParticlei] =
386  (
387  newParticles[newParticlei],
388  particles_[oldParticlei]
389  );
390  }
391  }
392 
393  // Reset the particles list and addressing for latest available info
394  particles_.transfer(newParticles);
395  regionToParticleMap_ = newRegionToParticleMap;
396 
397  // Reset the region IDs for the next integration step
398  // - these become the oldRegioni's
399  regions0_ = regionFaceIDs;
400 }
401 
402 
404 (
405  const surfaceScalarField& alphaf,
406  const surfaceScalarField& phi,
407  const labelList& regionFaceIDs,
408  const faceZone& fz
409 )
410 {
412 
413  const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_);
415 
416  const scalar deltaT = mesh_.time().deltaTValue();
417  const pointField& faceCentres = mesh_.faceCentres();
418 
419  forAll(regionFaceIDs, localFacei)
420  {
421  const label newRegioni = regionFaceIDs[localFacei];
422  if (newRegioni != -1)
423  {
424  const label particlei = regionToParticleMap_[newRegioni];
425  const label meshFacei = fz[localFacei];
426  eulerianParticle& p = particles_[particlei];
427 
428  if (p.faceIHit < 0)
429  {
430  // New particle - does not exist in particles_ list
431  p.faceIHit = localFacei;
432  p.V = 0;
433  p.VC = vector::zero;
434  p.VU = vector::zero;
435  }
436 
437  // Accumulate particle properties
438  scalar magPhii = mag(faceValue(phi, localFacei, meshFacei));
439  vector Ufi = faceValue(Uf, localFacei, meshFacei);
440  scalar dV = magPhii*deltaT;
441  p.V += dV;
442  p.VC += dV*faceCentres[meshFacei];
443  p.VU += dV*Ufi;
444  }
445  }
446 }
447 
448 
449 // * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
450 
452 (
453  const word& name,
454  const Time& runTime,
455  const dictionary& dict
456 )
457 :
460  cloud_(mesh_, "eulerianParticleCloud"),
461  faceZoneName_(word::null),
462  zoneID_(-1),
463  patchIDs_(),
464  patchFaceIDs_(),
465  alphaName_("alpha"),
466  alphaThreshold_(0.1),
467  UName_("U"),
468  rhoName_("rho"),
469  phiName_("phi"),
470  nInjectorLocations_(0),
471  fineToCoarseAddr_(),
472  globalCoarseFaces_(),
473  regions0_(),
474  particles_(),
475  regionToParticleMap_(),
476  minDiameter_(ROOTVSMALL),
477  maxDiameter_(GREAT),
478  nCollectedParticles_(getProperty<label>("nCollectedParticles", 0)),
479  collectedVolume_(getProperty<scalar>("collectedVolume", 0)),
480  nDiscardedParticles_(getProperty<label>("nDiscardedParticles", 0)),
481  discardedVolume_(getProperty<scalar>("discardedVolume", 0))
482 {
483  if (mesh_.nSolutionD() != 3)
484  {
486  << name << " function object only applicable to 3-D cases"
487  << exit(FatalError);
488  }
489 
490  read(dict);
491 }
492 
493 
494 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
495 
497 (
498  const dictionary& dict
499 )
500 {
502 
504  {
505  dict.readEntry("faceZone", faceZoneName_);
506  dict.readEntry("alpha", alphaName_);
507 
508  dict.readIfPresent("alphaThreshold", alphaThreshold_);
509  dict.readIfPresent("U", UName_);
510  dict.readIfPresent("rho", rhoName_);
511  dict.readIfPresent("phi", phiName_);
512  dict.readIfPresent("nLocations", nInjectorLocations_);
513  dict.readIfPresent("minDiameter", minDiameter_);
514  dict.readIfPresent("maxDiameter", maxDiameter_);
515 
516  checkFaceZone();
517 
518  if (nInjectorLocations_)
519  {
520  initialiseBins();
521  }
522 
523  return true;
524  }
525 
526  return false;
527 }
528 
529 
531 {
533 
534  Log << type() << " " << name() << " output:" << nl;
535 
536  const volScalarField& alpha =
537  mesh_.lookupObject<volScalarField>(alphaName_);
538 
539  const surfaceScalarField alphaf
540  (
541  typeName + ":alphaf",
543  );
544 
545  const faceZone& fz = mesh_.faceZones()[zoneID_];
547  (
548  IndirectList<face>(mesh_.faces(), fz),
549  mesh_.points()
550  );
551 
552  // Set the blocked faces, i.e. where alpha > alpha threshold value
553  boolList blockedFaces(fz.size(), false);
554  setBlockedFaces(alphaf, fz, blockedFaces);
555 
556  // Split the faceZone according to the blockedFaces
557  // - Returns a list of (disconnected) region index per face zone face
558  regionSplit2D regionFaceIDs(mesh_, patch, blockedFaces);
559 
560  // Global number of regions
561  const label nRegionsNew = regionFaceIDs.nRegions();
562 
563  // Calculate the addressing between the old and new region information
564  // Also collects particles that have traversed the faceZone
565  // - Note: may also update regionFaceIDs
566  calculateAddressing
567  (
568  nRegionsNew,
569  mesh_.time().value(),
570  regionFaceIDs
571  );
572 
573  // Process latest region information
574  tmp<surfaceScalarField> tphi = phiU();
575  accumulateParticleInfo(alphaf, tphi(), regionFaceIDs, fz);
576 
577  Log << " Collected particles : " << nCollectedParticles_ << nl
578  << " Collected volume : " << collectedVolume_ << nl
579  << " Discarded particles : " << nDiscardedParticles_ << nl
580  << " Discarded volume : " << discardedVolume_ << nl
581  << " Particles in progress : " << particles_.size() << nl
582  << endl;
583 
584  return true;
585 }
586 
587 
589 {
591 
592  cloud_.write();
593 
594  setProperty("nCollectedParticles", nCollectedParticles_);
595  setProperty("collectedVolume", collectedVolume_);
596  setProperty("nDiscardedParticles", nDiscardedParticles_);
597  setProperty("discardedVolume", discardedVolume_);
598 
599  return true;
600 }
601 
602 
603 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
volFields.H
runTime
engineTime & runTime
Definition: createEngineTime.H:13
mathematicalConstants.H
p
volScalarField & p
Definition: createFieldRefs.H:8
Log
#define Log
Definition: PDRblock.C:35
Foam::functionObjects::extractEulerianParticles::extractEulerianParticles
extractEulerianParticles(const word &name, const Time &runTime, const dictionary &dict)
Construct from components.
Definition: extractEulerianParticles.C:452
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::functionObjects::extractEulerianParticles::nInjectorLocations_
label nInjectorLocations_
Number of sample locations to generate.
Definition: extractEulerianParticles.H:280
Foam::labelMax
constexpr label labelMax
Definition: label.H:61
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::returnReduce
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Definition: PstreamReduceOps.H:94
Foam::functionObjects::extractEulerianParticles::read
virtual bool read(const dictionary &)
Read the field min/max data.
Definition: extractEulerianParticles.C:497
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::regionSplit2D
Splits a patch into regions based on a mask field. Result is a globally consistent label list of regi...
Definition: regionSplit2D.H:59
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
binned.H
Foam::functionObjects::extractEulerianParticles::initialiseBins
virtual void initialiseBins()
Initialise the particle collection bins.
Definition: extractEulerianParticles.C:96
Foam::read
bool read(const char *buf, int32_t &val)
Same as readInt32.
Definition: int32.H:108
Uf
autoPtr< surfaceVectorField > Uf
Definition: createUfIfPresent.H:33
Foam::pairPatchAgglomeration
Primitive patch pair agglomerate method.
Definition: pairPatchAgglomeration.H:54
Foam::Map< label >
Foam::UPstream::master
static bool master(const label communicator=worldComm)
Am I the master process.
Definition: UPstream.H:457
Foam::functionObjects::eulerianParticle
Definition: eulerianParticle.H:71
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
surfaceFields.H
Foam::surfaceFields.
Foam::Pout
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Foam::HashSet< label, Hash< label > >
Foam::functionObjects::fvMeshFunctionObject
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Definition: fvMeshFunctionObject.H:64
rho
rho
Definition: readInitialConditions.H:88
Foam::sumOp
Definition: ops.H:213
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:53
Foam::functionObjects::writeFile::read
virtual bool read(const dictionary &dict)
Read.
Definition: writeFile.C:213
Foam::reduce
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
Definition: PstreamReduceOps.H:51
Foam::functionObjects::extractEulerianParticles::collectParticle
virtual void collectParticle(const scalar time, const label regioni)
Collect particles that have passed through the faceZone.
Definition: extractEulerianParticles.C:244
coupledPolyPatch.H
Foam::Field< scalar >
Foam::polyPatch::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: polyPatch.C:315
Foam::functionObjects::extractEulerianParticles::checkFaceZone
virtual void checkFaceZone()
Check that the faceZone is valid.
Definition: extractEulerianParticles.C:58
Foam::faceZone
A subset of mesh faces organised as a primitive patch.
Definition: faceZone.H:64
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
DebugInFunction
#define DebugInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:388
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::List::setSize
void setSize(const label n)
Alias for resize()
Definition: List.H:222
Foam::functionObjects::extractEulerianParticles::calculateAddressing
virtual void calculateAddressing(const label nRegionsNew, const scalar time, labelList &regionFaceIDs)
Definition: extractEulerianParticles.C:306
Foam::IndirectList
A List with indirect addressing.
Definition: IndirectList.H:56
Foam::polyMesh::faceZones
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
Definition: polyMesh.H:486
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
Foam::functionObjects::extractEulerianParticles::regions0_
labelList regions0_
Region indices in faceZone faces from last iteration.
Definition: extractEulerianParticles.H:292
Foam::injectedParticle
Primarily stores particle properties so that it can be injected at a later time. Note that this store...
Definition: injectedParticle.H:63
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::functionObjects::extractEulerianParticles::write
virtual bool write()
Write.
Definition: extractEulerianParticles.C:588
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::functionObjects::extractEulerianParticles::phiU
virtual tmp< surfaceScalarField > phiU() const
Return the volumetric flux.
Definition: extractEulerianParticles.C:160
Foam::functionObjects::regionFunctionObject::read
virtual bool read(const dictionary &dict)
Read optional controls.
Definition: regionFunctionObject.C:173
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::Ostream::write
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::dimMass
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:51
Foam::fvc::interpolate
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
Foam::globalIndex
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:68
Foam::ZoneMesh::findZoneID
label findZoneID(const word &zoneName) const
Find zone index by name, return -1 if not found.
Definition: ZoneMesh.C:519
Foam::maxEqOp
Definition: ops.H:80
emptyPolyPatch.H
Foam::ZoneMesh::names
wordList names() const
A list of the zone names.
Definition: ZoneMesh.C:305
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::Pstream::listCombineGather
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
Definition: combineGatherScatter.C:290
U
U
Definition: pEqn.H:72
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
DebugInfo
#define DebugInfo
Report an information message using Foam::Info.
Definition: messageStream.H:382
Foam::polyPatch::whichFace
label whichFace(const label l) const
Return label of face in patch from global face label.
Definition: polyPatch.H:448
Foam::constant::mathematical::pi
constexpr scalar pi(M_PI)
Foam::nl
constexpr char nl
Definition: Ostream.H:404
pairPatchAgglomeration.H
Foam::regionSplit2D::nRegions
label nRegions() const noexcept
Return the global number of regions.
Definition: regionSplit2D.H:99
Foam::functionObjects::addToRunTimeSelectionTable
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::pairPatchAgglomeration::agglomerate
void agglomerate()
Agglomerate patch.
Definition: pairPatchAgglomeration.C:394
Foam::functionObject::type
virtual const word & type() const =0
Runtime type information.
Foam::Vector< scalar >
extractEulerianParticles.H
Foam::UPstream::parRun
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:433
Foam::List< bool >
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::functionObjects::fvMeshFunctionObject::mesh_
const fvMesh & mesh_
Reference to the fvMesh.
Definition: fvMeshFunctionObject.H:73
Foam::identity
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
Definition: labelList.C:38
Foam::HashSet::insert
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Definition: HashSet.H:191
Foam::functionObjects::defineTypeNameAndDebug
defineTypeNameAndDebug(ObukhovLength, 0)
Foam::word::null
static const word null
An empty word.
Definition: word.H:80
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::VectorSpace< Vector< scalar >, scalar, 3 >::zero
static const Vector< scalar > zero
Definition: VectorSpace.H:115
regionSplit2D.H
Foam::functionObjects::writeFile
Base class for writing single files from the function objects.
Definition: writeFile.H:119
Foam::functionObjects::extractEulerianParticles::faceZoneName_
word faceZoneName_
Name of faceZone to sample.
Definition: extractEulerianParticles.H:247
Foam::functionObjects::extractEulerianParticles::setBlockedFaces
virtual void setBlockedFaces(const surfaceScalarField &alphaf, const faceZone &fz, boolList &blockedFaces)
Set the blocked faces, i.e. where alpha > alpha threshold value.
Definition: extractEulerianParticles.C:182
Foam::Pstream::listCombineScatter
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
Definition: combineGatherScatter.C:432
Foam::cbrt
dimensionedScalar cbrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:155
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >
Foam::functionObjects::extractEulerianParticles::zoneID_
label zoneID_
Index of the faceZone.
Definition: extractEulerianParticles.H:250
Foam::functionObjects::extractEulerianParticles::execute
virtual bool execute()
Execute.
Definition: extractEulerianParticles.C:530
Foam::functionObjects::extractEulerianParticles::accumulateParticleInfo
virtual void accumulateParticleInfo(const surfaceScalarField &alphaf, const surfaceScalarField &phi, const labelList &regionFaceIDs, const faceZone &fz)
Process latest region information.
Definition: extractEulerianParticles.C:404
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:79
Foam::functionObjects::sumParticleOp
Definition: eulerianParticleTemplates.C:36