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);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
void size(const label n)
Older name for setAddressableSize.
scalar Re() const
Real part of complex number.
Particle-size distribution model wherein random samples are drawn from a given arbitrary probability ...
Computes the near wall for turbulence models.
General relative velocity model.
bool interpolate() const noexcept
Same as isPointData()
List< scalar > yPlus_
Input y+ values.
virtual ~general()
Destructor.
List< scalar > uPlus_
Input U+ values.
virtual scalar interpolate(const scalar xi, const scalarList &x, const scalarList &fx) const
Interpolate.
interpolationType
Enumeration listing available interpolation types.
static const Enum< interpolationType > interpolationTypeNames_
virtual scalar Re(const scalar uPlus) const
Return Reynolds number as a function of u+.
virtual void invertTable()
Invert the table.
virtual void writeData(Ostream &os) const
Write to Ostream.
uniformInterpolationTable< scalar > invertedTable_
Inverted table.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
scalarField Re(const UList< complex > &cf)
Extract real component.
dimensionedScalar log10(const dimensionedScalar &ds)
List< scalar > scalarList
A List of scalars.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
const bool writeData(pdfDictionary.get< bool >("writeData"))