40 namespace functionObjects
53 label nPatchFaces = 0;
60 const globalIndex globalWalls(nPatchFaces);
81 label meshFacei =
patch.start()+patchFacei;
98 const label celli = faceCells[patchFacei];
105 label tetFacei = meshFacei;
106 label tetPti = (startInfo.index()+1) %
f.size();
108 start = startInfo.point();
111 tetIndices tet(celli, tetFacei, tetPti);
113 (1.0 - 1
e-6)*startInfo.point()
114 + 1
e-6*tet.tet(
mesh_).centre();
120 start = faceCellCentres[patchFacei];
126 start = faceCellCentres[patchFacei];
144 globalWalls.toGlobal(nPatchFaces)
164 for (
const findCellParticle& tp : cloud)
166 str.writeLine(tp.position(), tp.end());
189 for (
const findCellParticle& tp : cloud)
191 start[nPatchFaces++] = tp.position();
196 cloud.move(cloud,
td, maxTrackLen);
200 List<Map<label>> compactMap;
230 str.writeLine(ends[i], start[cData[i]]);
262 dict.readEntry(
"fields", fieldSet_);
263 dict.readEntry(
"distance", distance_);
266 patchIDs_ =
pbm.patchSet(
dict.get<
wordRes>(
"patches")).sortedToc();
276 reverseFieldMap_.clear();
282 fieldMap_.reserve(fieldSet_.size());
283 reverseFieldMap_.reserve(fieldSet_.size());
286 const word& fldName = fieldSet_[seti].first();
287 const word& sampleFldName = fieldSet_[seti].second();
289 fieldMap_.insert(fldName, sampleFldName);
290 reverseFieldMap_.insert(sampleFldName, fldName);
294 <<
": Sampling " << fieldMap_.size() <<
" fields" <<
endl;
312 && vSpheretf_.empty()
318 <<
": Creating " << fieldMap_.size() <<
" fields" <<
endl;
322 createFields(vSpheretf_);
323 createFields(vSymmtf_);
331 <<
" Sampling fields to " << time_.timeName()
336 sampleFields(vSpheretf_);
337 sampleFields(vSymmtf_);
348 Log <<
" Writing sampled fields to " << time_.timeName()
361 vSpheretf_[i].write();
static word defaultName
The default cloud name: defaultCloud.
const polyBoundaryMesh & pbm
defineTypeNameAndDebug(ObukhovLength, 0)
virtual bool write()
Write the near-wall fields.
fileName path() const
Return path = rootPath/caseName. Same as TimePaths::path()
A list of keyword definitions, which are a keyword followed by a number of values (eg...
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
labelList patchIDs_
Patches to sample.
constexpr char nl
The newline '\n' character (0x0a)
void calcAddressing()
Calculate addressing from cells back to patch faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
const Time & time() const
Return the top-level database.
Abstract base-class for Time/database function objects.
List< List< point > > cellToSamples_
From cell to tracked end point.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
UList< label > labelUList
A UList of labels.
bool read(const char *buf, int32_t &val)
Same as readInt32.
#define forAll(list, i)
Loop across all elements in list.
virtual bool end()
Called when Time::run() determines that the time-loop exits.
virtual bool execute()
Calculate the near-wall fields.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
virtual bool read(const dictionary &dict)
Read the controls.
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
void setSize(const label n)
Alias for resize()
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
autoPtr< mapDistribute > getPatchDataMapPtr_
Map from cell based data back to patch based data.
A class for handling words, derived from Foam::string.
#define DebugInFunction
Report an information message using Foam::Info.
scalar mag() const
The magnitude/length of the bounding box diagonal.
label size() const noexcept
The number of entries in the list.
labelListList cellToWalls_
From cell to seed patch faces.
A List of wordRe with additional matching capabilities.
virtual const faceList & faces() const
Return raw faces.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
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.
nearWallFields(const word &name, const Time &runTime, const dictionary &dict)
Construct for given objectRegistry and dictionary.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
static pointIndexHit facePoint(const polyMesh &, const label facei, const polyMesh::cellDecomposition)
Get a point on the face given a face decomposition method:
Samples near-patch volume fields within an input distance range.
vector point
Point is a vector.
label nCells() const noexcept
Number of mesh cells.
const std::string patch
OpenFOAM patch number as a std::string.
void findTetFacePt(const label celli, const point &p, label &tetFacei, label &tetPti) const
Find the tetFacei and tetPti for point p in celli.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
virtual bool read(const dictionary &dict)
Read optional controls.
SubField< vector > subField
Declare type of subField.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
const boundBox & bounds() const noexcept
Return mesh bounding box.
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< label > labelList
A List of labels.
scalar distance_
Distance away from wall.
const fvMesh & mesh_
Reference to the fvMesh.
static int debug
Flag to execute debug content.
#define InfoInFunction
Report an information message using Foam::Info.