33 namespace tabulatedWallFunctions
38 tabulatedWallFunction,
62 if (invertedTable_.log10())
64 Re =
pow(10, (i*invertedTable_.dx() + invertedTable_.x0()));
68 Re = i*invertedTable_.dx() + invertedTable_.x0();
74 uPlus = invertedTable_[i-1];
82 scalar kUPlus =
min(kappa_*uPlus, 50);
86 *(
exp(kUPlus) -
pow3(kUPlus)/6 - 0.5*
sqr(kUPlus) - kUPlus - 1);
88 scalar f = - Re + A/E_;
93 +
exp(kUPlus)*(kUPlus + 1)
100 scalar uPlusNew = uPlus - f/(df + ROOTVSMALL);
101 error =
mag((uPlus - uPlusNew)/uPlusNew);
103 }
while (error > tolerance_ && ++iter < maxIters_);
105 if (iter == maxIters_)
108 <<
"Newton iterations not converged:" <<
nl 109 <<
" iters = " << iter <<
", error = " << error <<
endl;
113 invertedTable_[i] =
max(0, uPlus);
122 const dictionary& dict,
126 tabulatedWallFunction(dict, mesh, typeName),
156 + 1/
E_*(
exp(kUPlus) -
pow3(kUPlus)/6 - 0.5*
sqr(kUPlus) - kUPlus - 1);
165 return uPlus*
yPlus(uPlus);
173 os <<
"log10(Re), y+, u+:" <<
endl;
179 os << Re <<
", " << yPlus <<
", " << uPlus <<
endl;
184 os <<
"Re, y+, u+:" <<
endl;
188 scalar Re = this->
Re(uPlus);
190 os << Re <<
", " << yPlus <<
", " << uPlus <<
endl;
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const double e
Elementary charge.
virtual ~SpaldingsLaw()
Destructor.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
static const label maxIters_
Maximum number of iterations.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
virtual void invertFunction()
Invert the function.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Macros for easy insertion into run-time selection tables.
virtual void writeData(Ostream &os) const
Write to Ostream.
stressControl lookup("compactNormalStress") >> compactNormalStress
dimensionedScalar exp(const dimensionedScalar &ds)
scalar E_
Law-of-the-wall E coefficient.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
const bool writeData(readBool(pdfDictionary.lookup("writeData")))
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
virtual scalar Re(const scalar uPlus) const
Return Reynolds number as a function of u+.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar pow3(const dimensionedScalar &ds)
#define WarningInFunction
Report a warning using Foam::Warning.
virtual scalar yPlus(const scalar uPlus) const
Return y+ as a function of u+.
static const scalar tolerance_
Tolerance.
dimensioned< scalar > mag(const dimensioned< Type > &)
uniformInterpolationTable< scalar > invertedTable_
Inverted table.
SpaldingsLaw(const dictionary &dict, const polyMesh &mesh)
dimensionedScalar log10(const dimensionedScalar &ds)
scalar kappa_
Von Karman constant.