40 namespace functionObjects
50 void Foam::functionObjects::yPlus::writeFileHeader(Ostream&
os)
const 74 useWallFunction_(true),
79 writeFileHeader(
file());
109 useWallFunction_ =
true;
112 dict.readIfPresent(
"useWallFunction", useWallFunction_);
113 dict.readIfPresent(
"writeFields", writeFields_);
124 auto&
yPlus = lookupObjectRef<volScalarField>(scopedName(typeName));
131 lookupObject<turbulenceModel>
152 const auto* nutWallPatch =
153 isA<nutWallFunctionFvPatchScalarField>(nutBf[patchi]);
155 if (useWallFunction_ && nutWallPatch)
157 yPlusBf[patchi] = nutWallPatch->yPlus();
159 else if (isA<wallFvPatch>(
patch))
174 <<
"Unable to find turbulence model in the " 175 <<
"database: yPlus will not be calculated" <<
endl;
180 <<
"Please try to use the solver option -postProcess, e.g.:" 181 <<
" <solver> -postProcess -func yPlus" <<
endl;
210 if (isA<wallFvPatch>(
patch))
214 const scalar minYplus =
gMin(yPlusp);
215 const scalar maxYplus =
gMax(yPlusp);
216 const scalar avgYplus =
gAverage(yPlusp);
220 writeCurrentTime(file());
230 <<
" y+ : min = " << minYplus
231 <<
", max = " << maxYplus
232 <<
", average = " << avgYplus <<
endl;
virtual bool read(const dictionary &)
Read the yPlus data.
virtual OFstream & file()
Return access to the file (if only 1)
defineTypeNameAndDebug(ObukhovLength, 0)
virtual bool write()
Report min/max/avg (per patch) and log to file, write the yPlus volume field.
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const volVectorField & U() const
Access function to velocity field.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
virtual bool execute()
Calculate the yPlus field.
Type gMin(const FieldField< Field, Type > &f)
constexpr char nl
The newline '\n' character (0x0a)
virtual tmp< volScalarField > nu() const =0
Return the laminar viscosity.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
bool store()
Register object with its registry and transfer ownership to the registry.
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
Type of boundary fields.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
const Time & time() const
Return the top-level database.
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.
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
#define forAll(list, i)
Loop across all elements in list.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Distance calculation for cells with face on a wall. Searches pointNeighbours to find closest...
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
Type gMax(const FieldField< Field, Type > &f)
virtual tmp< volScalarField > nuEff() const =0
Return the effective viscosity.
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
yPlus(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual bool read(const dictionary &dict)
Read.
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Type gAverage(const FieldField< Field, Type > &f)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
const polyBoundaryMesh & patches
const std::string patch
OpenFOAM patch number as a std::string.
virtual bool read(const dictionary &dict)
Read optional controls.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
virtual tmp< volScalarField > nut() const =0
Return the turbulence viscosity.
A class for managing temporary objects.
Base class for writing single files from the function objects.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Request registration (bool: true)
word scopedName(const word &name) const
Return a scoped (prefixed) name.
const fvMesh & mesh_
Reference to the fvMesh.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
PtrList< fvPatch > fvPatchList
Store lists of fvPatch as a PtrList.
static constexpr const zero Zero
Global zero (0)
virtual void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.