39 namespace functionObjects
45 wallBoundedStreamLine,
66 scalar minDistSqr =
sqr(GREAT);
67 point nearestPt(GREAT, GREAT, GREAT);
69 for (label facei : cFaces)
71 if (isWallPatch[facei])
77 label fp =
f.fcIndex(fp0);
78 for (label i = 2; i <
f.size(); i++)
81 const label nextFp =
f.fcIndex(fp);
84 const triPointRef tri(basePoint, thisPoint, nextPoint);
88 const scalar d2 = nearInfo.
distance();
91 nearestPt = nearInfo.point();
128 return (1.0 - ROOTSMALL)*pt + ROOTSMALL*tri.
centre();
157 const sampledSet& seedPoints = sampledSetPoints();
161 const label celli = seedPoints.
cells()[seedi];
165 const point& seedPt = seedPoints[seedi];
168 findNearestTet(isWallPatch, seedPt, celli)
172 if (ids.
face() != -1 && isWallPatch[ids.
face()])
194 (trackDir_ == trackDirType::FORWARD),
199 if (trackDir_ == trackDirType::BIDIRECTIONAL)
222 Pout<<
type() <<
" : ignoring seed " << seedPt
223 <<
" since not in wall cell." <<
endl;
231 Log <<
type() <<
" : seeded " << nSeeds <<
" particles." <<
endl;
240 initInterpolations(nSeeds, vsInterp, vvInterp)
264 particles.
move(particles, td, trackTime);
307 faceSet faces(mesh_,
"lowQualityTetFaces", mesh_.nFaces()/100+1);
323 <<
"Found " << nFaces
324 <<
" faces with low quality or negative volume " 325 <<
"decomposition tets. Writing to faceSet " << faces.name()
331 for (
const cell& cFaces : mesh_.cells())
333 numFacesPerEdge.
clear();
335 for (
const label facei : cFaces)
337 const face&
f = mesh_.faces()[facei];
340 const edge e(
f[fp],
f.nextLabel(fp));
342 ++(numFacesPerEdge(
e, 0));
351 <<
"problem cell:" << cFaces
Template class for intrusive linked lists.
defineTypeNameAndDebug(ObukhovLength, 0)
A triangle primitive used to calculate face normals and swept volumes. Uses referred points...
wallBoundedStreamLine(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Like polyPatch but without reference to mesh. Used in boundaryMesh to hold data on patches...
A face is a list of labels corresponding to mesh vertices.
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.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
triPointRef faceTri(const polyMesh &mesh) const
The triangle geometry for the face for this tet. The normal of the tri points out of the cell...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
virtual void track()
Do the actual tracking to fill the track data.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool read(const dictionary &)
Read settings.
label size() const noexcept
The number of elements in table.
const cellList & cells() const
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for managing references or pointers (no reference counting)
Macros for easy insertion into run-time selection tables.
bool read(const char *buf, int32_t &val)
Same as readInt32.
A Cloud of streamLine particles.
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
static bool checkFaceTets(const polyMesh &mesh, scalar tol=minTetQuality, const bool report=false, labelHashSet *setPtr=nullptr)
Check face-decomposition tet volume.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
pointHit nearestPoint(const point &p) const
Return nearest point to p on triangle.
const dimensionedScalar e
Elementary charge.
static Point centre(const Point &p0, const Point &p1, const Point &p2)
The centre (centroid) of three points.
void addParticle(ParticleType *pPtr)
Transfer particle to cloud.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
point pushIn(const triPointRef &tri, const point &pt) const
Push a point a tiny bit towards the centre of the triangle it is in to avoid tracking problems...
Holds list of sampling points which is filled at construction time. Various implementations of this b...
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
virtual bool read(const dictionary &)
Read the field average data.
label cell() const noexcept
Return the cell index.
A class for handling words, derived from Foam::string.
void clear()
Clear all entries from table.
label tetPt() const noexcept
Return the characterising tet point index.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
Describes the interaction of a object and a (templated) point. It carries the info of a successful hi...
virtual const faceList & faces() const
Return raw faces.
errorManip< error > abort(error &err)
Tuple2< tetIndices, point > findNearestTet(const bitSet &isWallPatch, const point &seedPt, const label celli) const
Find wall tet on cell.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int debug
Static debugging option.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
void move(TrackCloudType &cloud, typename ParticleType::trackingData &td, const scalar trackTime)
Move the particles.
label face() const noexcept
Return the face index.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
#define WarningInFunction
Report a warning using Foam::Warning.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
A cell is defined as a list of faces with extra functionality.
const T2 & second() const noexcept
Access the second element.
scalar distance() const noexcept
Return distance to hit.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Class used to pass tracking data to the trackToEdge function.
const labelList & cells() const noexcept
Particle class that samples fields as it passes through. Used in streamline calculation.
const T1 & first() const noexcept
Access the first element.
const fvMesh & mesh_
Reference to the fvMesh.
static const scalar minTetQuality
Minimum tetrahedron quality.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
forAllConstIters(mixture.phases(), phase)