diff --git a/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.H b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.H index 774f6d9d5972838b75f28a30dd9cffd699ea447e..c5cbdb29697223ca42b1f952006b3d4872b88ebc 100644 --- a/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.H +++ b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/patchDistMethod/patchDistMethod.H @@ -126,6 +126,12 @@ public: // Member Functions + //- Return the patchIDs + const labelHashSet& patchIDs() const + { + return patchIDs_; + } + //- Update cached geometry when the mesh moves virtual bool movePoints() { diff --git a/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C b/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C index d06a8456ba884bee25def6004c903b33c71f556d..21ef0d7fdbc056d3387e475cce743887a02f25e8 100644 --- a/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C +++ b/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C @@ -24,7 +24,9 @@ License \*---------------------------------------------------------------------------*/ #include "wallDist.H" -#include "wallFvPatch.H" +#include "wallPolyPatch.H" +#include "fixedValueFvPatchFields.H" +#include "zeroGradientFvPatchFields.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -34,6 +36,26 @@ namespace Foam } +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<class Type> +Foam::wordList Foam::wallDist::patchTypes(const labelHashSet& patchIDs) const +{ + wordList yTypes + ( + mesh().boundary().size(), + zeroGradientFvPatchField<Type>::typeName + ); + + forAllConstIter(labelHashSet, patchIDs, iter) + { + yTypes[iter.key()] = fixedValueFvPatchField<Type>::typeName; + } + + return yTypes; +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::wallDist::wallDist(const fvMesh& mesh) @@ -57,7 +79,8 @@ Foam::wallDist::wallDist(const fvMesh& mesh) mesh ), mesh, - dimensionedScalar("yWall", dimLength, GREAT) + dimensionedScalar("yWall", dimLength, GREAT), + patchTypes<scalar>(pdm_->patchIDs()) ), n_(NULL) { @@ -74,18 +97,18 @@ Foam::wallDist::wallDist(const fvMesh& mesh) mesh ), mesh, - dimensionedVector("nWall", dimless, vector::zero) + dimensionedVector("nWall", dimless, vector::zero), + patchTypes<vector>(pdm_->patchIDs()) ) ); + const labelHashSet& patchIDs = pdm_->patchIDs(); const fvPatchList& patches = mesh.boundary(); - forAll(patches, patchi) + forAllConstIter(labelHashSet, patchIDs, iter) { - if (isA<wallFvPatch>(patches[patchi])) - { - n_().boundaryField()[patchi] = patches[patchi].nf(); - } + label patchi = iter.key(); + n_().boundaryField()[patchi] == patches[patchi].nf(); } movePoints(); diff --git a/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.H b/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.H index 683a8c095facbf3db28aed0b14e317d0306ccec5..60dfc804490913a70e07ff4b4a9f2ecbe6f24d80 100644 --- a/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.H +++ b/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.H @@ -68,6 +68,11 @@ class wallDist // Private Member Functions + //- Return the patch types for y and n + // These are fixedValue for the set provided otherwise zero-gradient + template<class Type> + wordList patchTypes(const labelHashSet& patchIDs) const; + //- Disallow default bitwise copy construct wallDist(const wallDist&);