From 86021c9e6726891eac014ad8d3cc92ee053265c2 Mon Sep 17 00:00:00 2001 From: Dominik Christ Date: Mon, 7 Jan 2013 15:57:28 +0000 Subject: [PATCH] fix consistancy of gradient on coupled patches --- .../DeferredCorrectionLimitedScheme.C | 5 +++++ .../surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.C | 5 +++++ .../surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.C | 5 +++++ .../surfaceInterpolation/limitedSchemes/reconCentral/reconCentral.C | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/DeferredCorrectionLimitedScheme/DeferredCorrectionLimitedScheme.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/DeferredCorrectionLimitedScheme/DeferredCorrectionLimitedScheme.C index c1bd9003..aeda3a2c 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/DeferredCorrectionLimitedScheme/DeferredCorrectionLimitedScheme.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/DeferredCorrectionLimitedScheme/DeferredCorrectionLimitedScheme.C @@ -88,6 +88,11 @@ DeferredCorrectionLimitedScheme::limiter GeometricField gradc(fvc::grad(lPhi)); + // Note: in order for the patchNeighbourField to be correct on coupled + // boundaries, correctBoundaryConditions needs to be called. + // The call shall be moved into the library fvc operators + gradc.correctBoundaryConditions(); + const surfaceScalarField& CDweights = mesh.surfaceInterpolation::weights(); const unallocLabelList& owner = mesh.owner(); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.C index cb9f7d98..33f01601 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.C @@ -71,6 +71,11 @@ Foam::linearUpwind::correction ::type, fvPatchField, volMesh> gradVf = gradScheme_().grad(vf); + // Note: in order for the patchNeighbourField to be correct on coupled + // boundaries, correctBoundaryConditions needs to be called. + // The call shall be moved into the library fvc operators + gradVf.correctBoundaryConditions(); + forAll(faceFlux, facei) { if (faceFlux[facei] > 0) diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.C index 53b42bea..ff6747a6 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.C @@ -75,6 +75,11 @@ Foam::linearUpwindV::correction ::type, fvPatchField, volMesh> gradVf = gradScheme_().grad(vf); + // Note: in order for the patchNeighbourField to be correct on coupled + // boundaries, correctBoundaryConditions needs to be called. + // The call shall be moved into the library fvc operators + gradVf.correctBoundaryConditions(); + forAll(faceFlux, facei) { vector maxCorr; diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/reconCentral/reconCentral.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/reconCentral/reconCentral.C index e6642388..91483075 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/reconCentral/reconCentral.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/reconCentral/reconCentral.C @@ -65,6 +65,11 @@ Foam::reconCentral::interpolate ::type, fvPatchField, volMesh> gradVf = gradScheme_().grad(vf); + // Note: in order for the patchNeighbourField to be correct on coupled + // boundaries, correctBoundaryConditions needs to be called. + // The call shall be moved into the library fvc operators + gradVf.correctBoundaryConditions(); + Field& sfIn = sf.internalField(); forAll(sfIn, facei) -- 2.11.4.GIT