diff --git a/src/finiteVolume/fvMesh/wallDist/nearWallDist.C b/src/finiteVolume/fvMesh/wallDist/nearWallDist.C index eaa3cc3b798adfc4061cd293370439b50fc0be3e..1c2266c3fe3799dabe16ea845eba112c5ef12351 100644 --- a/src/finiteVolume/fvMesh/wallDist/nearWallDist.C +++ b/src/finiteVolume/fvMesh/wallDist/nearWallDist.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,7 +31,7 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::nearWallDist::doAll() +void Foam::nearWallDist::calculate() { cellDistFuncs wallUtils(mesh_); @@ -101,7 +101,7 @@ Foam::nearWallDist::nearWallDist(const Foam::fvMesh& mesh) ), mesh_(mesh) { - doAll(); + calculate(); } @@ -115,16 +115,28 @@ Foam::nearWallDist::~nearWallDist() void Foam::nearWallDist::correct() { - if (mesh_.changing()) + if (mesh_.topoChanging()) { - // Update size of GeometricBoundaryField - forAll(mesh_.boundary(), patchI) + const DimensionedField<scalar, volMesh>& V = mesh_.V(); + const fvBoundaryMesh& bnd = mesh_.boundary(); + + this->setSize(bnd.size()); + forAll(*this, patchI) { - operator[](patchI).setSize(mesh_.boundary()[patchI].size()); + this->set + ( + patchI, + fvPatchField<scalar>::New + ( + calculatedFvPatchScalarField::typeName, + bnd[patchI], + V + ) + ); } } - doAll(); + calculate(); } diff --git a/src/finiteVolume/fvMesh/wallDist/nearWallDist.H b/src/finiteVolume/fvMesh/wallDist/nearWallDist.H index d8fe6ca387cfe37049e47871f0fa275627b5aaf1..284a60583f14e29a6b6979879667dd289f24839a 100644 --- a/src/finiteVolume/fvMesh/wallDist/nearWallDist.H +++ b/src/finiteVolume/fvMesh/wallDist/nearWallDist.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,6 @@ SourceFiles #include "volFields.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -47,7 +46,7 @@ namespace Foam class fvMesh; /*---------------------------------------------------------------------------*\ - Class nearWallDist Declaration + Class nearWallDist Declaration \*---------------------------------------------------------------------------*/ class nearWallDist @@ -62,8 +61,8 @@ class nearWallDist // Private Member Functions - //- Do all calculations. - void doAll(); + //- Do all calculations + void calculate(); //- Disallow default bitwise copy construct nearWallDist(const nearWallDist&);