From 93fffffdb7453736d95f5535f9c8eed1054e48f6 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Wed, 20 Nov 2019 11:07:19 +0000 Subject: [PATCH] Bugfix: force recalculation of surfaceInterpolation data on mesh.readUpdate(). Needed for correct near-wall distance --- src/finiteVolume/fvMesh/fvMesh.C | 5 ++++- .../surfaceInterpolation/surfaceInterpolation.C | 8 +++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index c6c143d97..ff0cb6a35 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -61,6 +61,10 @@ void Foam::fvMesh::clearGeomNotOldVol() deleteDemandDrivenData(magSfPtr_); deleteDemandDrivenData(CPtr_); deleteDemandDrivenData(CfPtr_); + + // Mesh moved: force recalculation of surface interpolation data. + // HJ, 20/Nov/2019 + surfaceInterpolation::clearOut(); } @@ -107,7 +111,6 @@ void Foam::fvMesh::clearAddressing() void Foam::fvMesh::clearOut() { clearGeom(); - surfaceInterpolation::clearOut(); clearAddressing(); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C index 6b80d44b0..d611af601 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C @@ -43,6 +43,8 @@ void Foam::surfaceInterpolation::clearOut() { deleteDemandDrivenData(weightingFactors_); deleteDemandDrivenData(deltaCoeffs_); + + orthogonal_ = false; deleteDemandDrivenData(correctionVectors_); } @@ -120,11 +122,7 @@ Foam::surfaceInterpolation::correctionVectors() const bool Foam::surfaceInterpolation::movePoints() { - deleteDemandDrivenData(weightingFactors_); - deleteDemandDrivenData(deltaCoeffs_); - - orthogonal_ = false; - deleteDemandDrivenData(correctionVectors_); + clearOut(); return true; }