From 1cd825f9c044102e14d4df162805dfcd0eb98649 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 19 Jan 2016 19:55:18 +0000 Subject: [PATCH] Bugfix: gradient cacheing --- .../limitedGradSchemes/cellLimitedGrad/cellLimitedGrad.H | 4 +++- .../cellLimitedGrad/cellLimitedGrads.C | 8 ++++---- .../cellMDLimitedGrad/cellMDLimitedGrads.C | 9 ++++----- .../limitedGradSchemes/faceLimitedGrad/faceLimitedGrad.H | 2 +- .../faceLimitedGrad/faceLimitedGrads.C | 9 ++++----- .../faceMDLimitedGrad/faceMDLimitedGrads.C | 9 ++++----- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrad.H b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrad.H index 53d6b0ca2..84df3316e 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrad.H +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrad.H @@ -117,6 +117,8 @@ public: ); + //- Return the gradient of the given field to the gradScheme::grad + // for optional caching tmp < GeometricField @@ -129,7 +131,7 @@ public: //- Return the BlockLduSystem corresponding to the implicit cell - // limted grad discretization. For block coupled systems. + // limited grad discretization. For block coupled systems. tmp < BlockLduSystem::type> diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C index 3018950f3..4caefa828 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C @@ -99,7 +99,7 @@ tmp cellLimitedGrad::calcGrad { const fvMesh& mesh = vsf.mesh(); - tmp tGrad = basicGradScheme_().grad(vsf); + tmp tGrad = basicGradScheme_().grad(vsf, name); if (k_ < SMALL) { @@ -237,7 +237,7 @@ tmp cellLimitedGrad::calcGrad g.internalField() *= limiter; g.correctBoundaryConditions(); - gaussGrad::correctBoundaryConditions(vsf, g); + gradScheme::correctBoundaryConditions(vsf, g); return tGrad; } @@ -252,7 +252,7 @@ tmp cellLimitedGrad::calcGrad { const fvMesh& mesh = vsf.mesh(); - tmp tGrad = basicGradScheme_().grad(vsf); + tmp tGrad = basicGradScheme_().grad(vsf, name); if (k_ < SMALL) { @@ -400,7 +400,7 @@ tmp cellLimitedGrad::calcGrad } g.correctBoundaryConditions(); - gaussGrad::correctBoundaryConditions(vsf, g); + gradScheme::correctBoundaryConditions(vsf, g); return tGrad; } diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C index 7328e4ce3..9a8ce6187 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "cellMDLimitedGrad.H" -#include "gaussGrad.H" #include "fvMesh.H" #include "volMesh.H" #include "surfaceMesh.H" @@ -56,7 +55,7 @@ tmp cellMDLimitedGrad::calcGrad { const fvMesh& mesh = vsf.mesh(); - tmp tGrad = basicGradScheme_().grad(vsf); + tmp tGrad = basicGradScheme_().grad(vsf, name); if (k_ < SMALL) { @@ -183,7 +182,7 @@ tmp cellMDLimitedGrad::calcGrad } g.correctBoundaryConditions(); - gaussGrad::correctBoundaryConditions(vsf, g); + gradScheme::correctBoundaryConditions(vsf, g); return tGrad; } @@ -198,7 +197,7 @@ tmp cellMDLimitedGrad::calcGrad { const fvMesh& mesh = vsf.mesh(); - tmp tGrad = basicGradScheme_().grad(vsf); + tmp tGrad = basicGradScheme_().grad(vsf, name); if (k_ < SMALL) { @@ -324,7 +323,7 @@ tmp cellMDLimitedGrad::calcGrad } g.correctBoundaryConditions(); - gaussGrad::correctBoundaryConditions(vsf, g); + gradScheme::correctBoundaryConditions(vsf, g); return tGrad; } diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrad.H b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrad.H index 51c1d8927..faaf64879 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrad.H +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrad.H @@ -128,7 +128,7 @@ public: ) const; //- Return the BlockLduSystem corresponding to the implicit face - // limted grad discretization. For block coupled systems. + // limited grad discretization. For block coupled systems. tmp < BlockLduSystem::type> diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C index d8b7ea3df..8d6df704b 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "faceLimitedGrad.H" -#include "gaussGrad.H" #include "fvMesh.H" #include "volMesh.H" #include "surfaceMesh.H" @@ -78,7 +77,7 @@ tmp faceLimitedGrad::calcGrad { const fvMesh& mesh = vsf.mesh(); - tmp tGrad = basicGradScheme_().grad(vsf); + tmp tGrad = basicGradScheme_().grad(vsf, name); if (k_ < SMALL) { @@ -200,7 +199,7 @@ tmp faceLimitedGrad::calcGrad g.internalField() *= limiter; g.correctBoundaryConditions(); - gaussGrad::correctBoundaryConditions(vsf, g); + gradScheme::correctBoundaryConditions(vsf, g); return tGrad; } @@ -215,7 +214,7 @@ tmp faceLimitedGrad::calcGrad { const fvMesh& mesh = vvf.mesh(); - tmp tGrad = basicGradScheme_().grad(vvf); + tmp tGrad = basicGradScheme_().grad(vvf, name); if (k_ < SMALL) { @@ -361,7 +360,7 @@ tmp faceLimitedGrad::calcGrad g.internalField() *= limiter; g.correctBoundaryConditions(); - gaussGrad::correctBoundaryConditions(vvf, g); + gradScheme::correctBoundaryConditions(vvf, g); return tGrad; } diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C index 5ec13aae4..a03ea1d74 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C @@ -25,7 +25,6 @@ License #include "faceMDLimitedGrad.H" #include "cellMDLimitedGrad.H" -#include "gaussGrad.H" #include "fvMesh.H" #include "volMesh.H" #include "surfaceMesh.H" @@ -58,7 +57,7 @@ tmp faceMDLimitedGrad::calcGrad { const fvMesh& mesh = vsf.mesh(); - tmp tGrad = basicGradScheme_().grad(vsf); + tmp tGrad = basicGradScheme_().grad(vsf, name); if (k_ < SMALL) { @@ -182,7 +181,7 @@ tmp faceMDLimitedGrad::calcGrad } g.correctBoundaryConditions(); - gaussGrad::correctBoundaryConditions(vsf, g); + gradScheme::correctBoundaryConditions(vsf, g); return tGrad; } @@ -197,7 +196,7 @@ tmp faceMDLimitedGrad::calcGrad { const fvMesh& mesh = vvf.mesh(); - tmp tGrad = basicGradScheme_().grad(vvf); + tmp tGrad = basicGradScheme_().grad(vvf, name); if (k_ < SMALL) { @@ -322,7 +321,7 @@ tmp faceMDLimitedGrad::calcGrad } g.correctBoundaryConditions(); - gaussGrad::correctBoundaryConditions(vvf, g); + gradScheme::correctBoundaryConditions(vvf, g); return tGrad; }