stabilityBlendingFactor.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) 2018-2021 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 
31 #include "fvcGrad.H"
32 #include "surfaceInterpolate.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 namespace functionObjects
39 {
40  defineTypeNameAndDebug(stabilityBlendingFactor, 0);
42  (
43  functionObject,
44  stabilityBlendingFactor,
45  dictionary
46  );
47 }
48 }
49 
50 
51 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
52 
53 void Foam::functionObjects::stabilityBlendingFactor::calcStats
54 (
55  label& nCellsScheme1,
56  label& nCellsScheme2,
57  label& nCellsBlended
58 ) const
59 {
60  forAll(indicator_, celli)
61  {
62  scalar i = indicator_[celli];
63 
64  if (i < tolerance_)
65  {
66  nCellsScheme2++;
67  }
68  else if (i > (1 - tolerance_))
69  {
70  nCellsScheme1++;
71  }
72  else
73  {
74  nCellsBlended++;
75  }
76  }
77 
78  reduce(nCellsScheme1, sumOp<label>());
79  reduce(nCellsScheme2, sumOp<label>());
80  reduce(nCellsBlended, sumOp<label>());
81 }
82 
83 
85 (
86  Ostream& os
87 ) const
88 {
89  writeHeader(os, "Stabilization blending factor");
90  writeCommented(os, "Time");
91  writeTabbed(os, "Scheme1");
92  writeTabbed(os, "Scheme2");
93  writeTabbed(os, "Blended");
94  os << endl;
95 }
96 
97 
98 bool Foam::functionObjects::stabilityBlendingFactor::calc()
99 {
100  init(false);
101  return true;
102 }
103 
104 
105 bool Foam::functionObjects::stabilityBlendingFactor::init(bool first)
106 {
107  const auto* residualPtr = mesh_.findObject<IOField<scalar>>(residualName_);
108 
109  if (residuals_)
110  {
111  if (!residualPtr)
112  {
114  << "Could not find residual field : " << residualName_
115  << ". The residual mode won't be " << nl
116  << " considered for the blended field in the stability "
117  << "blending factor. " << nl
118  << " Please add the corresponding 'solverInfo'"
119  << " function object with 'writeResidualFields true'." << nl
120  << " If the solverInfo function object is already enabled "
121  << "you might need to wait " << nl
122  << " for the first iteration."
123  << nl << endl;
124  }
125  else
126  {
127  scalar meanRes = gAverage(mag(*residualPtr)) + VSMALL;
128 
129  Log << nl << name() << " : " << nl
130  << " Average(mag(residuals)) : " << meanRes << endl;
131 
132  oldError_ = error_;
133  oldErrorIntegral_ = errorIntegral_;
134  error_ = mag(meanRes - mag(*residualPtr));
135  errorIntegral_ = oldErrorIntegral_ + 0.5*(error_ + oldError_);
136  const scalarField errorDifferential(error_ - oldError_);
137 
138  const scalarField factorList
139  (
140  + P_*error_
141  + I_*errorIntegral_
142  + D_*errorDifferential
143  );
144 
145  const scalarField indicatorResidual
146  (
147  max
148  (
149  min
150  (
151  mag(factorList - meanRes)/(maxResidual_*meanRes),
152  scalar(1)
153  ),
154  scalar(0)
155  )
156  );
157 
158  forAll(indicator_, i)
159  {
160  indicator_[i] = indicatorResidual[i];
161  }
162  }
163  }
164 
165  const volScalarField* nonOrthPtr =
166  mesh_.findObject<volScalarField>(nonOrthogonalityName_);
167 
168  if (nonOrthogonality_)
169  {
170  if (maxNonOrthogonality_ >= minNonOrthogonality_)
171  {
173  << " minNonOrthogonality should be larger than "
174  << "maxNonOrthogonality."
175  << exit(FatalError);
176  }
177 
178  indicator_ =
179  max
180  (
181  indicator_,
182  min
183  (
184  max
185  (
186  scalar(0),
187  (*nonOrthPtr - maxNonOrthogonality_)
188  / (minNonOrthogonality_ - maxNonOrthogonality_)
189  ),
190  scalar(1)
191  )
192  );
193 
194  if (first)
195  {
196  Log << " Max non-orthogonality : " << max(*nonOrthPtr).value()
197  << endl;
198  }
199  }
200 
201  const volScalarField* skewnessPtr =
202  mesh_.findObject<volScalarField>(skewnessName_);
203 
204  if (skewness_)
205  {
206  if (maxSkewness_ >= minSkewness_)
207  {
209  << " minSkewness should be larger than maxSkewness."
210  << exit(FatalError);
211  }
212 
213  indicator_ =
214  max
215  (
216  indicator_,
217  min
218  (
219  max
220  (
221  scalar(0),
222  (*skewnessPtr - maxSkewness_)
223  / (minSkewness_ - maxSkewness_)
224  ),
225  scalar(1)
226  )
227  );
228 
229  if (first)
230  {
231  Log << " Max skewness : " << max(*skewnessPtr).value()
232  << endl;
233  }
234  }
235 
236  const volScalarField* faceWeightsPtr =
237  mesh_.findObject<volScalarField>(faceWeightName_);
238 
239  if (faceWeight_)
240  {
241  if (maxFaceWeight_ >= minFaceWeight_)
242  {
244  << " minFaceWeight should be larger than maxFaceWeight."
245  << exit(FatalError);
246  }
247 
248  indicator_ =
249  max
250  (
251  indicator_,
252  min
253  (
254  max
255  (
256  scalar(0),
257  (minFaceWeight_ - *faceWeightsPtr)
258  / (minFaceWeight_ - maxFaceWeight_)
259  ),
260  scalar(1)
261  )
262  );
263 
264  if (first)
265  {
266  Log << " Min face weight: " << min(*faceWeightsPtr).value()
267  << endl;
268  }
269  }
270 
271 
272  if (gradCc_)
273  {
274  if (maxGradCc_ >= minGradCc_)
275  {
277  << " minGradCc should be larger than maxGradCc."
278  << exit(FatalError);
279  }
280 
281  auto tmagGradCC = tmp<volScalarField>::New
282  (
283  IOobject
284  (
285  "magGradCC",
286  time_.timeName(),
287  mesh_,
290  ),
291  mesh_,
293  zeroGradientFvPatchScalarField::typeName
294  );
295  auto& magGradCC = tmagGradCC.ref();
296 
297  for (direction i=0; i<vector::nComponents; i++)
298  {
299  // Create field with zero grad
300  volScalarField cci
301  (
302  IOobject
303  (
304  "cc" + word(vector::componentNames[i]),
305  mesh_.time().timeName(),
306  mesh_,
309  ),
310  mesh_,
312  zeroGradientFvPatchScalarField::typeName
313  );
314  cci = mesh_.C().component(i);
315  cci.correctBoundaryConditions();
316  magGradCC += mag(fvc::grad(cci)).ref();
317  }
318 
319  if (first)
320  {
321  Log << " Max magGradCc : " << max(magGradCC.ref()).value()
322  << endl;
323  }
324 
325  indicator_ =
326  max
327  (
328  indicator_,
329  min
330  (
331  max
332  (
333  scalar(0),
334  (magGradCC - maxGradCc_)
335  / (minGradCc_ - maxGradCc_)
336  ),
337  scalar(1)
338  )
339  );
340  }
341 
342 
343  const volVectorField* UNamePtr =
344  mesh_.findObject<volVectorField>(UName_);
345 
346  if (Co_)
347  {
348  if (Co1_ >= Co2_)
349  {
351  << " Co2 should be larger than Co1."
352  << exit(FatalError);
353  }
354 
355  auto CoPtr = tmp<volScalarField>::New
356  (
357  IOobject
358  (
359  "Co",
360  time_.timeName(),
361  mesh_,
364  ),
365  mesh_,
367  zeroGradientFvPatchScalarField::typeName
368  );
369 
370  auto& Co = CoPtr.ref();
371 
372  Co.primitiveFieldRef() =
373  mesh_.time().deltaT()*mag(*UNamePtr)/cbrt(mesh_.V());
374 
375  indicator_ =
376  max
377  (
378  indicator_,
379  min(max(scalar(0), (Co - Co1_)/(Co2_ - Co1_)), scalar(1))
380  );
381 
382  if (first)
383  {
384  Log << " Max Co : " << max(Co).value()
385  << endl;
386  }
387  }
388 
389  if (first)
390  {
391  Log << nl;
392  }
393 
394  if (log)
395  {
396  label nCellsScheme1 = 0;
397  label nCellsScheme2 = 0;
398  label nCellsBlended = 0;
399 
400  calcStats(nCellsScheme1, nCellsScheme2, nCellsBlended);
401 
402  Log << nl << name() << " execute :" << nl
403  << " scheme 1 cells : " << nCellsScheme1 << nl
404  << " scheme 2 cells : " << nCellsScheme2 << nl
405  << " blended cells : " << nCellsBlended << nl
406  << endl;
407  }
408 
409  indicator_.correctBoundaryConditions();
410  indicator_.min(1.0);
411  indicator_.max(0.0);
412 
413  // Update the blended surface field
414  surfaceScalarField& surBlended =
415  mesh_.lookupObjectRef<surfaceScalarField>(resultName_);
416 
417  surBlended = fvc::interpolate(indicator_);
418 
419  return true;
420 }
421 
422 
423 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
424 
426 (
427  const word& name,
428  const Time& runTime,
429  const dictionary& dict
430 )
431 :
433  writeFile(obr_, name, typeName, dict),
434  indicator_
435  (
436  IOobject
437  (
438  "blendedIndicator" + fieldName_,
439  time_.timeName(),
440  mesh_,
443  ),
444  mesh_,
446  zeroGradientFvPatchScalarField::typeName
447  ),
448  nonOrthogonality_(dict.getOrDefault<Switch>("switchNonOrtho", false)),
449  gradCc_(dict.getOrDefault<Switch>("switchGradCc", false)),
450  residuals_(dict.getOrDefault<Switch>("switchResiduals", false)),
451  faceWeight_(dict.getOrDefault<Switch>("switchFaceWeight", false)),
452  skewness_(dict.getOrDefault<Switch>("switchSkewness", false)),
453  Co_(dict.getOrDefault<Switch>("switchCo", false)),
454 
455  maxNonOrthogonality_
456  (
457  dict.getOrDefault<scalar>("maxNonOrthogonality", 20.0)
458  ),
459  minNonOrthogonality_
460  (
461  dict.getOrDefault<scalar>("minNonOrthogonality", 60.0)
462  ),
463  maxGradCc_(dict.getOrDefault<scalar>("maxGradCc", 3.0)),
464  minGradCc_(dict.getOrDefault<scalar>("minGradCc", 4.0)),
465  maxResidual_(dict.getOrDefault<scalar>("maxResidual", 10.0)),
466  minFaceWeight_(dict.getOrDefault<scalar>("minFaceWeight", 0.3)),
467  maxFaceWeight_(dict.getOrDefault<scalar>("maxFaceWeight", 0.2)),
468  maxSkewness_(dict.getOrDefault<scalar>("maxSkewness", 2.0)),
469  minSkewness_(dict.getOrDefault<scalar>("minSkewness", 3.0)),
470  Co1_(dict.getOrDefault<scalar>("Co1", 1.0)),
471  Co2_(dict.getOrDefault<scalar>("Co2", 10.0)),
472 
473  nonOrthogonalityName_
474  (
475  dict.getOrDefault<word>("nonOrthogonality", "nonOrthoAngle")
476  ),
477  faceWeightName_
478  (
479  dict.getOrDefault<word>("faceWeight", "faceWeight")
480  ),
481  skewnessName_
482  (
483  dict.getOrDefault<word>("skewness", "skewness")
484  ),
485  residualName_
486  (
487  dict.getOrDefault<word>
488  (
489  "residual",
490  IOobject::scopedName("initialResidual", "p")
491  )
492  ),
493  UName_
494  (
495  dict.getOrDefault<word>("U", "U")
496  ),
497 
498  tolerance_(0.001),
499  error_(mesh_.nCells(), Zero),
500  errorIntegral_(mesh_.nCells(), Zero),
501  oldError_(mesh_.nCells(), Zero),
502  oldErrorIntegral_(mesh_.nCells(), Zero),
503  P_(dict.getOrDefault<scalar>("P", 3)),
504  I_(dict.getOrDefault<scalar>("I", 0.0)),
505  D_(dict.getOrDefault<scalar>("D", 0.25))
506 {
507  read(dict);
508  setResultName(typeName, "");
509 
510  auto faceBlendedPtr = tmp<surfaceScalarField>::New
511  (
512  IOobject
513  (
514  resultName_,
515  time_.timeName(),
516  mesh_,
519  ),
520  mesh_,
522  );
523  store(resultName_, faceBlendedPtr);
524 
525  const volScalarField* nonOrthPtr =
526  mesh_.findObject<volScalarField>(nonOrthogonalityName_);
527 
528  if (nonOrthogonality_)
529  {
530  if (!nonOrthPtr)
531  {
532  IOobject fieldHeader
533  (
534  nonOrthogonalityName_,
535  mesh_.time().constant(),
536  mesh_,
539  );
540 
541  if (fieldHeader.typeHeaderOk<volScalarField>(true, true, false))
542  {
543  volScalarField* vfPtr(new volScalarField(fieldHeader, mesh_));
544  mesh_.objectRegistry::store(vfPtr);
545  }
546  else
547  {
549  << " Field : " << nonOrthogonalityName_ << " not found."
550  << " The function object will not be used"
551  << exit(FatalError);
552  }
553  }
554  }
555 
556 
557  const volScalarField* faceWeightsPtr =
558  mesh_.findObject<volScalarField>(faceWeightName_);
559 
560  if (faceWeight_)
561  {
562  if (!faceWeightsPtr)
563  {
564  IOobject fieldHeader
565  (
566  faceWeightName_,
567  mesh_.time().constant(),
568  mesh_,
571  );
572 
573  if (fieldHeader.typeHeaderOk<volScalarField>(true, true, false))
574  {
575  volScalarField* vfPtr(new volScalarField(fieldHeader, mesh_));
576  mesh_.objectRegistry::store(vfPtr);
577  }
578  else
579  {
581  << " Field : " << faceWeightName_ << " not found."
582  << " The function object will not be used"
583  << exit(FatalError);
584  }
585  }
586  }
587 
588  const volScalarField* skewnessPtr =
589  mesh_.findObject<volScalarField>(skewnessName_);
590 
591  if (skewness_)
592  {
593  if (!skewnessPtr)
594  {
595  IOobject fieldHeader
596  (
597  skewnessName_,
598  mesh_.time().constant(),
599  mesh_,
602  );
603 
604  if (fieldHeader.typeHeaderOk<volScalarField>(true, true, false))
605  {
606  volScalarField* vfPtr(new volScalarField(fieldHeader, mesh_));
607  mesh_.objectRegistry::store(vfPtr);
608  }
609  else
610  {
612  << " Field : " << skewnessName_ << " not found."
613  << " The function object will not be used"
614  << exit(FatalError);
615  }
616  }
617  }
618 
619  if (log)
620  {
621  indicator_.writeOpt(IOobject::AUTO_WRITE);
622 
623  }
624 
625  if (writeToFile_)
626  {
627  writeFileHeader(file());
628  }
629 
630  init(true);
631 }
632 
633 
634 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
635 
637 (
638  const dictionary& dict
639 )
640 {
642  {
643  dict.readEntry("switchNonOrtho", nonOrthogonality_);
644  dict.readEntry("switchGradCc", gradCc_);
645  dict.readEntry("switchResiduals", residuals_);
646  dict.readEntry("switchFaceWeight", faceWeight_);
647  dict.readEntry("switchSkewness", skewness_);
648  dict.readEntry("switchCo", Co_);
649 
650  dict.readIfPresent("maxNonOrthogonality", maxNonOrthogonality_);
651  dict.readIfPresent("maxGradCc", maxGradCc_);
652  dict.readIfPresent("maxResidual", maxResidual_);
653  dict.readIfPresent("maxSkewness", maxSkewness_);
654  dict.readIfPresent("maxFaceWeight", maxFaceWeight_);
655  dict.readIfPresent("Co2", Co2_);
656 
657  dict.readIfPresent("minFaceWeight", minFaceWeight_);
658  dict.readIfPresent("minNonOrthogonality", minNonOrthogonality_);
659  dict.readIfPresent("minGradCc", minGradCc_);
660  dict.readIfPresent("minSkewness", minSkewness_);
661  dict.readIfPresent("Co1", Co1_);
662 
663 
664  dict.readIfPresent("P", P_);
665  dict.readIfPresent("I", I_);
666  dict.readIfPresent("D", D_);
667 
668  tolerance_ = 0.001;
669  if
670  (
671  dict.readIfPresent("tolerance", tolerance_)
672  && (tolerance_ < 0 || tolerance_ > 1)
673  )
674  {
676  << "tolerance must be in the range 0 to 1. Supplied value: "
677  << tolerance_ << exit(FatalError);
678  }
679 
680  Info<< type() << " " << name() << ":" << nl;
681  if (nonOrthogonality_)
682  {
683  Info<< " Including nonOrthogonality between: "
684  << minNonOrthogonality_ << " and " << maxNonOrthogonality_
685  << endl;
686  }
687  if (gradCc_)
688  {
689  Info<< " Including gradient between: "
690  << minGradCc_ << " and " << maxGradCc_ << endl;
691  }
692  if (residuals_)
693  {
694  Info<< " Including residuals" << endl;
695  }
696  if (faceWeight_)
697  {
698  Info<< " Including faceWeight between: "
699  << minFaceWeight_ << " and " << maxFaceWeight_ << endl;
700  }
701  if (skewness_)
702  {
703  Info<< " Including skewness between: "
704  << minSkewness_ << " and " << maxSkewness_ << endl;
705  }
706  if (Co_)
707  {
708  Info<< " Including Co between: "
709  << Co2_ << " and " << Co1_ << endl;
710  }
711 
712  return true;
713  }
714 
715  return false;
716 }
717 
718 
720 {
721  label nCellsScheme1 = 0;
722  label nCellsScheme2 = 0;
723  label nCellsBlended = 0;
724 
725  calcStats(nCellsScheme1, nCellsScheme2, nCellsBlended);
726 
727  if (writeToFile_)
728  {
729  writeCurrentTime(file());
730 
731  file()
732  << tab << nCellsScheme1
733  << tab << nCellsScheme2
734  << tab << nCellsBlended
735  << endl;
736  }
737 
738  return true;
739 }
740 
741 
742 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::GeometricField::component
tmp< GeometricField< cmptType, PatchField, GeoMesh > > component(const direction) const
Return a component of the field.
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:77
Foam::IOobject::AUTO_WRITE
Definition: IOobject.H:194
Log
#define Log
Definition: PDRblock.C:35
Foam::fvc::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:54
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::IOField
A primitive field of type <T> with automated input and output.
Definition: foamVtkLagrangianWriter.H:61
Foam::VectorSpace< Vector< scalar >, scalar, 3 >::componentNames
static const char *const componentNames[]
Definition: VectorSpace.H:114
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:52
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::gAverage
Type gAverage(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:604
Foam::functionObjects::stabilityBlendingFactor::write
virtual bool write()
Write the stabilityBlendingFactor.
Definition: stabilityBlendingFactor.C:719
Foam::read
bool read(const char *buf, int32_t &val)
Same as readInt32.
Definition: int32.H:108
Foam::functionObjects::fieldExpression::read
virtual bool read(const dictionary &dict)
Read the fieldExpression data.
Definition: fieldExpression.C:93
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::writeHeader
static void writeHeader(Ostream &os, const word &fieldName)
Definition: rawSurfaceWriterImpl.C:66
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
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::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
init
mesh init(true)
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
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
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:123
Foam::log
dimensionedScalar log(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:262
os
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
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::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
stabilityBlendingFactor.H
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::tab
constexpr char tab
Definition: Ostream.H:403
Foam::functionObjects::fieldExpression
Intermediate class for handling field expression function objects (e.g. blendingFactor etc....
Definition: fieldExpression.H:120
Foam::nl
constexpr char nl
Definition: Ostream.H:404
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
Foam::functionObjects::addToRunTimeSelectionTable
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
fvcGrad.H
Calculate the gradient of the given field.
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::tmp::New
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
Foam::direction
uint8_t direction
Definition: direction.H:52
Foam::functionObjects::defineTypeNameAndDebug
defineTypeNameAndDebug(ObukhovLength, 0)
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::functionObjects::log
Computes the natural logarithm of an input volScalarField.
Definition: log.H:227
Foam::functionObjects::writeFile
Base class for writing single files from the function objects.
Definition: writeFile.H:119
Foam::functionObjects::stabilityBlendingFactor::stabilityBlendingFactor
stabilityBlendingFactor(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: stabilityBlendingFactor.C:426
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::functionObjects::stabilityBlendingFactor::read
virtual bool read(const dictionary &)
Read the stabilityBlendingFactor data.
Definition: stabilityBlendingFactor.C:637
Foam::IOobject::scopedName
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
Definition: IOobjectI.H:47
Foam::cbrt
dimensionedScalar cbrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:155
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:188
zeroGradientFvPatchFields.H
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:328
Foam::VectorSpace< Vector< scalar >, scalar, 3 >::nComponents
static constexpr direction nComponents
Number of components in this vector space.
Definition: VectorSpace.H:101
Foam::functionObjects::stabilityBlendingFactor::writeFileHeader
virtual void writeFileHeader(Ostream &os) const
Write the file header.
Definition: stabilityBlendingFactor.C:85
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189
Foam::IOobject::MUST_READ
Definition: IOobject.H:185