averageNeighbourFvGeometryScheme Class Reference

Geometry calculation scheme to minimise non-orthogonality/. More...

Inheritance diagram for averageNeighbourFvGeometryScheme:
[legend]
Collaboration diagram for averageNeighbourFvGeometryScheme:
[legend]

Public Member Functions

 TypeName ("averageNeighbour")
 Runtime type information. More...
 
 averageNeighbourFvGeometryScheme (const fvMesh &mesh, const dictionary &dict)
 Construct from mesh. More...
 
virtual ~averageNeighbourFvGeometryScheme ()=default
 Destructor. More...
 
virtual void movePoints ()
 Do what is necessary if the mesh has moved. More...
 
- Public Member Functions inherited from highAspectRatioFvGeometryScheme
 TypeName ("highAspectRatio")
 Runtime type information. More...
 
 highAspectRatioFvGeometryScheme (const fvMesh &mesh, const dictionary &dict)
 Construct from mesh. More...
 
virtual ~highAspectRatioFvGeometryScheme ()=default
 Destructor. More...
 
- Public Member Functions inherited from basicFvGeometryScheme
 TypeName ("basic")
 Runtime type information. More...
 
 basicFvGeometryScheme (const fvMesh &mesh, const dictionary &dict)
 Construct from mesh. More...
 
virtual ~basicFvGeometryScheme ()=default
 Destructor. More...
 
virtual tmp< surfaceScalarFieldweights () const
 Return linear difference weighting factors. More...
 
virtual tmp< surfaceScalarFielddeltaCoeffs () const
 Return cell-centre difference coefficients. More...
 
virtual tmp< surfaceScalarFieldnonOrthDeltaCoeffs () const
 Return non-orthogonal cell-centre difference coefficients. More...
 
virtual tmp< surfaceVectorFieldnonOrthCorrectionVectors () const
 Return non-orthogonality correction vectors. More...
 
- Public Member Functions inherited from fvGeometryScheme
 TypeName ("fvGeometryScheme")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (tmp, fvGeometryScheme, dict,(const fvMesh &mesh, const dictionary &dict),(mesh, dict))
 
 fvGeometryScheme (const fvMesh &mesh, const dictionary &dict)
 Construct from mesh. More...
 
virtual ~fvGeometryScheme ()=default
 Destructor. More...
 
const fvMeshmesh () const
 Return mesh reference. More...
 
- Public Member Functions inherited from refCount
constexpr refCount () noexcept
 Default construct, initializing count to 0. More...
 
int count () const noexcept
 Return the current reference count. More...
 
bool unique () const noexcept
 Return true if the reference count is zero. More...
 
void operator++ () noexcept
 Increment the reference count. More...
 
void operator++ (int) noexcept
 Increment the reference count. More...
 
void operator-- () noexcept
 Decrement the reference count. More...
 
void operator-- (int) noexcept
 Decrement the reference count. More...
 

Protected Member Functions

label clipFaceTet (const scalar minRatio, const vectorField &faceCentres, const vectorField &faceNormals, vectorField &faceCorrection) const
 
void makePyrHeights (const pointField &cellCentres, const vectorField &faceCentres, const vectorField &faceNormals, scalarField &ownHeight, scalarField &neiHeight) const
 Calculate pyramid heights. More...
 
label clipPyramids (const pointField &cellCentres, const vectorField &faceCentres, const vectorField &faceNormals, const scalarField &minOwnHeight, const scalarField &minNeiHeight, vectorField &correction) const
 
tmp< pointFieldaverageNeighbourCentres (const pointField &cellCentres, const vectorField &faceNormals, const scalarField &faceWeights) const
 Average neighbouring cell centres to minimise non-ortho. More...
 
tmp< pointFieldaverageCentres (const pointField &cellCentres, const pointField &faceCentres, const vectorField &faceNormals) const
 
