Calculation of approximate distance to nearest patch for all cells and boundary by solving the Eikonal equation in advection form with diffusion smoothing. More...
Public Member Functions | |
TypeName ("advectionDiffusion") | |
advectionDiffusion (const dictionary &dict, const fvMesh &mesh, const labelHashSet &patchIDs) | |
virtual bool | correct (volScalarField &y) |
virtual bool | correct (volScalarField &y, volVectorField &n) |
![]() | |
TypeName ("patchDistMethod") | |
declareRunTimeSelectionTable (autoPtr, patchDistMethod, dictionary,(const dictionary &dict, const fvMesh &mesh, const labelHashSet &patchIDs),(dict, mesh, patchIDs)) | |
patchDistMethod (const fvMesh &mesh, const labelHashSet &patchIDs) | |
virtual | ~patchDistMethod () |
const labelHashSet & | patchIDs () const |
virtual bool | movePoints () |
virtual void | updateMesh (const mapPolyMesh &) |
template<class Type > | |
Foam::wordList | patchTypes (const fvMesh &mesh, const labelHashSet &patchIDs) |
Additional Inherited Members | |
![]() | |
static autoPtr< patchDistMethod > | New (const dictionary &dict, const fvMesh &mesh, const labelHashSet &patchIDs, const word &defaultPatchDistMethod=word::null) |
template<class Type > | |
static wordList | patchTypes (const fvMesh &mesh, const labelHashSet &patchIDs) |
![]() | |
patchDistMethod (const patchDistMethod &)=delete | |
void | operator= (const patchDistMethod &)=delete |
![]() | |
const fvMesh & | mesh_ |
const labelHashSet | patchIDs_ |
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; . . } }
Definition at line 178 of file advectionDiffusionPatchDistMethod.H.
advectionDiffusion | ( | const dictionary & | dict, |
const fvMesh & | mesh, | ||
const labelHashSet & | patchIDs | ||
) |
Definition at line 48 of file advectionDiffusionPatchDistMethod.C.
TypeName | ( | "advectionDiffusion" | ) |
|
virtual |
Implements patchDistMethod.
Definition at line 77 of file advectionDiffusionPatchDistMethod.C.
References GeometricField::null(), and y.
|
virtual |
Implements patchDistMethod.
Definition at line 84 of file advectionDiffusionPatchDistMethod.C.
References GeometricField::boundaryFieldRef(), Foam::dimless, Foam::fvm::div(), Foam::fvc::div(), Foam::fvc::grad(), Foam::fvc::interpolate(), Foam::fvm::laplacian(), Foam::mag(), n, IOobject::NO_READ, IOobject::NO_WRITE, Foam::notNull(), patches, fvMatrix::relax(), fvMatrix::solve(), Foam::fvm::Sp(), y, and Foam::Zero.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.