Class TreeCellFinder

Inheritance Relationships

Base Type

Class Documentation

class TreeCellFinder : public CellFinder

Class for searching for sampling cells using OpenFOAM indexed octrees.

For each wall face, the user-prescribed sampling height \(h\) is interpreted as a physical distance along the inward patch-normal direction. The TreeCellFinder does not support interpreting \(h\) as a consecutive off-wall cell index.

The single-cell search constructs a point \(h\) away from each wall-face centre and uses an octree over candidate volume cells to find the nearest cell to that point. If \(h \le 0\), no candidate cells are found, or the target point is outside the domain, the wall-adjacent cell is used instead.

The multi-cell search casts a wall-normal line from each wall face and collects the cells intersected by that line up to the requested distance. If the line exits the domain before reaching \(h\), the cells intersected before leaving the domain are retained. If no cells are intersected, the wall-adjacent cell is used. The optional excludeWallAdjacent argument removes the wall-adjacent cell only when at least one further cell remains.

Candidate cells are prefiltered using a wall-distance field, keeping cells closer than \(2\max(h)\) to the patch. The wall-distance field is read from disk when available and otherwise computed with OpenFOAM’s patchDistMethod.

Contributors/Copyright: 2019-2026 Timofey Mukha

Source files

Public Functions

TreeCellFinder(const fvPatch&)

Construct from patch.

TreeCellFinder(const word &TreeCellFinderName, const fvPatch&)

Construct from type, patch.

TreeCellFinder(const TreeCellFinder&) = default

Copy constructor.

inline virtual ~TreeCellFinder()

Destructor.

tmp<volScalarField> distanceField() const

Compute distance field.

void findCellIndices(labelList &indexList, const scalarField &h) const

Find the sampling cell indices for a single cell sampler.

void findCellIndices(labelListList &indexList, const scalarField &h, const bool excludeWallAdjacent) const

Find the sampling cell indices for a multi cell sampler.

tmp<labelField> findCandidateCellLabels(const scalarField &dist, const scalarField &h) const

Find cells closer than 2max(h) to the wall.