33 namespace thermophysicalFunctions
45 dictName_(dict.
name()),
46 Tlow_(dict.
lookup<scalar>(
"Tlow")),
47 Thigh_(dict.
lookup<scalar>(
"Thigh")),
48 values_(dict.
lookup(
"values"))
50 if (values_.
size() < 2)
54 <<
" " << dictName_ <<
nl 55 <<
" has less than 2 entries." 60 deltaT_ = (Thigh_ - Tlow_)/(values_.
size() - 1);
69 const scalar nd = (T - Tlow_)/deltaT_;
72 if (nd < 0 || i > values_.
size() - 2)
75 <<
"Temperature " << T <<
" out of range " 76 << Tlow_ <<
" to " << Thigh_ <<
nl 77 <<
" of table " << dictName_
81 const scalar Ti = Tlow_ + i*deltaT_;
82 const scalar
lambda = (T - Ti)/deltaT_;
84 return values_[i] + lambda*(values_[i + 1] - values_[i]);
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
defineTypeNameAndDebug(APIdiffCoef, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void size(const label)
Override size to be inconsistent with allocated storage.
table(const dictionary &dict)
Construct from dictionary.
void write(Ostream &os) const
Write the function coefficients.
Macros for easy insertion into run-time selection tables.
stressControl lookup("compactNormalStress") >> compactNormalStress
addToRunTimeSelectionTable(thermophysicalFunction, APIdiffCoef, dictionary)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
word name(const complex &)
Return a string representation of a complex.
dimensionedScalar lambda(laminarTransport.lookup("lambda"))
scalar f(scalar p, scalar T) const
Evaluate the function and return the result.