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 
215  if (isA<coupledPolyPatch>(pp))
216  {
217  const coupledPolyPatch& cpp =
218  refCast<const coupledPolyPatch>(pp);
219 
220  if (cpp.owner())
221  {
222  patchFacei = cpp.whichFace(facei);
223  }
224  }
225  else if (!isA<emptyPolyPatch>(pp))
226  {
227  patchFacei = pp.whichFace(facei);
228  }
229 
230  if (patchFacei == -1)
231  {
232  patchi = -1;
233  }
234  else if (alphafp[patchFacei] > alphaThreshold_)
235  {
236  blockedFaces[localFacei] = true;
237  }
238 
239  patchIDs_[localFacei] = patchi;
240  patchFaceIDs_[localFacei] = patchFacei;
241  }
242  }
243 
244  DebugInFunction << "Number of blocked faces: " << nBlockedFaces << endl;
245 }
246 
247 
249 (
250  const scalar time,
251  const label regioni
252 )
253 {
254  DebugInFunction << "collectParticle: " << regioni << endl;
255 
256  const label particlei = regionToParticleMap_[regioni];
257  eulerianParticle p = particles_[particlei];
258 
259  if (p.faceIHit != -1 && nInjectorLocations_)
260  {
261  // Use coarse face index for tag output
262  label coarseFacei = fineToCoarseAddr_[p.faceIHit];
263  p.faceIHit = globalCoarseFaces_.toGlobal(coarseFacei);
264  }
265 
267 
268  const scalar pDiameter = cbrt(6.0*p.V/constant::mathematical::pi);
269 
270  if ((pDiameter > minDiameter_) && (pDiameter < maxDiameter_))
271  {
272  if (Pstream::master())
273  {
274  const scalar d = cbrt(6.0*p.V/constant::mathematical::pi);
275  const point position = p.VC/(p.V + ROOTVSMALL);
276  const vector U = p.VU/(p.V + ROOTVSMALL);
277  label tag = -1;
278  if (nInjectorLocations_)
279  {
280  tag = p.faceIHit;
281  }
282 
284  (
285  mesh_,
286  position,
287  tag,
288  time,
289  d,
290  U,
291  false // not looking to set cell owner etc.
292  );
293 
294  cloud_.addParticle(ip);
295 
296  collectedVolume_ += p.V;
297  }
298 
299  ++nCollectedParticles_;
300  }
301  else
302  {
303  // Discard particles over/under diameter threshold
304  ++nDiscardedParticles_;
305  discardedVolume_ += p.V;
306  }
307 }
308 
309 
311 (
312  const label nNewRegions,
313  const scalar time,
314  labelList& regionFaceIDs
315 )
316 {
318 
319  // Determine mapping between old and new regions so that we can
320  // accumulate particle info
321  labelList oldToNewRegion(particles_.size(), -1);
322  labelList newToNewRegion(identity(nNewRegions));
323 
324  forAll(regionFaceIDs, facei)
325  {
326  label newRegioni = regionFaceIDs[facei];
327  label oldRegioni = regions0_[facei];
328 
329  if (newRegioni != -1 && oldRegioni != -1)
330  {
331  // If old region has split into multiple regions we need to
332  // renumber new regions to maintain connectivity with old regions
333  newToNewRegion[newRegioni] =
334  max(newRegioni, oldToNewRegion[oldRegioni]);
335  oldToNewRegion[oldRegioni] = newRegioni;
336  }
337  }
338 
339  // Create map from new regions to slots in particles list
340  // - filter through new-to-new addressing to identify new particles
341  Pstream::listCombineGather(newToNewRegion, maxEqOp<label>());
342  Pstream::listCombineScatter(newToNewRegion);
343 
344  label nParticle = -1;
345  labelHashSet newRegions;
346  Map<label> newRegionToParticleMap;
347  forAll(newToNewRegion, newRegioni0)
348  {
349  label newRegioni = newToNewRegion[newRegioni0];
350  if (newRegions.insert(newRegioni))
351  {
352  ++nParticle;
353  }
354 
355  // New particle slot
356  newRegionToParticleMap.insert(newRegioni0, nParticle);
357  }
358 
359  // Accumulate old region data or create a new particle if there is no
360  // mapping from the old-to-new region
361  Pstream::listCombineGather(oldToNewRegion, maxEqOp<label>());
362  Pstream::listCombineScatter(oldToNewRegion);
363  List<eulerianParticle> newParticles(newRegionToParticleMap.size());
364  forAll(oldToNewRegion, oldRegioni)
365  {
366  label newRegioni = oldToNewRegion[oldRegioni];
367  if (newRegioni == -1)
368  {
369  // No mapping from old-to-new - collect new particle
370  DebugInfo
371  << "Collecting particle from oldRegion:" << oldRegioni
372  << endl;
373 
374  collectParticle(time, oldRegioni);
375  }
376  else
377  {
378  // Combine existing particle into new particle
379  label newParticlei = newRegionToParticleMap[newRegioni];
380  label oldParticlei = regionToParticleMap_[oldRegioni];
381 
382  DebugInfo
383  << "Combining newRegioni: " << newRegioni
384  << "(p:" << newParticlei << ") and "
385  << "oldRegioni: " << oldRegioni
386  << "(p:" << oldParticlei << ")"
387  << endl;
388 
389  newParticles[newParticlei] =
391  (
392  newParticles[newParticlei],
393  particles_[oldParticlei]
394  );
395  }
396  }
397 
398  // Reset the particles list and addressing for latest available info
399  particles_.transfer(newParticles);
400  regionToParticleMap_ = newRegionToParticleMap;
401 
402  // Reset the region IDs for the next integration step
403  // - these become the oldRegioni's
404  regions0_ = regionFaceIDs;
405 }
406 
407 
409 (
410  const surfaceScalarField& alphaf,
411  const surfaceScalarField& phi,
412  const labelList& regionFaceIDs,
413  const faceZone& fz
414 )
415 {
417 
418  const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_);
420 
421  const scalar deltaT = mesh_.time().deltaTValue();
422  const pointField& faceCentres = mesh_.faceCentres();
423 
424  forAll(regionFaceIDs, localFacei)
425  {
426  const label newRegioni = regionFaceIDs[localFacei];
427  if (newRegioni != -1)
428  {
429  const label particlei = regionToParticleMap_[newRegioni];
430  const label meshFacei = fz[localFacei];
431  eulerianParticle& p = particles_[particlei];
432 
433  if (p.faceIHit < 0)
434  {
435  // New particle - does not exist in particles_ list
436  p.faceIHit = localFacei;
437  p.V = 0;
438  p.VC = vector::zero;
439  p.VU = vector::zero;
440  }
441 
442  // Accumulate particle properties
443  scalar magPhii = mag(faceValue(phi, localFacei, meshFacei));
444  vector Ufi = faceValue(Uf, localFacei, meshFacei);
445  scalar dV = magPhii*deltaT;
446  p.V += dV;
447  p.VC += dV*faceCentres[meshFacei];
448  p.VU += dV*Ufi;
449  }
450  }
451 }
452 
453 
454 // * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
455 
457 (
458  const word& name,
459  const Time& runTime,
460  const dictionary& dict
461 )
462 :
465  cloud_(mesh_, "eulerianParticleCloud"),
466  faceZoneName_(word::null),
467  zoneID_(-1),
468  patchIDs_(),
469  patchFaceIDs_(),
470  alphaName_("alpha"),
471  alphaThreshold_(0.1),
472  UName_("U"),
473  rhoName_("rho"),
474  phiName_("phi"),
475  nInjectorLocations_(0),
476  fineToCoarseAddr_(),
477  globalCoarseFaces_(),
478  regions0_(),
479  particles_(),
480  regionToParticleMap_(),
481  minDiameter_(ROOTVSMALL),
482  maxDiameter_(GREAT),
483  nCollectedParticles_(getProperty<label>("nCollectedParticles", 0)),
484  collectedVolume_(getProperty<scalar>("collectedVolume", 0)),
485  nDiscardedParticles_(getProperty<label>("nDiscardedParticles", 0)),
486  discardedVolume_(getProperty<scalar>("discardedVolume", 0))
487 {
488  if (mesh_.nSolutionD() != 3)
489  {
491  << name << " function object only applicable to 3-D cases"
492  << exit(FatalError);
493  }
494 
495  read(dict);
496 }
497 
498 
499 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
500 
502 (
503  const dictionary& dict
504 )
505 {
507 
509  {
510  dict.readEntry("faceZone", faceZoneName_);
511  dict.readEntry("alpha", alphaName_);
512 
513  dict.readIfPresent("alphaThreshold", alphaThreshold_);
514  dict.readIfPresent("U", UName_);
515  dict.readIfPresent("rho", rhoName_);
516  dict.readIfPresent("phi", phiName_);
517  dict.readIfPresent("nLocations", nInjectorLocations_);
518  dict.readIfPresent("minDiameter", minDiameter_);
519  dict.readIfPresent("maxDiameter", maxDiameter_);
520 
521  checkFaceZone();
522 
523  if (nInjectorLocations_)
524  {
525  initialiseBins();
526  }
527 
528  return true;
529  }
530 
531  return false;
532 }
533 
534 
536 {
538 
539  Log << type() << " " << name() << " output:" << nl;
540 
541  const volScalarField& alpha =
542  mesh_.lookupObject<volScalarField>(alphaName_);
543 
544  const surfaceScalarField alphaf
545  (
546  typeName + ":alphaf",
548  );
549 
550  const faceZone& fz = mesh_.faceZones()[zoneID_];
552  (
553  IndirectList<face>(mesh_.faces(), fz),
554  mesh_.points()
555  );
556 
557  // Set the blocked faces, i.e. where alpha > alpha threshold value
558  boolList blockedFaces(fz.size(), false);
559  setBlockedFaces(alphaf, fz, blockedFaces);
560 
561  // Split the faceZone according to the blockedFaces
562  // - Returns a list of (disconnected) region index per face zone face
563  regionSplit2D regionFaceIDs(mesh_, patch, blockedFaces);
564 
565  // Global number of regions
566  const label nRegionsNew = regionFaceIDs.nRegions();
567 
568  // Calculate the addressing between the old and new region information
569  // Also collects particles that have traversed the faceZone
570  // - Note: may also update regionFaceIDs
571  calculateAddressing
572  (
573  nRegionsNew,
574  mesh_.time().value(),
575  regionFaceIDs
576  );
577 
578  // Process latest region information
579  tmp<surfaceScalarField> tphi = phiU();
580  accumulateParticleInfo(alphaf, tphi(), regionFaceIDs, fz);
581 
582  Log << " Collected particles : " << nCollectedParticles_ << nl
583  << " Collected volume : " << collectedVolume_ << nl
584  << " Discarded particles : " << nDiscardedParticles_ << nl
585  << " Discarded volume : " << discardedVolume_ << nl
586  << " Particles in progress : " << particles_.size() << nl
587  << endl;
588 
589  return true;
590 }
591 
592 
594 {
596 
597  cloud_.write();
598 
599  setProperty("nCollectedParticles", nCollectedParticles_);
600  setProperty("collectedVolume", collectedVolume_);
601  setProperty("nDiscardedParticles", nDiscardedParticles_);
602  setProperty("discardedVolume", discardedVolume_);
603 
604  return true;
605 }
606 
607 
608 // ************************************************************************* //
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:457
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:62
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:502
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
Foam::UPstream::parRun
static bool & parRun()
Test if this a parallel run, or allow modify access.
Definition: UPstream.H:434
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:458
Foam::functionObjects::eulerianParticle
Definition: eulerianParticle.H:71
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
surfaceFields.H
Foam::surfaceFields.
Foam::coupledPolyPatch
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
Definition: coupledPolyPatch.H:53
Foam::Pout
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Foam::coupledPolyPatch::owner
virtual bool owner() const =0
Does this side own the patch ?
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::polyMesh::faceZones
const faceZoneMesh & faceZones() const
Return face zone mesh.
Definition: polyMesh.H:486
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:54
Foam::functionObjects::writeFile::read
virtual bool read(const dictionary &dict)
Read.
Definition: writeFile.C:214
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:249
coupledPolyPatch.H
Foam::Field< scalar >
Foam::polyPatch::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: polyPatch.C:307
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:65
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
DebugInFunction
#define DebugInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:365
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::functionObjects::extractEulerianParticles::calculateAddressing
virtual void calculateAddressing(const label nRegionsNew, const scalar time, labelList &regionFaceIDs)
Definition: extractEulerianParticles.C:311
Foam::IndirectList
A List with indirect addressing.
Definition: IndirectList.H:56
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:593
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:121
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:52
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:484
Foam::maxEqOp
Definition: ops.H:80
emptyPolyPatch.H
Foam::ZoneMesh::names
wordList names() const
A list of the zone names.
Definition: ZoneMesh.C:340
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:381
DebugInfo
#define DebugInfo
Report an information message using Foam::Info.
Definition: messageStream.H:359
Foam::polyPatch::whichFace
label whichFace(const label l) const
Return label of face in patch from global face label.
Definition: polyPatch.H:400
Foam::constant::mathematical::pi
constexpr scalar pi(M_PI)
Foam::nl
constexpr char nl
Definition: Ostream.H:385
pairPatchAgglomeration.H
Foam::regionSplit2D::nRegions
label nRegions() const noexcept
Return the global number of regions.
Definition: regionSplit2D.H:99
Foam::functionObject::name
const word & name() const
Return the name of this functionObject.
Definition: functionObject.C:131
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::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:181
Foam::functionObjects::defineTypeNameAndDebug
defineTypeNameAndDebug(ObukhovLength, 0)
Foam::word::null
static const word null
An empty word.
Definition: word.H:77
Foam::VectorSpace< Vector< Cmpt >, Cmpt, 3 >::zero
static const Vector< Cmpt > 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::List::setSize
void setSize(const label newSize)
Alias for resize(const label)
Definition: ListI.H:146
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:535
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:409
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:85
Foam::functionObjects::sumParticleOp
Definition: eulerianParticleTemplates.C:36