36 namespace functionObjects
52 void Foam::functionObjects::yPlus::writeFileHeader(
const label i)
56 writeCommented(
file(),
"Time");
57 writeTabbed(
file(),
"patch");
58 writeTabbed(
file(),
"min");
59 writeTabbed(
file(),
"max");
60 writeTabbed(
file(),
"average");
70 tmp<volScalarField> tyPlus
80 volScalarField::Boundary& yPlusBf = tyPlus.ref().boundaryFieldRef();
82 const nearWallDist nwd(mesh_);
83 const volScalarField::Boundary& d = nwd.y();
85 const tmp<volScalarField> tnut = turbModel.nut();
86 const volScalarField::Boundary& nutBf = tnut().boundaryField();
88 const tmp<volScalarField> tnuEff = turbModel.nuEff();
89 const volScalarField::Boundary& nuEffBf = tnuEff().boundaryField();
91 const tmp<volScalarField> tnu = turbModel.nu();
92 const volScalarField::Boundary& nuBf = tnu().boundaryField();
98 const fvPatch& patch = patches[
patchi];
100 if (isA<nutWallFunctionFvPatchScalarField>(nutBf[patchi]))
102 const nutWallFunctionFvPatchScalarField& nutPf =
103 dynamic_cast<const nutWallFunctionFvPatchScalarField&
> 108 yPlusBf[
patchi] = nutPf.yPlus();
110 else if (isA<wallFvPatch>(patch))
117 *
mag(turbModel.U().boundaryField()[
patchi].snGrad())
176 momentumTransportModel::typeName,
183 return store(name, calcYPlus(model));
188 <<
"Unable to find turbulence model in the " 210 const volScalarField::Boundary& yPlusBf = yPlus.
boundaryField();
217 if (isA<wallFvPatch>(patch))
221 const scalar minYplus =
gMin(yPlusp);
222 const scalar maxYplus =
gMax(yPlusp);
223 const scalar avgYplus =
gAverage(yPlusp);
227 Log <<
" patch " << patch.
name()
228 <<
" y+ : min = " << minYplus <<
", max = " << maxYplus
229 <<
", average = " << avgYplus <<
nl;
virtual bool read(const dictionary &)
Read the yPlus data.
virtual bool write()
Write function.
Calculates the natural logarithm of the specified scalar field.
#define forAll(list, i)
Loop across all elements in list.
virtual bool write()
Write the yPlus field.
virtual bool write()
Write function.
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)
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.
virtual bool execute()
Calculate the yPlus field.
Type gMin(const FieldField< Field, Type > &f)
const Boundary & boundaryField() const
Return const-reference to the boundary field.
addToRunTimeSelectionTable(functionObject, Qdot, dictionary)
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
static bool master(const label communicator=0)
Am I the master process.
const dimensionSet dimless
const ObjectType & lookupObject(const word &fieldName) const
Lookup object from the objectRegistry.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
CompressibleMomentumTransportModel< dynamicTransportModel > momentumTransportModel
virtual bool read(const dictionary &)
Read optional controls.
bool read(const char *, int32_t &)
void writeHeader(std::ostream &, const bool isBinary, const std::string &title)
Write header.
A class for handling words, derived from string.
static word groupName(Name name, const word &group)
static const word null
An empty word.
Type gMax(const FieldField< Field, Type > &f)
yPlus(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
word name(const complex &)
Return a string representation of a complex.
defineTypeNameAndDebug(Qdot, 0)
Abstract base class for turbulence models (RAS, LES and laminar).
PtrList< fvPatch > fvPatchList
container classes for fvPatch
virtual ~yPlus()
Destructor.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Type gAverage(const FieldField< Field, Type > &f)
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
FunctionObject base class for managing a list of objects on behalf of the inheriting function object...
virtual bool read(const dictionary &)
Read the list of objects to be written.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
#define Log
Report write to Foam::Info if the local log switch is true.
dimensioned< scalar > mag(const dimensioned< Type > &)
virtual const word & name() const
Return name.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Evaluates and outputs turbulence y+ for models. Values written to time directories as field 'yPlus' o...
A class for managing temporary objects.
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...