void makeNonOrthoWeights (const pointField &cellCentres, const vectorField &faceNormals, scalarField &cosAngles, scalarField &faceWeights) const
 Make weights based on non-orthogonality. More...
 
- Protected Member Functions inherited from highAspectRatioFvGeometryScheme
void calcAspectRatioWeights (scalarField &cellWeight, scalarField &faceWeight) const
 Calculate cell and face weight. Is 0 for cell < minAspect, 1 for. More...
 

Protected Attributes

const label nIters_
 Number of averaging iterations. More...
 
const scalar relax_
 Blending between old-iteration cell centres and current average. More...
 
const scalar minRatio_
 Clipping for pyramid heights - allowable shrinkage as fraction. More...
 
- Protected Attributes inherited from highAspectRatioFvGeometryScheme
const scalar minAspect_
 
const scalar maxAspect_
 
- Protected Attributes inherited from fvGeometryScheme
const fvMeshmesh_
 Hold reference to mesh. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from fvGeometryScheme
static tmp< fvGeometrySchemeNew (const fvMesh &mesh, const dictionary &dict, const word &defaultScheme)
 Return new tmp interpolation scheme. More...
 
- Static Protected Member Functions inherited from highAspectRatioFvGeometryScheme
static void makeAverageCentres (const polyMesh &mesh, const pointField &points, const pointField &faceAreas, const scalarField &magFaceAreas, pointField &faceCentres, pointField &cellCentres)
 Helper : calculate (weighted) average face and cell centres. More...
 

Detailed Description

Geometry calculation scheme to minimise non-orthogonality/.

Source files

Definition at line 52 of file averageNeighbourFvGeometryScheme.H.

Constructor & Destructor Documentation

◆ averageNeighbourFvGeometryScheme()

averageNeighbourFvGeometryScheme ( const fvMesh mesh,
const dictionary dict 
)

Construct from mesh.

Definition at line 573 of file averageNeighbourFvGeometryScheme.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), and Foam::Pout.

Here is the call graph for this function:

◆ ~averageNeighbourFvGeometryScheme()

virtual ~averageNeighbourFvGeometryScheme ( )
virtualdefault

Destructor.

Member Function Documentation

◆ clipFaceTet()

Foam::label clipFaceTet ( const scalar  minRatio,
const vectorField faceCentres,
const vectorField faceNormals,
vectorField faceCorrection 
) const
protected

Clip face-centre correction vector if new triangle area would get below min. Return number of clipped faces.

Definition at line 55 of file averageNeighbourFvGeometryScheme.C.

References f(), faceNormals(), forAll, Foam::mag(), n, nCorr, p, and Foam::returnReduce().

Referenced by averageNeighbourFvGeometryScheme::movePoints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makePyrHeights()

void makePyrHeights ( const pointField cellCentres,
const vectorField faceCentres,
const vectorField faceNormals,
scalarField ownHeight,
scalarField neiHeight 
) const
protected

Calculate pyramid heights.

Definition at line 133 of file averageNeighbourFvGeometryScheme.C.

References faceNormals(), and n.

Referenced by averageNeighbourFvGeometryScheme::movePoints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clipPyramids()

Foam::label clipPyramids ( const pointField cellCentres,
const vectorField faceCentres,
const vectorField faceNormals,
const scalarField minOwnHeight,
const scalarField minNeiHeight,
vectorField correction 
) const
protected

Clip correction vector if new pyramid height would get below min. Return number of clipped cells.

Definition at line 173 of file averageNeighbourFvGeometryScheme.C.

References Foam::correction(), faceNormals(), n, and Foam::returnReduce().

Referenced by averageNeighbourFvGeometryScheme::movePoints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ averageNeighbourCentres()

Foam::tmp< Foam::pointField > averageNeighbourCentres ( const pointField cellCentres,
const vectorField faceNormals,
const scalarField faceWeights 
) const
protected

Average neighbouring cell centres to minimise non-ortho.

