36 namespace functionObjects
52 void Foam::functionObjects::yPlus::writeFileHeader(
const label i)
54 writeHeader(file(),
"y+ ()");
56 writeCommented(file(),
"Time");
57 writeTabbed(file(),
"patch");
58 writeTabbed(file(),
"min");
59 writeTabbed(file(),
"max");
60 writeTabbed(file(),
"average");
65 void Foam::functionObjects::yPlus::calcYPlus
72 volScalarField::Boundary d = nearWallDist(mesh).y();
74 const volScalarField::Boundary nutBf =
75 turbModel.nut()().boundaryField();
77 const volScalarField::Boundary nuEffBf =
78 turbModel.nuEff()().boundaryField();
80 const volScalarField::Boundary nuBf =
81 turbModel.nu()().boundaryField();
85 volScalarField::Boundary& yPlusBf = yPlus.boundaryFieldRef();
89 const fvPatch& patch = patches[
patchi];
91 if (isA<nutWallFunctionFvPatchScalarField>(nutBf[patchi]))
93 const nutWallFunctionFvPatchScalarField& nutPf =
94 dynamic_cast<const nutWallFunctionFvPatchScalarField&
> 99 yPlusBf[
patchi] = nutPf.yPlus();
101 else if (isA<wallFvPatch>(patch))
108 *
mag(turbModel.U().boundaryField()[
patchi].snGrad())
117 Foam::functionObjects::yPlus::yPlus
126 if (!isA<fvMesh>(obr_))
132 const fvMesh& mesh = refCast<const fvMesh>(obr_);
151 mesh.objectRegistry::store(yPlusPtr);
175 const fvMesh& mesh = refCast<const fvMesh>(obr_);
188 calcYPlus(model, mesh, yPlus);
193 <<
"Unable to find turbulence model in the " 207 <<
" writing field " << yPlus.
name() <<
endl;
213 const volScalarField::Boundary& yPlusBf = yPlus.
boundaryField();
215 const fvMesh& mesh = refCast<const fvMesh>(obr_);
222 if (isA<wallFvPatch>(patch))
226 const scalar minYplus =
gMin(yPlusp);
227 const scalar maxYplus =
gMax(yPlusp);
228 const scalar avgYplus =
gAverage(yPlusp);
232 Log <<
" patch " << patch.
name()
233 <<
" y+ : min = " << minYplus <<
", max = " << maxYplus
234 <<
", average = " << avgYplus <<
nl;
virtual bool read(const dictionary &)
Read the yPlus data.
#define forAll(list, i)
Loop across all elements in list.
virtual bool write()
Write the yPlus field.
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...
bool foundObject(const word &name) const
Is the named Type found?
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual bool execute()
Calculate the yPlus field.
Type gMin(const FieldField< Field, Type > &f)
functionObject base class for writing files
const word & name() const
Return name.
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
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.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Abstract base class for turbulence models (RAS, LES and laminar).
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
virtual bool read(const dictionary &)
Read optional controls.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from string.
Type gMax(const FieldField< Field, Type > &f)
word name(const complex &)
Return a string representation of a complex.
PtrList< fvPatch > fvPatchList
container classes for fvPatch
virtual ~yPlus()
Destructor.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
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...
addToRunTimeSelectionTable(functionObject, blendingFactor, dictionary)
Mesh data needed to do the Finite Volume discretisation.
virtual bool write()
Write function.
virtual bool write() const
Write using setting from DB.
#define Log
Report write to Foam::Info if the local log switch is true.
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(fvMeshFunctionObject, 0)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
const word & name() const
Return name.
const Time & time() const
Return the top-level database.