40 namespace functionObjects
53 label nPatchFaces = 0;
60 globalIndex globalWalls(nPatchFaces);
65 Cloud<findCellParticle> cloud
69 IDLList<findCellParticle>()
86 label meshFacei =
patch.start()+patchFacei;
103 const label celli = faceCells[patchFacei];
110 label tetFacei = meshFacei;
111 label tetPti = (startInfo.index()+1) %
f.size();
113 start = startInfo.point();
116 tetIndices tet(celli, tetFacei, tetPti);
118 (1.0 - 1
e-6)*startInfo.point()
119 + 1
e-6*tet.tet(
mesh_).centre();
125 start = faceCellCentres[patchFacei];
131 start = faceCellCentres[patchFacei];
149 globalWalls.toGlobal(nPatchFaces)
169 for (
const findCellParticle& tp : cloud)
171 str.writeLine(tp.position(), tp.end());
194 for (
const findCellParticle& tp : cloud)
196 start[nPatchFaces++] = tp.position();
201 cloud.move(cloud, td, maxTrackLen);
205 List<Map<label>> compactMap;
235 str.writeLine(ends[i], start[cData[i]]);
265 dict.readEntry(
"fields", fieldSet_);
266 dict.readEntry(
"distance", distance_);
269 mesh_.boundaryMesh().patchSet
282 reverseFieldMap_.clear();
288 fieldMap_.resize(2*fieldSet_.size());
289 reverseFieldMap_.resize(2*fieldSet_.size());
292 const word& fldName = fieldSet_[seti].first();
293 const word& sampleFldName = fieldSet_[seti].second();
295 fieldMap_.insert(fldName, sampleFldName);
296 reverseFieldMap_.insert(sampleFldName, fldName);
300 <<
": Sampling " << fieldMap_.size() <<
" fields" <<
endl;
318 && vSpheretf_.empty()
324 <<
": Creating " << fieldMap_.size() <<
" fields" <<
endl;
328 createFields(vSpheretf_);
329 createFields(vSymmtf_);
337 <<
" Sampling fields to " << time_.timeName()
342 sampleFields(vSpheretf_);
343 sampleFields(vSymmtf_);
354 Log <<
" Writing sampled fields to " << time_.timeName()
367 vSpheretf_[i].write();
static word defaultName
The default cloud name: defaultCloud.
defineTypeNameAndDebug(ObukhovLength, 0)
virtual bool write()
Write the near-wall fields.
fileName path() const
Return path.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
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 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 elements 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.
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time 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.
const boundBox & bounds() const
Return mesh bounding box.
vector point
Point is a vector.
labelHashSet patchSet_
Patches to sample.
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)
virtual bool read(const dictionary &dict)
Read optional controls.
SubField< vector > subField
Declare type of subField.
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.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
#define InfoInFunction
Report an information message using Foam::Info.