38 namespace tabulatedWallFunctions
43 tabulatedWallFunction,
56 { interpolationType::itLinear,
"linear" },
100 else if (xi >=
x.last())
113 return (xi -
x[i1])/(
x[i2] -
x[i1])*(fx[i2] - fx[i1]) + fx[i1];
121 <<
"Unknown interpolation method" <<
nl 134 const dictionary&
dict,
138 tabulatedWallFunction(
dict,
mesh, typeName),
139 interpType_(interpolationTypeNames_.
get(
"interpType", coeffDict_)),
140 log10YPlus_(coeffDict_.
get<bool>(
"log10YPlus")),
141 log10UPlus_(coeffDict_.
get<bool>(
"log10UPlus")),
145 List<Tuple2<scalar, scalar>> inputTable;
147 coeffDict_.readEntry(
"inputTable", inputTable);
149 if (inputTable.size() < 2)
152 <<
"Input table must have at least 2 values" <<
nl 156 yPlus_.setSize(inputTable.size());
157 uPlus_.setSize(inputTable.size());
163 yPlus_[i] =
pow(10, inputTable[i].first());
167 yPlus_[i] = inputTable[i].first();
172 uPlus_[i] =
pow(10, inputTable[i].second());
176 uPlus_[i] = inputTable[i].second();
219 if (invertedTable_.log10())
221 os <<
"log10(Re), y+, u+:" <<
endl;
224 scalar
uPlus = invertedTable_[i];
232 os <<
"Re, y+, u+:" <<
endl;
235 scalar
uPlus = invertedTable_[i];
236 scalar
Re = this->
Re(uPlus);
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
List< scalar > scalarList
List of scalar.
void size(const label n)
Older name for setAddressableSize.
List< scalar > yPlus_
Input y+ values.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static void writeData(Ostream &os, const Type &val)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual ~general()
Destructor.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
general(const dictionary &dict, const polyMesh &mesh)
virtual scalar yPlus(const scalar uPlus) const
Return y+ as a function of u+.
errorManip< error > abort(error &err)
interpolationType
Enumeration listing available interpolation types.
virtual void invertTable()
Invert the table.
int debug
Static debugging option.
List< scalar > uPlus_
Input U+ values.
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
virtual void writeData(Ostream &os) const
Write to Ostream.
scalarField Re(const UList< complex > &cmplx)
Extract real component.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
static const Enum< interpolationType > interpolationTypeNames_
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
virtual scalar interpolate(const scalar xi, const scalarList &x, const scalarList &fx) const
Interpolate.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual scalar Re(const scalar uPlus) const
Return Reynolds number as a function of u+.
uniformInterpolationTable< scalar > invertedTable_
Inverted table.
dimensionedScalar log10(const dimensionedScalar &ds)
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)