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;
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 =
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() <<
") = "
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const polyBoundaryMesh & pbm
const dimensionSet & dimensions() const noexcept
Return dimensions.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
bool empty() const noexcept
True if the hash table is empty.
label size() const noexcept
The number of elements in table.
@ REGISTER
Request registration (bool: true).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A min/max value pair with additional methods. In addition to conveniently storing values,...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
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.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void reset(const dimensionSet &ds)
Copy assign the exponents from the dimensionSet.
Abstract base-class for Time/database function objects.
const word & name() const noexcept
Return the name of this functionObject.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
word scopedName(const word &name) const
Return a scoped (prefixed) name.
const fvMesh & mesh_
Reference to the fvMesh.
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
const ObjectType & lookupObject(const word &fieldName) const
Lookup and return object (eg, a field) from the (sub) objectRegistry.
const objectRegistry & obr_
Reference to the region objectRegistry.
const ObjectType * findObject(const word &fieldName) const
Return const pointer to the object (eg, a field) in the (sub) objectRegistry.
Computes the wall-shear stress at selected wall patches.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
virtual void writeFileHeader(Ostream &os) const
File header information.
wallShearStress(const word &name, const Time &runTime, const dictionary &)
Construct from name, Time and dictionary.
virtual bool execute()
Execute the function-object operations.
void calcShearStress(const volSymmTensorField &Reff, volVectorField &shearStress)
Calculate the shear-stress.
virtual bool write()
Write the function-object results.
labelList patchIDs_
Wall patches to process (optionally filtered by name).
virtual void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.
writeFile(const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true, const string &ext=".dat")
Construct from objectRegistry, prefix, fileName.
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
virtual bool read(const dictionary &dict)
Read.
virtual OFstream & file()
Return access to the file (if only 1).
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
virtual void writeCurrentTime(Ostream &os) const
Write the current time to stream.
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
const Time & time() const
Return the top-level database.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
bool store()
Register object with its registry and transfer ownership to the registry.
static const word propertiesName
Default name of the turbulence properties dictionary.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const polyBoundaryMesh & patches
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
IncompressibleTurbulenceModel< transportModel > turbulenceModel
GeometricField< vector, fvPatchField, volMesh > volVectorField
PtrList< fvPatch > fvPatchList
Store lists of fvPatch as a PtrList.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere).
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
Field< vector > vectorField
Specialisation of Field<T> for vector.
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
constexpr char nl
The newline '\n' character (0x0a).
wordList patchNames(nPatches)