Definition at line 271 of file averageNeighbourFvGeometryScheme.C.

References faceNormals(), forAll, n, tmp< T >::ref(), and Foam::Zero.

Referenced by averageNeighbourFvGeometryScheme::movePoints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ averageCentres()

Foam::tmp< Foam::pointField > averageCentres ( const pointField cellCentres,
const pointField faceCentres,
const vectorField faceNormals 
) const
protected

Definition at line 382 of file averageNeighbourFvGeometryScheme.C.

References f(), faceNormals(), forAll, n, and tmp< T >::ref().

Referenced by averageNeighbourFvGeometryScheme::movePoints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeNonOrthoWeights()

void makeNonOrthoWeights ( const pointField cellCentres,
const vectorField faceNormals,
scalarField cosAngles,
scalarField faceWeights 
) const
protected

Make weights based on non-orthogonality.

Definition at line 517 of file averageNeighbourFvGeometryScheme.C.

References Foam::cos(), Foam::degToRad(), faceNormals(), forAll, Foam::max(), and Foam::min().

Referenced by averageNeighbourFvGeometryScheme::movePoints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TypeName()

TypeName ( "averageNeighbour"  )

Runtime type information.

◆ movePoints()

void movePoints ( )
virtual

Do what is necessary if the mesh has moved.

Reimplemented from highAspectRatioFvGeometryScheme.

Definition at line 630 of file averageNeighbourFvGeometryScheme.C.

References Foam::acos(), averageNeighbourFvGeometryScheme::averageCentres(), averageNeighbourFvGeometryScheme::averageNeighbourCentres(), highAspectRatioFvGeometryScheme::calcAspectRatioWeights(), primitiveMesh::cellCentres(), primitiveMesh::cellVolumes(), fileName::clean(), averageNeighbourFvGeometryScheme::clipFaceTet(), averageNeighbourFvGeometryScheme::clipPyramids(), Foam::correction(), Foam::cos(), Foam::expressions::patchExpr::debug, Foam::degToRad(), Foam::endl(), primitiveMesh::faceAreas(), primitiveMesh::faceCentres(), faceNormals(), polyMeshTools::faceOrthogonality(), polyMesh::faces(), forAll, Foam::gAverage(), TimePaths::globalPath(), Foam::gMax(), Foam::gMin(), Foam::mag(), averageNeighbourFvGeometryScheme::makeNonOrthoWeights(), averageNeighbourFvGeometryScheme::makePyrHeights(), fvGeometryScheme::mesh_, Foam::min(), averageNeighbourFvGeometryScheme::minRatio_, Foam::mkDir(), highAspectRatioFvGeometryScheme::movePoints(), OFstream::name(), OSstream::name(), surfaceWriter::New(), averageNeighbourFvGeometryScheme::nIters_, functionObject::outputPrefix, polyMesh::points(), polyMesh::pointsInstance(), Foam::Pout, Foam::radToDeg(), averageNeighbourFvGeometryScheme::relax_, primitiveMesh::resetGeometry(), autoPtr< T >::set(), fvMesh::time(), Time::timePath(), and OBJstream::write().

Here is the call graph for this function:

Member Data Documentation

◆ nIters_

const label nIters_
protected

Number of averaging iterations.

Definition at line 71 of file averageNeighbourFvGeometryScheme.H.

Referenced by averageNeighbourFvGeometryScheme::movePoints().

◆ relax_

const scalar relax_
protected

Blending between old-iteration cell centres and current average.

Definition at line 74 of file averageNeighbourFvGeometryScheme.H.

Referenced by averageNeighbourFvGeometryScheme::movePoints().

◆ minRatio_

const scalar minRatio_
protected

Clipping for pyramid heights - allowable shrinkage as fraction.

of original

Definition at line 78 of file averageNeighbourFvGeometryScheme.H.

Referenced by averageNeighbourFvGeometryScheme::movePoints().


The documentation for this class was generated from the following files: