42 void Foam::wallDist::constructn()
const 57 patchDistMethod::patchTypes<vector>(
mesh(), patchIDs_)
65 for (
const label patchi : patchIDs_)
67 nbf[patchi] ==
patches[patchi].nf();
74 Foam::wallDist::wallDist
78 const word& patchTypeName
85 Foam::wallDist::wallDist
88 const word& defaultPatchDistMethod,
90 const word& patchTypeName
93 MeshObject_type(
mesh),
95 patchTypeName_(patchTypeName),
100 patchTypeName_ &
"Dist" 110 defaultPatchDistMethod
117 "y" & patchTypeName_,
127 updateInterval_(dict_.getOrDefault<label>(
"updateInterval", 1)),
128 nRequired_(dict_.getOrDefault(
"nRequired", false)),
140 Foam::wallDist::wallDist(
const fvMesh&
mesh,
const word& patchTypeName)
145 mesh.boundaryMesh().findPatchIDs<wallPolyPatch>(),
180 <<
"n requested but 'nRequired' not specified in the " 181 << (patchTypeName_ &
"Dist") <<
" dictionary" <<
nl 182 <<
" Recalculating y and n fields." <<
endl;
186 pdm_->correct(y_, n_.ref());
197 (updateInterval_ > 0)
198 && ((mesh_.time().timeIndex() % updateInterval_) == 0)
201 requireUpdate_ =
true;
204 if (requireUpdate_ && pdm_->movePoints())
208 requireUpdate_ =
false;
212 return pdm_->correct(y_, n_.ref());
216 return pdm_->correct(y_);
226 pdm_->updateMesh(mpm);
232 requireUpdate_ =
true;
const labelList patchIDs(pbm.indices(polyPatchNames, true))
const volVectorField & n() const
Return reference to cached normal-to-wall field.
constexpr char nl
The newline '\n' character (0x0a)
wordList patchTypes(nPatches)
virtual ~wallDist()
Destructor.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
GeometricBoundaryField< vector, fvPatchField, volMesh > Boundary
Type of boundary fields.
const dimensionSet dimless
Dimensionless.
GeometricField< vector, fvPatchField, volMesh > volVectorField
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
const fvMesh & mesh() const noexcept
Reference to the mesh.
A class for handling words, derived from Foam::string.
Type * getObjectPtr(const word &name, const bool recursive=false) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
virtual void updateMesh(const mapPolyMesh &)
Update the y-field when the mesh changes.
virtual bool movePoints()
Update the y-field when the mesh moves.
virtual bool movePoints()=0
Update for mesh motion.
#define DebugInfo
Report an information message using Foam::Info.
const Time & time() const noexcept
Return Time associated with the objectRegistry.
bool isNull(const T *ptr) noexcept
True if ptr is a pointer (of type T) to the nullObject.
defineTypeNameAndDebug(combustionModel, 0)
static bool try_movePoints(const fvMesh &mesh)
Trigger update of y-field for the "wallDist" MeshObject on the given mesh. A no-op if the wallDist is...
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Selector class for finite volume differencing schemes. fvMesh is derived from fvSchemes so that all f...
Mesh data needed to do the Finite Volume discretisation.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
const polyBoundaryMesh & patches
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
Interface to run-time selectable methods to calculate the distance-to-wall and normal-to-wall fields...
Defines the attributes of an object for which implicit objectRegistry management is supported...
Specialisation of patchDist for wall distance calculation.
Do not request registration (bool: false)
PtrList< fvPatch > fvPatchList
Store lists of fvPatch as a PtrList.
static constexpr const zero Zero
Global zero (0)