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 volScalarField::Boundary d = nearWallDist(mesh_).y();
84 const volScalarField::Boundary nutBf =
85 turbModel.nut()().boundaryField();
87 const volScalarField::Boundary nuEffBf =
88 turbModel.nuEff()().boundaryField();
90 const volScalarField::Boundary nuBf =
91 turbModel.nu()().boundaryField();
97 const fvPatch& patch = patches[
patchi];
99 if (isA<nutWallFunctionFvPatchScalarField>(nutBf[patchi]))
101 const nutWallFunctionFvPatchScalarField& nutPf =
102 dynamic_cast<const nutWallFunctionFvPatchScalarField&
> 107 yPlusBf[
patchi] = nutPf.yPlus();
109 else if (isA<wallFvPatch>(patch))
116 *
mag(turbModel.U().boundaryField()[
patchi].snGrad())
174 momentumTransportModel::typeName,
181 return store(name, calcYPlus(model));
186 <<
"Unable to find turbulence model in the " 208 const volScalarField::Boundary& yPlusBf = yPlus.
boundaryField();
215 if (isA<wallFvPatch>(patch))
219 const scalar minYplus =
gMin(yPlusp);
220 const scalar maxYplus =
gMax(yPlusp);
221 const scalar avgYplus =
gAverage(yPlusp);
225 Log <<
" patch " << patch.
name()
226 <<
" y+ : min = " << minYplus <<
", max = " << maxYplus
227 <<
", 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 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< fluidThermo > 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.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
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.
Specialization 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...