turbulentDigitalFilterInletFvPatchVectorField.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) 2019 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 "volFields.H"
30 #include "mathematicalConstants.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 const Foam::Enum
36 <
37  Foam::turbulentDigitalFilterInletFvPatchVectorField::variantType
38 >
39 Foam::turbulentDigitalFilterInletFvPatchVectorField::variantNames
40 ({
41  { variantType::DIGITAL_FILTER, "digitalFilter" },
42  { variantType::DIGITAL_FILTER, "DFM" },
43  { variantType::FORWARD_STEPWISE, "forwardStepwise" },
44  { variantType::FORWARD_STEPWISE, "reducedDigitalFilter" },
45  { variantType::FORWARD_STEPWISE, "FSM" }
46 });
47 
48 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
49 
51 Foam::turbulentDigitalFilterInletFvPatchVectorField::patchMapper() const
52 {
53  // Initialise interpolation (2D planar interpolation by triangulation)
54  if (mapperPtr_.empty())
55  {
56  // Reread values and interpolate
57  fileName samplePointsFile
58  (
59  this->db().time().path()
60  /this->db().time().caseConstant()
61  /"boundaryData"
62  /this->patch().name()
63  /"points"
64  );
65 
66  pointField samplePoints((IFstream(samplePointsFile)()));
67 
68  // tbd: run-time selection
69  bool nearestOnly =
70  (
71  !mapMethod_.empty()
72  && mapMethod_ != "planarInterpolation"
73  );
74 
75  // Allocate the interpolator
76  mapperPtr_.reset
77  (
78  new pointToPointPlanarInterpolation
79  (
80  samplePoints,
81  this->patch().patch().faceCentres(),
82  perturb_,
83  nearestOnly
84  )
85  );
86  }
87 
88  return *mapperPtr_;
89 }
90 
91 
93 Foam::turbulentDigitalFilterInletFvPatchVectorField::patchIndexPairs()
94 {
95  // Get patch normal direction into the domain
96  const vector nf(computePatchNormal());
97 
98  // Find the second local coordinate direction
99  direction minCmpt = -1;
100  scalar minMag = VGREAT;
101  for (direction cmpt = 0; cmpt < pTraits<vector>::nComponents; ++cmpt)
102  {
103  scalar s = mag(nf[cmpt]);
104  if (s < minMag)
105  {
106  minMag = s;
107  minCmpt = cmpt;
108  }
109  }
110 
111  // Create the second local coordinate direction
112  vector e2(Zero);
113  e2[minCmpt] = 1.0;
114 
115  // Remove normal component
116  e2 -= (nf&e2)*nf;
117 
118  // Create the local coordinate system
119  coordSystem::cartesian cs
120  (
121  Zero, // origin
122  nf, // normal
123  e2 // 0-axis
124  );
125 
126  // Convert patch points into local coordinate system
127  const pointField localPos
128  (
129  cs.localPosition
130  (
131  pointField
132  (
133  patch().patch().points(),
134  patch().patch().meshPoints()
135  )
136  )
137  );
138 
139  const boundBox bb(localPos);
140 
141  // Normalise to (i, j) coordinates
142  const Vector2D<label> n(planeDivisions_.first(), planeDivisions_.second());
143  invDelta_[0] = n[0]/bb.span()[0];
144  invDelta_[1] = n[1]/bb.span()[1];
145  const point localMinPt(bb.min());
146 
147  // Compute virtual-actual patch index pairs
148  List<Pair<label>> indexPairs(this->size(), Pair<label>(Zero, Zero));
149 
150  // Virtual turbulence plane indices
151  label j = 0;
152  label k = 0;
153 
154  forAll(*this, facei)
155  {
156  const scalar& centre0 = localPos[facei][0];
157  const scalar& centre1 = localPos[facei][1];
158 
159  j = label((centre0 - localMinPt[0])*invDelta_[0]);
160  k = label((centre1 - localMinPt[1])*invDelta_[1]);
161 
162  indexPairs[facei] = Pair<label>(facei, k*n[0] + j);
163  }
164 
165  return indexPairs;
166 }
167 
168 
169 void Foam::turbulentDigitalFilterInletFvPatchVectorField::
170 checkRTensorRealisable() const
171 {
172  const vectorField& faceCentres = this->patch().patch().faceCentres();
173 
174  forAll(R_, facei)
175  {
176  if (R_[facei].xx() <= 0)
177  {
179  << "Reynolds stress tensor component Rxx cannot be negative"
180  "or zero, where Rxx = " << R_[facei].xx() << " at the face "
181  "centre = " << faceCentres[facei] << exit(FatalError);
182  }
183 
184  if (R_[facei].yy() < 0 || R_[facei].zz() < 0)
185  {
187  << "Reynolds stress tensor components Ryy or Rzz cannot be"
188  << "negative where Ryy = " << R_[facei].yy() << ", and Rzz = "
189  << R_[facei].zz() << " at the face centre = "
190  << faceCentres[facei] << exit(FatalError);
191  }
192 
193  scalar term0 = R_[facei].xx()*R_[facei].yy() - sqr(R_[facei].xy());
194 
195  if (term0 <= 0)
196  {
198  << "Reynolds stress tensor component group, Rxx*Ryy - Rxy^2"
199  << "cannot be negative or zero at the face centre = "
200  << faceCentres[facei] << exit(FatalError);
201  }
202 
203  scalar term1 = R_[facei].zz() - sqr(R_[facei].xz())/R_[facei].xx();
204  scalar term2 =
205  sqr(R_[facei].yz() - R_[facei].xy()*R_[facei].xz()
206  /(R_[facei].xx()*term0));
207  scalar term3 = term1 - term2;
208 
209  if (term3 < 0)
210  {
212  << "Reynolds stress tensor component group,"
213  << "Rzz - Rxz^2/Rxx - (Ryz - Rxy*Rxz/(Rxx*(Rxx*Ryy - Rxy^2)))^2"
214  << "cannot be negative at the face centre = "
215  << faceCentres[facei] << exit(FatalError);
216  }
217  }
218 
219  #ifdef FULLDEBUG
220  Info<< "Ends: checkRTensorRealisable()."
221  << " Reynolds tensor (on patch) is consistent." << nl;
222  #endif
223 }
224 
225 
226 Foam::symmTensorField Foam::turbulentDigitalFilterInletFvPatchVectorField::
227 computeLundWuSquires() const
228 {
229  checkRTensorRealisable();
230 
231  symmTensorField LundWuSquires(symmTensorField(R_.size()));
232 
233  forAll(R_, facei)
234  {
235  const symmTensor& R = R_[facei];
236  symmTensor& lws = LundWuSquires[facei];
237 
238  // (Klein et al., 2003, Eq. 5)
239  lws.xx() = Foam::sqrt(R.xx());
240  lws.xy() = R.xy()/lws.xx();
241  lws.xz() = R.xz()/lws.xx();
242  lws.yy() = Foam::sqrt(R.yy() - sqr(lws.xy()));
243  lws.yz() = (R.yz() - lws.xy()*lws.xz())/lws.yy();
244  lws.zz() = Foam::sqrt(R.zz() - sqr(lws.xz()) - sqr(lws.yz()));
245  }
246 
247  #ifdef FULLDEBUG
248  Info<< "Ends: computeLundWuSquires()." << nl;
249  #endif
250 
251  return LundWuSquires;
252 }
253 
254 
255 Foam::vector Foam::turbulentDigitalFilterInletFvPatchVectorField::
256 computePatchNormal() const
257 {
258  vector patchNormal(-gAverage(patch().nf()));
259  return patchNormal.normalise();
260 }
261 
262 
263 Foam::scalar Foam::turbulentDigitalFilterInletFvPatchVectorField::
264 computeInitialFlowRate() const
265 {
266  const vector patchNormal(computePatchNormal());
267  return gSum((UMean_ & patchNormal)*patch().magSf());
268 }
269 
270 
271 void Foam::turbulentDigitalFilterInletFvPatchVectorField::convertToTimeScale
272 (
273  tensor& L
274 ) const
275 {
276  if (isTaylorHypot_)
277  {
278  forAll(L.x(), i)
279  {
280  L[i] /= patchNormalSpeed_;
281  }
282 
283  #ifdef FULLDEBUG
284  Info<< "Ends: convertToTimeScale()."
285  << "Streamwise integral length scales are converted to time scales via"
286  << "Taylor's frozen turbulence hypothesis" << nl;
287  #endif
288  }
289 }
290 
291 
292 Foam::tensor Foam::turbulentDigitalFilterInletFvPatchVectorField::
293 convertScalesToGridUnits
294 (
295  const tensor& L
296 ) const
297 {
298  tensor Ls(L);
299  convertToTimeScale(Ls);
300  const scalar invDeltaT = 1.0/db().time().deltaTValue();
301 
302  Ls.row(0, Ls.x()*invDeltaT);
303  Ls.row(1, Ls.y()*invDelta_[0]);
304  Ls.row(2, Ls.z()*invDelta_[1]);
305 
306  #ifdef FULLDEBUG
307  Info<< "Ends: convertScalesToGridUnits()."
308  << "Units of input length scales are converted from metres to"
309  << "virtual-patch cell size/time-step" << nl;
310  #endif
311 
312  return Ls;
313 }
314 
315 
316 Foam::List<Foam::label> Foam::turbulentDigitalFilterInletFvPatchVectorField::
317 initLenRandomBox() const
318 {
319  label initValue = 0;
320  label rangeModifier = 0;
321 
322  if (variant_ == variantType::FORWARD_STEPWISE)
323  {
324  // Initialise with 1 since x-dir possess 1 node with this variant
325  initValue = pTraits<label>::nComponents;
326  rangeModifier = pTraits<vector>::nComponents;
327  }
328 
329  List<label> lenRandomBox(pTraits<tensor>::nComponents, initValue);
330  Vector<label> lenGrid
331  (
332  pTraits<label>::nComponents,
333  planeDivisions_.first(),
334  planeDivisions_.second()
335  );
336 
337  // Initialise: Main convenience factor, lenRandomBox_
338  for
339  (
340  const label& i
341  : labelRange(rangeModifier, pTraits<tensor>::nComponents - rangeModifier)
342  )
343  {
344  // Slicing index
345  const label sliceI = label(i/pTraits<vector>::nComponents);
346 
347  // Refer to 'computeFilterCoeffs()'
348  const label n = ceil(L_[i]);
349  const label twiceN = 4*n;
350 
351  // Initialise: Random-number set sizes
352  lenRandomBox[i] = lenGrid[sliceI] + twiceN;
353  }
354 
355  return lenRandomBox;
356 }
357 
358 
359 Foam::List<Foam::label> Foam::turbulentDigitalFilterInletFvPatchVectorField::
360 initBoxFactors2D() const
361 {
362  List<label> boxFactors2D(pTraits<vector>::nComponents);
363 
364  for (direction dir = 0; dir < pTraits<vector>::nComponents; ++dir)
365  {
366  boxFactors2D[dir] =
367  lenRandomBox_[pTraits<vector>::nComponents + dir]
368  *lenRandomBox_[pTraits<symmTensor>::nComponents + dir];
369  }
370 
371  return boxFactors2D;
372 }
373 
374 
375 Foam::List<Foam::label> Foam::turbulentDigitalFilterInletFvPatchVectorField::
376 initBoxFactors3D() const
377 {
378  List<label> boxFactors3D(pTraits<vector>::nComponents);
379 
380  for (direction dir = 0; dir < pTraits<vector>::nComponents; ++dir)
381  {
382  boxFactors3D[dir] = randomBoxFactors2D_[dir]*lenRandomBox_[dir];
383  }
384 
385  return boxFactors3D;
386 }
387 
388 
389 Foam::List<Foam::label> Foam::turbulentDigitalFilterInletFvPatchVectorField::
390 initBoxPlaneFactors() const
391 {
392  List<label> planeFactors(pTraits<vector>::nComponents);
393 
394  for (direction dir = 0; dir < pTraits<vector>::nComponents; ++dir)
395  {
396  planeFactors[dir] =
397  randomBoxFactors2D_[dir]*(lenRandomBox_[dir] - pTraits<label>::one);
398  }
399 
400  return planeFactors;
401 }
402 
403 
405 Foam::turbulentDigitalFilterInletFvPatchVectorField::fillRandomBox()
406 {
407  List<List<scalar>> randomBox(pTraits<vector>::nComponents, List<scalar>());
408 
409  // Initialise: Remaining convenience factors for (e1 e2 e3)
410  for (direction dir = 0; dir < pTraits<vector>::nComponents; ++dir)
411  {
412  // Initialise: Random-box content with random-number sets
413  randomBox[dir] =
414  generateRandomSet<List<scalar>, scalar>(randomBoxFactors3D_[dir]);
415  }
416 
417  #ifdef FULLDEBUG
418  Info<< "Ends: fillRandomBox()."
419  << "Random-number box is created." << nl;
420  #endif
421 
422  return randomBox;
423 }
424 
425 
427 Foam::turbulentDigitalFilterInletFvPatchVectorField::computeFilterCoeffs() const
428 {
429  List<List<scalar>> filterCoeffs
430  (
431  pTraits<tensor>::nComponents,
432  List<scalar>(1, 1.0)
433  );
434 
435  label initValue = 0;
436 
437  if(variant_ == variantType::FORWARD_STEPWISE)
438  {
439  initValue = pTraits<vector>::nComponents;
440  }
441 
442  for (direction dir = initValue; dir < pTraits<tensor>::nComponents; ++dir)
443  {
444  // The smallest filter width larger than length scale
445  // (Klein et al., 2003, 'n' in Eq. 15)
446  const label n = ceil(L_[dir]);
447 
448  // Full filter-width (except mid-zero) according to the condition
449  // (Klein et al., 2003, Eq. 15 whereat N is minimum =2n)
450  const label twiceN = 4*n;
451 
452  // Initialise filter-coeffs containers with full filter-width size
453  // Extra elem is mid-zero within [-N, N]
454  filterCoeffs[dir] = List<scalar>(twiceN + 1, Zero);
455 
456  // First element: -N within [-N, N]
457  const scalar initElem = -2*scalar(n);
458 
459  // Container initialised with [-N, N]
460  // (Klein et al., 2003, p. 658, Item-b)
461  std::iota
462  (
463  filterCoeffs[dir].begin(),
464  filterCoeffs[dir].end(),
465  initElem
466  );
467 
468  // Compute filter-coeffs
469  // (Klein et al., 2003, Eq. 14 (Gaussian))
470  // (Bercin et al., 2018, Fig. 9 (Exponential))
471  List<scalar> fTemp(filterCoeffs[dir]);
472  scalar fSum = 0;
473  const scalar nSqr = n*n;
474 
475  if (isGaussian_)
476  {
477  fTemp = sqr(exp(modelConst_*sqr(fTemp)/nSqr));
478  fSum = Foam::sqrt(sum(fTemp));
479 
480  filterCoeffs[dir] =
481  exp(modelConst_*sqr(filterCoeffs[dir])/nSqr)/fSum;
482  }
483  else
484  {
485  fTemp = sqr(exp(modelConst_*mag(fTemp)/n));
486  fSum = Foam::sqrt(sum(fTemp));
487 
488  filterCoeffs[dir] = exp(modelConst_*mag(filterCoeffs[dir])/n)/fSum;
489  }
490  }
491 
492  #ifdef FULLDEBUG
493  Info<< "Ends: computeFilterCoeffs()."
494  << " Filter coefficients are computed." << nl;
495  #endif
496 
497  return filterCoeffs;
498 }
499 
500 
501 void Foam::turbulentDigitalFilterInletFvPatchVectorField::rndShiftRefill()
502 {
503  forAll(randomBox_, dir)
504  {
505  List<scalar>& r = randomBox_[dir];
506 
507  // Shift forward from the back to the front / First Out
508  inplaceRotateList(r, randomBoxFactors2D_[dir]);
509 
510  // Refill the back with a new random-number set / First In
511  for (label i = 0; i < randomBoxFactors2D_[dir]; ++i)
512  {
513  r[i] = rndGen_.GaussNormal<scalar>();
514  }
515  }
516 }
517 
518 
519 void Foam::turbulentDigitalFilterInletFvPatchVectorField::mapFilteredRandomBox
520 (
521  vectorField& U
522 )
523 {
524  for (const auto& x : indexPairs_)
525  {
526  const label xf = x.first();
527  const label xs = x.second();
528  U[xf][0] = filteredRandomBox_[0][xs];
529  U[xf][1] = filteredRandomBox_[1][xs];
530  U[xf][2] = filteredRandomBox_[2][xs];
531  }
532 }
533 
534 
535 void Foam::turbulentDigitalFilterInletFvPatchVectorField::embedOnePointCorrs
536 (
537  vectorField& U
538 ) const
539 {
540  forAll(LundWuSquires_, facei)
541  {
542  vector& Us = U[facei];
543  const symmTensor& lws = LundWuSquires_[facei];
544 
545  // (Klein et al. p. 658, Item-e)
546  Us.z() = Us.x()*lws.xz() + Us.y()*lws.yz() + Us.z()*lws.zz();
547  Us.y() = Us.x()*lws.xy() + Us.y()*lws.yy();
548  Us.x() = Us.x()*lws.xx();
549  }
550 }
551 
552 
553 void Foam::turbulentDigitalFilterInletFvPatchVectorField::embedMeanVelocity
554 (
555  vectorField& U
556 ) const
557 {
558  U += UMean_;
559 }
560 
561 
562 void Foam::turbulentDigitalFilterInletFvPatchVectorField::correctFlowRate
563 (
564  vectorField& U
565 ) const
566 {
567  U *= (initialFlowRate_/gSum(U & -patch().Sf()));
568 }
569 
570 
571 void Foam::turbulentDigitalFilterInletFvPatchVectorField::embedTwoPointCorrs()
572 {
573  for (direction dir = 0; dir < pTraits<vector>::nComponents; ++dir)
574  {
575  List<scalar>& in = randomBox_[dir];
576  List<scalar>& out = filteredRandomBox_[dir];
577  const List<scalar>& filter1 = filterCoeffs_[dir];
578  const List<scalar>& filter2 = filterCoeffs_[3 + dir];
579  const List<scalar>& filter3 = filterCoeffs_[6 + dir];
580 
581  const label sz1 = lenRandomBox_[dir];
582  const label sz2 = lenRandomBox_[3 + dir];
583  const label sz3 = lenRandomBox_[6 + dir];
584  const label szfilter1 = filterCoeffs_[dir].size();
585  const label szfilter2 = filterCoeffs_[3 + dir].size();
586  const label szfilter3 = filterCoeffs_[6 + dir].size();
587  const label sz23 = randomBoxFactors2D_[dir];
588  const label sz123 = randomBoxFactors3D_[dir];
589  const label validSlice2 = sz2 - (szfilter2 - label(1));
590  const label validSlice3 = sz3 - (szfilter3 - label(1));
591 
592  // Convolution summation - Along 1st direction
593  scalarField tmp(sz123);
594  label filterCentre = label(szfilter2/label(2));
595  label endIndex = sz2 - filterCentre;
596  label i0 = 0;
597  label i1 = 0;
598  label i2 = 0;
599 
600  for (label i = 0; i < sz1; ++i)
601  {
602  for (label j = 0; j < sz3; ++j)
603  {
604  i1 += filterCentre;
605 
606  for (label k = filterCentre; k < endIndex; ++k)
607  {
608  tmp[i1] = 0.0;
609  label q = 0;
610 
611  for (label p = szfilter2 - 1; p >= 0; --p, ++q)
612  {
613  tmp[i1] += in[i0 + q]*filter2[p];
614  }
615  ++i0;
616  ++i1;
617 
618  }
619  i0 += (filterCentre + filterCentre);
620  i1 += filterCentre;
621  }
622  }
623 
624  // Convolution summation - Along 2nd direction
625  scalarField tmp2(tmp);
626  filterCentre = label(szfilter3/label(2));
627  endIndex = sz3 - filterCentre;
628  i1 = 0;
629  i2 = 0;
630 
631  for (label i = 0; i < sz1; ++i)
632  {
633  label sl = i*sz23;
634 
635  for (label j = 0; j < sz2; ++j)
636  {
637  i1 = j + sl;
638  i2 = i1;
639 
640  for (label k = 0; k < endIndex - filterCentre; ++k)
641  {
642  tmp[i1] = 0.0;
643  label q = 0;
644 
645  for (label p = szfilter3 - 1; p >= 0; --p, ++q)
646  {
647  tmp[i1] += tmp2[i2 + q*sz2]*filter3[p];
648  }
649  i1 += sz2;
650  i2 += sz2;
651 
652  }
653  i1 += (sz2 + filterCentre);
654  i2 += (sz2 + filterCentre);
655  }
656  }
657 
658  // Convolution summation - Along 3rd direction
659  filterCentre = label(szfilter1/label(2));
660  endIndex = sz1 - filterCentre;
661  i1 = (szfilter2 - label(1))/label(2);
662  i2 = (szfilter2 - label(1))/label(2);
663  label i3 = 0;
664 
665  for (label i = 0; i < validSlice3; ++i)
666  {
667  for (label j = 0; j < validSlice2; ++j)
668  {
669  scalar sum = 0.0;
670  i1 = i2 + j;
671 
672  for (label k = szfilter1 - 1; k >= 0; --k)
673  {
674  sum += tmp[i1]*filter1[k];
675  i1 += sz23;
676  }
677  out[i3] = sum;
678  ++i3;
679 
680  }
681  i2 += sz2;
682  }
683  }
684 }
685 
686 
687 void Foam::turbulentDigitalFilterInletFvPatchVectorField::computeDFM
688 (
689  vectorField& U
690 )
691 {
692  #ifdef FULLDEBUG
693  Info<< "Starts: computeDFM()" << nl;
694  #endif
695 
696  if (Pstream::master())
697  {
698  embedTwoPointCorrs();
699  rndShiftRefill();
700  }
701 
702  Pstream::scatter(filteredRandomBox_);
703 
704  mapFilteredRandomBox(U);
705 
706  embedOnePointCorrs(U);
707 
708  embedMeanVelocity(U);
709 
710  if (isCorrectedFlowRate_)
711  {
712  correctFlowRate(U);
713  }
714 
715  #ifdef FULLDEBUG
716  Info<< "Ends: computeDFM()" << nl;
717  #endif
718 }
719 
720 
721 void Foam::turbulentDigitalFilterInletFvPatchVectorField::computeReducedDFM
722 (
723  vectorField& U
724 )
725 {
726  #ifdef FULLDEBUG
727  Info<< "Starts: computeReducedDFM()" << nl;
728  #endif
729 
730  if (Pstream::master())
731  {
732  embedTwoPointCorrs();
733  rndShiftRefill();
734  }
735 
736  Pstream::scatter(filteredRandomBox_);
737 
738  mapFilteredRandomBox(U);
739 
740  computeFSM(U);
741 
742  embedOnePointCorrs(U);
743 
744  embedMeanVelocity(U);
745 
746  if (isCorrectedFlowRate_)
747  {
748  correctFlowRate(U);
749  }
750 
751  #ifdef FULLDEBUG
752  Info<< "Ends: computeReducedDFM()" << nl;
753  #endif
754 }
755 
756 
757 Foam::List<Foam::scalar> Foam::turbulentDigitalFilterInletFvPatchVectorField::
758 computeConstList1FSM() const
759 {
760  List<scalar> constList1FSM(pTraits<vector>::nComponents);
761 
762  forAll(L_.x(), i)
763  {
764  constList1FSM[i] = exp(const1FSM_/L_[i]);
765  }
766 
767  return constList1FSM;
768 }
769 
770 
771 Foam::List<Foam::scalar> Foam::turbulentDigitalFilterInletFvPatchVectorField::
772 computeConstList2FSM() const
773 {
774  List<scalar> constList2FSM(pTraits<vector>::nComponents);
775 
776  forAll(L_.x(), i)
777  {
778  constList2FSM[i] = Foam::sqrt(1.0 - exp(const2FSM_/L_[i]));
779  }
780 
781  return constList2FSM;
782 }
783 
784 
785 void Foam::turbulentDigitalFilterInletFvPatchVectorField::computeFSM
786 (
787  vectorField& U
788 )
789 {
790  for (direction dir = 0; dir < pTraits<vector>::nComponents; ++dir)
791  {
792  U.component(dir) = U0_.component(dir)*constList1FSM_[dir]
793  +U.component(dir)*constList2FSM_[dir];
794  }
795 
796  U0_ = U;
797 }
798 
799 
800 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
801 
804 (
805  const fvPatch& p,
807 )
808 :
810  mapperPtr_(nullptr),
811  variant_(variantType::DIGITAL_FILTER),
812  isGaussian_(true),
813  isFixedSeed_(true),
814  isContinuous_(false),
815  isCorrectedFlowRate_(true),
816  interpolateR_(false),
817  interpolateUMean_(false),
818  isInsideMesh_(false),
819  isTaylorHypot_(true),
820  mapMethod_("nearestCell"),
821  curTimeIndex_(-1),
822  tiny_(1e-8),
823  patchNormalSpeed_(Zero),
824  modelConst_(-0.5*constant::mathematical::pi),
825  perturb_(1e-5),
826  initialFlowRate_(pTraits<scalar>::one),
827  rndGen_(1234),
828  planeDivisions_(Zero, Zero),
829  invDelta_(Zero),
830  indexPairs_(Zero),
831  R_(Zero),
832  LundWuSquires_(Zero),
833  UMean_(Zero),
834  Lbak_(Zero),
835  L_(Zero),
836  const1FSM_(Zero),
837  const2FSM_(Zero),
838  constList1FSM_(Zero),
839  constList2FSM_(Zero),
840  lenRandomBox_(Zero),
841  randomBoxFactors2D_(Zero),
842  randomBoxFactors3D_(Zero),
843  iNextToLastPlane_(Zero),
844  randomBox_(Zero),
845  filterCoeffs_(Zero),
846  filteredRandomBox_(Zero),
847  U0_(Zero),
848  computeVariant(nullptr)
849 {}
850 
851 
854 (
856  const fvPatch& p,
858  const fvPatchFieldMapper& mapper
859 )
860 :
861  fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
862  mapperPtr_(nullptr),
863  variant_(ptf.variant_),
864  isGaussian_(ptf.isGaussian_),
865  isFixedSeed_(ptf.isFixedSeed_),
866  isContinuous_(ptf.isContinuous_),
867  isCorrectedFlowRate_(ptf.isCorrectedFlowRate_),
868  interpolateR_(ptf.interpolateR_),
869  interpolateUMean_(ptf.interpolateUMean_),
870  isInsideMesh_(ptf.isInsideMesh_),
871  isTaylorHypot_(ptf.isTaylorHypot_),
872  mapMethod_(ptf.mapMethod_),
873  curTimeIndex_(-1),
874  tiny_(ptf.tiny_),
875  patchNormalSpeed_(ptf.patchNormalSpeed_),
876  modelConst_(ptf.modelConst_),
877  perturb_(ptf.perturb_),
878  initialFlowRate_(ptf.initialFlowRate_),
879  rndGen_(ptf.rndGen_),
880  planeDivisions_(ptf.planeDivisions_),
881  invDelta_(ptf.invDelta_),
882  indexPairs_(ptf.indexPairs_),
883  R_(ptf.R_),
884  LundWuSquires_(ptf.LundWuSquires_),
885  UMean_(ptf.UMean_),
886  Lbak_(ptf.Lbak_),
887  L_(ptf.L_),
888  const1FSM_(ptf.const1FSM_),
889  const2FSM_(ptf.const2FSM_),
890  constList1FSM_(ptf.constList1FSM_),
891  constList2FSM_(ptf.constList2FSM_),
892  lenRandomBox_(ptf.lenRandomBox_),
893  randomBoxFactors2D_(ptf.randomBoxFactors2D_),
894  randomBoxFactors3D_(ptf.randomBoxFactors3D_),
895  iNextToLastPlane_(ptf.iNextToLastPlane_),
896  randomBox_(ptf.randomBox_),
897  filterCoeffs_(ptf.filterCoeffs_),
898  filteredRandomBox_(ptf.filteredRandomBox_),
899  U0_(ptf.U0_),
900  computeVariant(ptf.computeVariant)
901 {}
902 
903 
906 (
907  const fvPatch& p,
909  const dictionary& dict
910 )
911 :
913  mapperPtr_(nullptr),
914  variant_
915  (
916  variantNames.getOrDefault
917  (
918  "variant",
919  dict,
920  variantType::DIGITAL_FILTER
921  )
922  ),
923  isGaussian_
924  (
925  (variant_ == variantType::FORWARD_STEPWISE)
926  ? false
927  : dict.getOrDefault("isGaussian", true)
928  ),
929  isFixedSeed_(dict.getOrDefault("isFixedSeed", true)),
930  isContinuous_(dict.getOrDefault("isContinuous", false)),
931  isCorrectedFlowRate_(dict.getOrDefault("isCorrectedFlowRate", true)),
932  interpolateR_(dict.getOrDefault("interpolateR", false)),
933  interpolateUMean_(dict.getOrDefault("interpolateUMean", false)),
934  isInsideMesh_(dict.getOrDefault("isInsideMesh", false)),
935  isTaylorHypot_(dict.getOrDefault("isTaylorHypot", true)),
936  mapMethod_(dict.getOrDefault<word>("mapMethod", "nearestCell")),
937  curTimeIndex_(-1),
938  tiny_(dict.getOrDefault<scalar>("threshold", 1e-8)),
939  patchNormalSpeed_
940  (
941  dict.getCheck<scalar>
942  (
943  "patchNormalSpeed",
944  scalarMinMax::ge(tiny_)
945  )
946  ),
947  modelConst_
948  (
949  dict.getOrDefault<scalar>
950  (
951  "modelConst",
953  )
954  ),
955  perturb_(dict.getOrDefault<scalar>("perturb", 1e-5)),
956  initialFlowRate_(pTraits<scalar>::one),
957  rndGen_
958  (
959  isFixedSeed_
960  ? 1234
961  : time(0)
962  ),
963  planeDivisions_
964  (
966  (
967  "planeDivisions",
968  [&](const Tuple2<label, label>& len)
969  {
970  return tiny_ < min(len.first(), len.second()) ? true : false;
971  }
972  )
973  ),
974  invDelta_(),
975  indexPairs_(patchIndexPairs()),
976  R_(interpolateOrRead<symmTensor>("R", dict, interpolateR_)),
977  LundWuSquires_(computeLundWuSquires()),
978  UMean_(interpolateOrRead<vector>("UMean", dict, interpolateUMean_)),
979  Lbak_
980  (
982  (
983  "L",
984  [&](const tensor& l){return tiny_ < cmptMin(l) ? true : false;}
985  )
986  ),
987  L_(convertScalesToGridUnits(Lbak_)),
988  const1FSM_
989  (
990  (variant_ == variantType::FORWARD_STEPWISE)
991  ? dict.getOrDefault<scalar>
992  (
993  "const1FSM",
995  )
996  : Zero
997  ),
998  const2FSM_
999  (
1000  (variant_ == variantType::FORWARD_STEPWISE)
1001  ? dict.getOrDefault<scalar>
1002  (
1003  "const2FSM",
1005  )
1006  : Zero
1007  ),
1008  constList1FSM_
1009  (
1010  (variant_ == variantType::FORWARD_STEPWISE)
1011  ? computeConstList1FSM()
1012  : List<scalar>()
1013  ),
1014  constList2FSM_
1015  (
1016  (variant_ == variantType::FORWARD_STEPWISE)
1017  ? computeConstList2FSM()
1018  : List<scalar>()
1019  ),
1020  lenRandomBox_(initLenRandomBox()),
1021  randomBoxFactors2D_(initBoxFactors2D()),
1022  randomBoxFactors3D_(initBoxFactors3D()),
1023  iNextToLastPlane_(initBoxPlaneFactors()),
1024  randomBox_
1025  (
1026  (isContinuous_ && Pstream::master())
1028  (
1029  "randomBox",
1030  fillRandomBox() // First time-step
1031  )
1032  :
1033  fillRandomBox()
1034  ),
1035  filterCoeffs_(computeFilterCoeffs()),
1036  filteredRandomBox_
1037  (
1039  List<scalar>(planeDivisions_.first()*planeDivisions_.second(), Zero)
1040  ),
1041  U0_
1042  (
1043  (variant_ == variantType::FORWARD_STEPWISE)
1044  ? generateRandomSet<vectorField, vector>(patch().size())
1045  : vectorField()
1046  ),
1047  computeVariant
1048  (
1049  (variant_ == variantType::FORWARD_STEPWISE)
1050  ? &turbulentDigitalFilterInletFvPatchVectorField::computeReducedDFM
1051  : &turbulentDigitalFilterInletFvPatchVectorField::computeDFM
1052  )
1053 {
1054  if (isCorrectedFlowRate_)
1055  {
1056  initialFlowRate_ = computeInitialFlowRate();
1057  }
1058 
1059  // Check if varying or fixed time-step computation
1060  if (db().time().isAdjustTimeStep())
1061  {
1063  << "Varying time-step computations are not fully supported"
1064  << " for the moment."<< nl << nl;
1065  }
1066 
1067  #ifdef FULLDEBUG
1068  Info<< "Ends: Resource acquisition/initialisation for the"
1069  << " synthetic turbulence boundary condition." << nl;
1070  #endif
1071 }
1072 
1073 
1078 )
1079 :
1081  mapperPtr_(nullptr),
1082  variant_(ptf.variant_),
1083  isGaussian_(ptf.isGaussian_),
1084  isFixedSeed_(ptf.isFixedSeed_),
1085  isContinuous_(ptf.isContinuous_),
1086  isCorrectedFlowRate_(ptf.isCorrectedFlowRate_),
1087  interpolateR_(ptf.interpolateR_),
1088  interpolateUMean_(ptf.interpolateUMean_),
1089  isInsideMesh_(ptf.isInsideMesh_),
1090  isTaylorHypot_(ptf.isTaylorHypot_),
1091  mapMethod_(ptf.mapMethod_),
1092  curTimeIndex_(ptf.curTimeIndex_),
1093  tiny_(ptf.tiny_),
1094  patchNormalSpeed_(ptf.patchNormalSpeed_),
1095  modelConst_(ptf.modelConst_),
1096  perturb_(ptf.perturb_),
1097  initialFlowRate_(ptf.initialFlowRate_),
1098  rndGen_(ptf.rndGen_),
1099  planeDivisions_(ptf.planeDivisions_),
1100  invDelta_(ptf.invDelta_),
1101  indexPairs_(ptf.indexPairs_),
1102  R_(ptf.R_),
1103  LundWuSquires_(ptf.LundWuSquires_),
1104  UMean_(ptf.UMean_),
1105  Lbak_(ptf.Lbak_),
1106  L_(ptf.L_),
1107  const1FSM_(ptf.const1FSM_),
1108  const2FSM_(ptf.const2FSM_),
1109  constList1FSM_(ptf.constList1FSM_),
1110  constList2FSM_(ptf.constList2FSM_),
1111  lenRandomBox_(ptf.lenRandomBox_),
1112  randomBoxFactors2D_(ptf.randomBoxFactors2D_),
1113  randomBoxFactors3D_(ptf.randomBoxFactors3D_),
1114  iNextToLastPlane_(ptf.iNextToLastPlane_),
1115  randomBox_(ptf.randomBox_),
1116  filterCoeffs_(ptf.filterCoeffs_),
1117  filteredRandomBox_(ptf.filteredRandomBox_),
1118  U0_(ptf.U0_),
1119  computeVariant(ptf.computeVariant)
1120 {}
1121 
1122 
1128 )
1129 :
1131  mapperPtr_(nullptr),
1132  variant_(ptf.variant_),
1133  isGaussian_(ptf.isGaussian_),
1134  isFixedSeed_(ptf.isFixedSeed_),
1135  isContinuous_(ptf.isContinuous_),
1136  isCorrectedFlowRate_(ptf.isCorrectedFlowRate_),
1137  interpolateR_(ptf.interpolateR_),
1138  interpolateUMean_(ptf.interpolateUMean_),
1139  isInsideMesh_(ptf.isInsideMesh_),
1140  isTaylorHypot_(ptf.isTaylorHypot_),
1141  mapMethod_(ptf.mapMethod_),
1142  curTimeIndex_(-1),
1143  tiny_(ptf.tiny_),
1144  patchNormalSpeed_(ptf.patchNormalSpeed_),
1145  modelConst_(ptf.modelConst_),
1146  perturb_(ptf.perturb_),
1147  initialFlowRate_(ptf.initialFlowRate_),
1148  rndGen_(ptf.rndGen_),
1149  planeDivisions_(ptf.planeDivisions_),
1150  invDelta_(ptf.invDelta_),
1151  indexPairs_(ptf.indexPairs_),
1152  R_(ptf.R_),
1153  LundWuSquires_(ptf.LundWuSquires_),
1154  UMean_(ptf.UMean_),
1155  Lbak_(ptf.Lbak_),
1156  L_(ptf.L_),
1157  const1FSM_(ptf.const1FSM_),
1158  const2FSM_(ptf.const2FSM_),
1159  constList1FSM_(ptf.constList1FSM_),
1160  constList2FSM_(ptf.constList2FSM_),
1161  lenRandomBox_(ptf.lenRandomBox_),
1162  randomBoxFactors2D_(ptf.randomBoxFactors2D_),
1163  randomBoxFactors3D_(ptf.randomBoxFactors3D_),
1164  iNextToLastPlane_(ptf.iNextToLastPlane_),
1165  randomBox_(ptf.randomBox_),
1166  filterCoeffs_(ptf.filterCoeffs_),
1167  filteredRandomBox_(ptf.filteredRandomBox_),
1168  U0_(ptf.U0_),
1169  computeVariant(ptf.computeVariant)
1170 {}
1171 
1172 
1173 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
1174 
1176 {
1177  if (updated())
1178  {
1179  return;
1180  }
1181 
1182  if (curTimeIndex_ != db().time().timeIndex())
1183  {
1184  vectorField& U = *this;
1185 
1186  computeVariant(this, U);
1187 
1188  curTimeIndex_ = db().time().timeIndex();
1189  }
1190 
1191  fixedValueFvPatchVectorField::updateCoeffs();
1192 }
1193 
1194 
1197  Ostream& os
1198 ) const
1199 {
1201  os.writeEntry("variant", variantNames[variant_]);
1202  os.writeEntry("planeDivisions", planeDivisions_);
1203  os.writeEntry("L", Lbak_);
1204 
1205  if (!interpolateR_)
1206  {
1207  R_.writeEntry("R", os);
1208  }
1209 
1210  if (!interpolateUMean_)
1211  {
1212  UMean_.writeEntry("UMean", os);
1213  }
1214 
1215  os.writeEntryIfDifferent<bool>("isGaussian", true, isGaussian_);
1216  os.writeEntryIfDifferent<bool>("isFixedSeed", true, isFixedSeed_);
1217  os.writeEntryIfDifferent<bool>("isContinuous", false, isContinuous_);
1218  os.writeEntryIfDifferent<bool>
1219  ("isCorrectedFlowRate", true, isCorrectedFlowRate_);
1220  os.writeEntryIfDifferent<bool>("isInsideMesh", false, isInsideMesh_);
1221  os.writeEntryIfDifferent<bool>("isTaylorHypot", true, isTaylorHypot_);
1222 
1223  if (!mapMethod_.empty())
1224  {
1226  (
1227  "mapMethod",
1228  "nearestCell",
1229  mapMethod_
1230  );
1231  }
1232 
1233  os.writeEntry("threshold", tiny_);
1234  os.writeEntry("patchNormalSpeed", patchNormalSpeed_);
1235  os.writeEntry("modelConst", modelConst_);
1236  os.writeEntry("perturb", perturb_);
1237 
1238  if (variant_ == variantType::FORWARD_STEPWISE)
1239  {
1240  os.writeEntry("const1FSM", const1FSM_);
1241  os.writeEntry("const2FSM", const2FSM_);
1242  }
1243 
1244  if (isContinuous_ && Pstream::master())
1245  {
1246  os.writeEntry("randomBox", randomBox_);
1247  }
1248 }
1249 
1250 
1251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1252 
1253 namespace Foam
1254 {
1256  (
1259  );
1260 }
1261 
1262 
1263 // ************************************************************************* //
Foam::fvPatchField< vector >
volFields.H
Foam::pointField
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
Foam::Tensor< scalar >
Foam::Ostream::writeEntryIfDifferent
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
Definition: Ostream.H:231
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
L
const vector L(dict.get< vector >("L"))
Foam::Vector::x
const Cmpt & x() const
Access to the vector x component.
Definition: VectorI.H:78
mathematicalConstants.H
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::Enum
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: IOstreamOption.H:51
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
stdFoam::begin
constexpr auto begin(C &c) -> decltype(c.begin())
Return iterator to the beginning of the container c.
Definition: stdFoam.H:91
s
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputSpray.H:25
Foam::Zero
static constexpr const zero Zero
Global zero.
Definition: zero.H:128
Foam::gAverage
Type gAverage(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:604
Foam::tensor
Tensor< scalar > tensor
Tensor of scalars.
Definition: tensor.H:53
Foam::inplaceRotateList
void inplaceRotateList(ListType< DataType > &list, label n)
Inplace reversal of a list using the Reversal Block Swapping algorithm.
Definition: ListOpsTemplates.C:1060
Foam::Pstream::scatter
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
Definition: gatherScatter.C:150
Foam::pointToPointPlanarInterpolation
Interpolates between two sets of unstructured points using 2D Delaunay triangulation....
Definition: pointToPointPlanarInterpolation.H:53
Foam::gSum
Type gSum(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:594
Foam::exp
dimensionedScalar exp(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:261
Foam::turbulentDigitalFilterInletFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: turbulentDigitalFilterInletFvPatchVectorField.C:1196
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:80
turbulentDigitalFilterInletFvPatchVectorField.H
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:290
Foam::symmTensorField
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
Definition: primitiveFieldsFwd.H:56
Foam::vectorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
Definition: primitiveFieldsFwd.H:54
Foam::fixedValueFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fixedValueFvPatchField.C:156
Foam::SymmTensor::xx
const Cmpt & xx() const
Definition: SymmTensorI.H:89
n
label n
Definition: TABSMDCalcMethod2.H:31
R
#define R(A, B, C, D, E, F, K, M)
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::turbulentDigitalFilterInletFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: turbulentDigitalFilterInletFvPatchVectorField.C:1175
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
Foam::symmTensor
SymmTensor< scalar > symmTensor
SymmTensor of scalars.
Definition: symmTensor.H:50
timeIndex
label timeIndex
Definition: getTimeIndex.H:4
dict
dictionary dict
Definition: searchingEngine.H:14
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
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
stdFoam::end
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
Definition: stdFoam.H:115
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::turbulentDigitalFilterInletFvPatchVectorField::turbulentDigitalFilterInletFvPatchVectorField
turbulentDigitalFilterInletFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: turbulentDigitalFilterInletFvPatchVectorField.C:804
Foam::turbulentDigitalFilterInletFvPatchVectorField
Definition: turbulentDigitalFilterInletFvPatchVectorField.H:295
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::UPstream::master
static bool master(const label communicator=0)
Am I the master process.
Definition: UPstream.H:438
U
U
Definition: pEqn.H:72
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:355
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
Foam::constant::mathematical::pi
constexpr scalar pi(M_PI)
Foam::nl
constexpr char nl
Definition: Ostream.H:372
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::MinMax< scalar >::ge
static MinMax< scalar > ge(const scalar &minVal)
A semi-infinite range from minVal to the type max.
Definition: MinMaxI.H:31
Foam::Vector< scalar >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:102
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:144
Foam::pTraits
Traits class for primitives.
Definition: pTraits.H:52
Us
Us
Definition: createFaFields.H:51
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
points
const pointField & points
Definition: gmvOutputHeader.H:1
k
label k
Boltzmann constant.
Definition: LISASMDCalcMethod2.H:41
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
Foam::sum
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:327
path
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
Foam::direction
uint8_t direction
Definition: direction.H:47
x
x
Definition: LISASMDCalcMethod2.H:52
Foam::dictionary::getCheck
T getCheck(const word &keyword, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:94
Foam::Ostream::writeEntry
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Definition: Ostream.H:219
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::makePatchTypeField
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Foam::Tuple2< label, label >
Foam::point
vector point
Point is a vector.
Definition: point.H:43
Foam::dictionary::getOrDefault
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:122
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:294
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54