Public Member Functions | Private Member Functions | Private Attributes
advectionDiffusion Class Reference

Calculation of approximate distance to nearest patch for all cells and boundary by solving the Eikonal equation in advection form with diffusion smoothing. More...

Inheritance diagram for advectionDiffusion:
Inheritance graph
[legend]
Collaboration diagram for advectionDiffusion:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("advectionDiffusion")
 Runtime type information. More...
 
 advectionDiffusion (const dictionary &dict, const fvMesh &mesh, const labelHashSet &patchIDs)
 Construct from coefficients dictionary, mesh. More...
 
virtual bool correct (volScalarField &y)
 Correct the given distance-to-patch field. More...
 
virtual bool correct (volScalarField &y, volVectorField &n)
 Correct the given distance-to-patch and normal-to-patch fields. More...
 
- Public Member Functions inherited from patchDistMethod
 TypeName ("patchDistMethod")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, patchDistMethod, dictionary,(const dictionary &dict, const fvMesh &mesh, const labelHashSet &patchIDs),(dict, mesh, patchIDs))
 
 patchDistMethod (const fvMesh &mesh, const labelHashSet &patchIDs)
 Construct from mesh and patch ID set. More...
 
virtual ~patchDistMethod ()
 Destructor. More...
 
const labelHashSetpatchIDs () const
 Return the patchIDs. More...
 
virtual bool movePoints ()
 Update cached geometry when the mesh moves. More...
 
virtual void updateMesh (const mapPolyMesh &)
 Update cached topology and geometry when the mesh changes. More...
 
template<class Type >
Foam::wordList patchTypes (const fvMesh &mesh, const labelHashSet &patchIDs)
 

Private Member Functions

 advectionDiffusion (const advectionDiffusion &)
 Disallow default bitwise copy construct. More...
 
void operator= (const advectionDiffusion &)
 Disallow default bitwise assignment. More...
 

Private Attributes

dictionary coeffs_
 Sub-dictionary of coefficients. More...
 
autoPtr< patchDistMethodpdmPredictor_
 Run-time selected method to predict the distance-to-wall field. More...
 
scalar epsilon_
 Diffusion coefficient multiplying y*laplacian(y) More...
 
scalar tolerance_
 Convergence tolerance for the iterations of the advection-diffusion. More...
 
int maxIter_
 Maximum number of iterations of the advection-diffusion equation. More...
 
bool predicted_
 Flag to indicate the predictor step has been executed. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from patchDistMethod
static autoPtr< patchDistMethodNew (const dictionary &dict, const fvMesh &mesh, const labelHashSet &patchIDs)
 
template<class Type >
static wordList patchTypes (const fvMesh &mesh, const labelHashSet &patchIDs)
 Return the patch types for y and n. More...
 
- Protected Attributes inherited from patchDistMethod
const fvMeshmesh_
 Reference to the mesh. More...
 
const labelHashSet patchIDs_
 Set of patch IDs. More...
 

Detailed Description

Calculation of approximate distance to nearest patch for all cells and boundary by solving the Eikonal equation in advection form with diffusion smoothing.

If the diffusion coefficient is set to 0 this method is exact in principle but the numerical schemes used are not rendering the scheme approximate, but more accurate than the Poisson method. Also many models relying on the distance to the wall benefit from this field being smooth and monotonic so the addition of diffusion smoothing improves both the convergence and stability of the solution of the Eikonal equation and the behavior of the models using the distance field generated. However, it is not clear what the optimum value for the diffusion coefficient epsilon should be; a default value of 0.1 is provided but higher values may be preferable under some circumstances.

Convergence is accelerated by first generating an approximate solution using one of the simpler methods, e.g. Poisson. The method used for this prediction step is specified in the 'advectionDiffusionCoeffs' sub-dictionary, see below.

