Loading...
Searching...
No Matches
averageNeighbourFvGeometryScheme Class Reference

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

#include <averageNeighbourFvGeometryScheme.H>

Inheritance diagram for averageNeighbourFvGeometryScheme:
Collaboration diagram for averageNeighbourFvGeometryScheme:

Public Member Functions

 TypeName ("averageNeighbour")
 Runtime type information.
 averageNeighbourFvGeometryScheme (const fvMesh &mesh, const dictionary &dict)
 Construct from mesh.
virtual ~averageNeighbourFvGeometryScheme ()=default
 Destructor.
virtual void movePoints ()
 Do what is necessary if the mesh has moved.
virtual bool updateGeom (const pointField &points, const refPtr< pointField > &oldPoints, pointField &faceCentres, vectorField &faceAreas, pointField &cellCentres, scalarField &cellVolumes) const
 Calculate geometry quantities using mesh topology and provided points. If oldPoints provided only does local update. Returns true if anything changed, false otherwise.
Public Member Functions inherited from highAspectRatioFvGeometryScheme
 TypeName ("highAspectRatio")
 Runtime type information.
 highAspectRatioFvGeometryScheme (const fvMesh &mesh, const dictionary &dict)
 Construct from mesh.
virtual ~highAspectRatioFvGeometryScheme ()=default
 Destructor.
Public Member Functions inherited from basicFvGeometryScheme
 TypeName ("basic")
 Runtime type information.
 basicFvGeometryScheme (const fvMesh &mesh, const dictionary &dict)
 Construct from mesh.
virtual ~basicFvGeometryScheme ()=default
 Destructor.
virtual tmp< surfaceScalarFieldweights () const
 Return linear difference weighting factors.
virtual tmp< surfaceScalarFielddeltaCoeffs () const
 Return cell-centre difference coefficients.
virtual tmp< surfaceScalarFieldnonOrthDeltaCoeffs () const
 Return non-orthogonal cell-centre difference coefficients.
virtual tmp< surfaceVectorFieldnonOrthCorrectionVectors () const
 Return non-orthogonality correction vectors.
Public Member Functions inherited from fvGeometryScheme
 TypeName ("fvGeometryScheme")
 Runtime type information.
 declareRunTimeSelectionTable (tmp, fvGeometryScheme, dict,(const fvMesh &mesh, const dictionary &dict),(mesh, dict))
 fvGeometryScheme (const fvMesh &mesh, const dictionary &dict)
 Construct from mesh.
virtual ~fvGeometryScheme ()=default
 Destructor.
const fvMeshmesh () const
 Return mesh reference.
virtual void updateMesh (const mapPolyMesh &mpm)
 Update mesh for topology changes.
Public Member Functions inherited from refCount
constexpr refCount () noexcept
 Default construct, initializing count to 0.
int use_count () const noexcept
 Return the current reference count.
bool unique () const noexcept
 Return true if the reference count is zero.
void operator++ () noexcept
 Increment the reference count.
void operator++ (int) noexcept
 Increment the reference count.
void operator-- () noexcept
 Decrement the reference count.
void operator-- (int) noexcept
 Decrement the reference count.

Protected Member Functions

label clipFaceTet (const scalar minRatio, const vectorField &faceCentres, const vectorField &faceNormals, vectorField &faceCorrection) const
 Clip face-centre correction vector if new triangle area would get below min. Return number of clipped faces.
void makePyrHeights (const pointField &cellCentres, const vectorField &faceCentres, const vectorField &faceNormals, scalarField &ownHeight, scalarField &neiHeight) const
 Calculate pyramid heights.
label clipPyramids (const pointField &cellCentres, const vectorField &faceCentres, const vectorField &faceNormals, const scalarField &minOwnHeight, const scalarField &minNeiHeight, vectorField &correction) const
 Clip correction vector if new pyramid height would get below min. Return number of clipped cells.
