34 namespace tabulatedWallFunctions
39 tabulatedWallFunction,
71 Rey[i] = yPlus_[i]*uPlus_[i];
72 if (invertedTable_.log10())
81 scalar Re = i*invertedTable_.dx() + invertedTable_.x0();
102 else if (xi >= x.last())
115 return (xi - x[i1])/(x[i2] - x[i1])*(fx[i2] - fx[i1]) + fx[i1];
123 <<
"Unknown interpolation method" <<
nl 136 const dictionary& dict,
140 tabulatedWallFunction(dict, mesh, typeName),
141 interpType_(interpolationTypeNames_[coeffDict_.
lookup(
"interpType")]),
144 log10YPlus_(coeffDict_.
lookup(
"log10YPlus")),
145 log10UPlus_(coeffDict_.
lookup(
"log10UPlus"))
147 List<Tuple2<scalar, scalar>> inputTable = coeffDict_.lookup(
"inputTable");
148 if (inputTable.size() < 2)
151 <<
"Input table must have at least 2 values" <<
nl 155 yPlus_.setSize(inputTable.size());
156 uPlus_.setSize(inputTable.size());
162 yPlus_[i] =
pow(10, inputTable[i].first());
166 yPlus_[i] = inputTable[i].first();
171 uPlus_[i] =
pow(10, inputTable[i].second());
175 uPlus_[i] = inputTable[i].second();
210 return uPlus*
yPlus(uPlus);
218 if (invertedTable_.log10())
220 os <<
"log10(Re), y+, u+:" <<
endl;
223 scalar
uPlus = invertedTable_[i];
226 os << Re <<
", " << yPlus <<
", " << uPlus <<
endl;
231 os <<
"Re, y+, u+:" <<
endl;
234 scalar
uPlus = invertedTable_[i];
235 scalar Re = this->
Re(uPlus);
237 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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual ~general()
Destructor.
Initialise the NamedEnum HashTable from the static list of names.
Macros for easy insertion into run-time selection tables.
general(const dictionary &dict, const polyMesh &mesh)
stressControl lookup("compactNormalStress") >> compactNormalStress
List< scalar > scalarList
A List of scalars.
virtual scalar interpolate(const scalar xi, const scalarList &x, const scalarList &fx) const
Interpolate.
errorManip< error > abort(error &err)
interpolationType
Enumeration listing available interpolation types.
virtual void invertTable()
Invert the table.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
virtual scalar Re(const scalar uPlus) const
Return Reynolds number as a function of u+.
defineTypeNameAndDebug(combustionModel, 0)
const bool writeData(readBool(pdfDictionary.lookup("writeData")))
static const NamedEnum< interpolationType, 1 > interpolationTypeNames_
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
scalarField Re(const UList< complex > &cf)
dimensionedScalar log10(const dimensionedScalar &ds)
virtual scalar yPlus(const scalar uPlus) const
Return y+ as a function of u+.
virtual void writeData(Ostream &os) const
Write to Ostream.