References:

    P.G. Tucker, C.L. Rumsey, R.E. Bartels, R.T. Biedron,
    "Transport equation based wall distance computations aimed at flows
     with time-dependent geometry",
    NASA/TM-2003-212680, December 2003.

Example of the wallDist specification in fvSchemes:

    laplacianSchemes
    {
        .
        .
        laplacian(yPsi) Gauss linear corrected;
        laplacian(yWall) Gauss linear corrected;
        .
        .
    }

    wallDist
    {
        method advectionDiffusion;

        // Optional entry enabling the calculation
        // of the normal-to-wall field
        nRequired false;

        advectionDiffusionCoeffs
        {
            method    Poisson;
            epsilon   0.1;
            tolerance 1e-3;
            maxIter   10;
        }
    }

Also the solver specification for yWall is required in fvSolution, e.g. for simple cases:

    yPsi
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-4;
        relTol          0;
    }

    yWall
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance       1e-4;
        relTol          0;
    }

    relaxationFactors
    {
        equations
        {
            .
            .
            yWall           1;
            .
            .
        }
    }

or for more complex cases:

    yPsi
    {
        solver          GAMG;
        smoother        GaussSeidel;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels     1;
        tolerance       1e-4;
        relTol          0;
    }

    yWall
    {
        solver          GAMG;
        smoother        symGaussSeidel;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels     1;
        tolerance       1e-4;
        relTol          0;
    }

    relaxationFactors
    {
        equations
        {
            .
            .
            yWall           0.7;
            .
            .
        }
    }
See also
Foam::patchDistMethod::Poisson Foam::patchDistMethod::meshWave Foam::wallDist
Source files

Definition at line 180 of file advectionDiffusionPatchDistMethod.H.

Constructor & Destructor Documentation

◆ advectionDiffusion() [1/2]

advectionDiffusion ( const advectionDiffusion )
private

Disallow default bitwise copy construct.

◆ advectionDiffusion() [2/2]

advectionDiffusion ( const dictionary dict,
const fvMesh mesh,
const labelHashSet patchIDs 
)

Construct from coefficients dictionary, mesh.

and fixed-value patch set

Definition at line 52 of file advectionDiffusionPatchDistMethod.C.

Member Function Documentation

◆ operator=()

void operator= ( const advectionDiffusion )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "advectionDiffusion"  )

Runtime type information.

◆ correct() [1/2]

bool correct ( volScalarField y)
virtual

Correct the given distance-to-patch field.

Implements patchDistMethod.

Definition at line 78 of file advectionDiffusionPatchDistMethod.C.

References GeometricField::null(), and y.

Here is the call graph for this function:

◆ correct() [2/2]

bool correct ( volScalarField y,
volVectorField n 
)
virtual

Field Documentation

◆ coeffs_

dictionary coeffs_
private

Sub-dictionary of coefficients.

Definition at line 187 of file advectionDiffusionPatchDistMethod.H.

◆ pdmPredictor_

autoPtr<patchDistMethod> pdmPredictor_
private

Run-time selected method to predict the distance-to-wall field.

Definition at line 190 of file advectionDiffusionPatchDistMethod.H.

◆ epsilon_

scalar epsilon_
private

Diffusion coefficient multiplying y*laplacian(y)

Definition at line 193 of file advectionDiffusionPatchDistMethod.H.

◆ tolerance_

scalar tolerance_
private

Convergence tolerance for the iterations of the advection-diffusion.

equation to correct the distance-to-patch and normal-to-patch fields

Definition at line 197 of file advectionDiffusionPatchDistMethod.H.

◆ maxIter_

int maxIter_
private

Maximum number of iterations of the advection-diffusion equation.

to correct the distance-to-patch and normal-to-patch fields

Definition at line 201 of file advectionDiffusionPatchDistMethod.H.

◆ predicted_

bool predicted_
private

Flag to indicate the predictor step has been executed.

Definition at line 204 of file advectionDiffusionPatchDistMethod.H.


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