tmp< pointFieldaverageNeighbourCentres (const pointField &cellCentres, const vectorField &faceNormals, const scalarField &faceWeights) const
 Average neighbouring cell centres to minimise non-ortho.
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.
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.
Protected Member Functions inherited from fvGeometryScheme
bool setMeshPhi () const
 Set the mesh motion flux.

Protected Attributes

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

Additional Inherited Members

Static Public Member Functions inherited from fvGeometryScheme
static tmp< fvGeometryScheme > New (const fvMesh &mesh, const dictionary &dict, const word &defaultScheme)
 Return new tmp interpolation scheme.
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.

Detailed Description

Geometry calculation scheme to minimise non-orthogonality/.

Source files

Definition at line 48 of file averageNeighbourFvGeometryScheme.H.

Constructor & Destructor Documentation

◆ averageNeighbourFvGeometryScheme()

averageNeighbourFvGeometryScheme ( const fvMesh & mesh,
const dictionary & dict )

Construct from mesh.

Definition at line 544 of file averageNeighbourFvGeometryScheme.C.

References dict, fvGeometryScheme::mesh(), and nIters_.

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 47 of file averageNeighbourFvGeometryScheme.C.

References f(), forAll, Foam::mag(), fvGeometryScheme::mesh_, n, nCorr, p, Foam::returnReduce(), and VectorSpace< Form, Cmpt, Ncmpts >::zero.

Referenced by 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 123 of file averageNeighbourFvGeometryScheme.C.

References fvGeometryScheme::mesh_, n, and List< T >::setSize().

Referenced by 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 161 of file averageNeighbourFvGeometryScheme.C.

References Foam::correction(), fvGeometryScheme::mesh_, n, Foam::returnReduce(), and VectorSpace< Form, Cmpt, Ncmpts >::zero.

Referenced by 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 257 of file averageNeighbourFvGeometryScheme.C.

References forAll, fvGeometryScheme::mesh_, n, tmp< T >::New(), pbm, pp(), syncTools::swapBoundaryCellPositions(), and Foam::Zero.

Referenced by 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 366 of file averageNeighbourFvGeometryScheme.C.

References f(), forAll, fvGeometryScheme::mesh_, n, tmp< T >::New(), pbm, pp(), and syncTools::swapBoundaryCellPositions().

Referenced by 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 499 of file averageNeighbourFvGeometryScheme.C.

References Foam::clamp(), Foam::cos(), Foam::degToRad(), polyMeshTools::faceOrthogonality(), forAll, fvGeometryScheme::mesh_, List< T >::setSize(), and UList< T >::size().

Referenced by movePoints().

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

◆ TypeName()

TypeName ( "averageNeighbour" )

Runtime type information.

References dict, and fvGeometryScheme::mesh().

Here is the call graph for this function:

◆ movePoints()

◆ updateGeom()

virtual bool updateGeom ( const pointField & points,
const refPtr< pointField > & oldPoints,
pointField & faceCentres,
vectorField & faceAreas,
pointField & cellCentres,
scalarField & cellVolumes ) const
inlinevirtual

Calculate geometry quantities using mesh topology and provided points. If oldPoints provided only does local update. Returns true if anything changed, false otherwise.

Reimplemented from highAspectRatioFvGeometryScheme.

Definition at line 197 of file averageNeighbourFvGeometryScheme.H.

References NotImplemented, and points.

Member Data Documentation

◆ nIters_

const label nIters_
protected

Number of averaging iterations.

Definition at line 73 of file averageNeighbourFvGeometryScheme.H.

Referenced by averageNeighbourFvGeometryScheme(), and movePoints().

◆ relax_

const scalar relax_
protected

Blending between old-iteration cell centres and current average.

Definition at line 78 of file averageNeighbourFvGeometryScheme.H.

Referenced by movePoints().

◆ minRatio_

const scalar minRatio_
protected

Clipping for pyramid heights - allowable shrinkage as fraction.

of original

Definition at line 85 of file averageNeighbourFvGeometryScheme.H.

Referenced by movePoints().


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