41 namespace functionObjects
70 for (
const label patchi : patchIDs_)
73 const vectorField& Sfp = mesh_.Sf().boundaryField()[patchi];
74 const scalarField& magSfp = mesh_.magSf().boundaryField()[patchi];
77 ssp = (-Sfp/magSfp) & Reffp;
92 writeFile(mesh_,
name, typeName,
dict),
129 dict.readIfPresent(
"writeFields", writeFields_);
144 if (patchSet.
empty())
146 patchIDs_ = allWalls.sortedToc();
148 Info<<
" processing all (" << patchIDs_.size()
149 <<
") wall patches" <<
nl <<
endl;
153 allWalls &= patchSet;
154 patchSet -= allWalls;
157 if (!patchSet.
empty())
160 <<
"Requested wall shear stress on (" 161 << patchSet.
size() <<
") non-wall patches:" <<
nl;
163 for (
const label patchi : patchSet.
sortedToc())
170 Info<<
" processing (" << patchIDs_.size()
171 <<
") wall patches:" <<
nl;
173 for (
const label patchi : patchIDs_)
186 auto& wallShearStress =
193 const turbType* modelPtr =
198 calcShearStress(modelPtr->devRhoReff(), wallShearStress);
207 const turbType* modelPtr =
212 calcShearStress(modelPtr->devReff(), wallShearStress);
218 <<
"Unable to find turbulence model in the " 240 for (
const label patchi : patchIDs_)
244 const vectorField& ssp = wallShearStress.boundaryField()[patchi];
250 writeCurrentTime(file());
259 Log <<
" min/max(" <<
pp.name() <<
") = " 260 << limits.
min() <<
", " << limits.
max() <<
endl;
const polyBoundaryMesh & pbm
virtual OFstream & file()
Return access to the file (if only 1)
defineTypeNameAndDebug(ObukhovLength, 0)
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual bool read(const dictionary &)
Read the wallShearStress data.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
A min/max value pair with additional methods. In addition to conveniently storing values...
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
wallShearStress(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
bool store()
Register object with its registry and transfer ownership to the registry.
IncompressibleTurbulenceModel< transportModel > turbulenceModel
Ignore writing from objectRegistry::writeObject()
Templated wrapper class to provide compressible turbulence models thermal diffusivity based thermal t...
const Time & time() const
Return the top-level database.
Abstract base-class for Time/database function objects.
const ObjectType & lookupObject(const word &fieldName) const
Lookup and return object (eg, a field) from the (sub) objectRegistry.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
const word & name() const noexcept
Return the name of this functionObject.
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
virtual bool execute()
Calculate the wall shear-stress.
label size() const noexcept
The number of elements in table.
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.
const T & min() const noexcept
The min value (first)
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.
void calcShearStress(const volSymmTensorField &Reff, volVectorField &shearStress)
Calculate the shear-stress.
A class for handling words, derived from Foam::string.
wordList patchNames(nPatches)
A List of wordRe with additional matching capabilities.
Computes the wall-shear stress at selected wall patches.
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
virtual void writeFileHeader(Ostream &os) const
File header information.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
void reset(const dimensionSet &ds)
Copy assign the exponents from the dimensionSet.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
bool empty() const noexcept
True if the hash table is empty.
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.
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
virtual bool read(const dictionary &dict)
Read.
virtual bool write()
Report min/max and log to file, write the wall shear-stress volume field.
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
const polyBoundaryMesh & patches
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
const T & max() const noexcept
The max value (second)
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual bool read(const dictionary &dict)
Read optional controls.
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.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const dimensionSet & dimensions() const noexcept
Return dimensions.
static constexpr const zero Zero
Global zero (0)
virtual void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.