From 1c101ec1a8f6d8bdf1bbf06712d1ac8dc377fee3 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 8 May 2009 13:05:19 +0200 Subject: [PATCH] bugfix fixedBlended scheme, cosmetics changes - actually blend correction factors as well in fixedBlended scheme - consistency change: move 'linearUpwindV' into same directory as 'linearUpwind', move correction code from .H into .C code. - minor docu format/spelling changes A more general question: ~~~~~~~~~~~~~~~~~~~~~~~~ - would it make more sense to use template specializations for the '*V' differencing schemes? --- src/finiteVolume/Make/files | 2 +- .../cellLimitedGrad/cellLimitedGrads.C | 4 +- .../cellMDLimitedGrad/cellMDLimitedGrads.C | 2 +- .../limitedSchemes/Limited/Limited.H | 2 +- .../limitedSchemes/Limited01/Limited01.H | 2 +- .../limitedSchemes/QUICK/QUICK.H | 7 +- .../limitedSchemes/QUICK/QUICKV.H | 5 +- .../filteredLinear/filteredLinear.H | 2 +- .../filteredLinear2/filteredLinear2.H | 2 +- .../filteredLinear2/filteredLinear2V.H | 12 +- .../filteredLinear3/filteredLinear3.H | 4 +- .../filteredLinear3/filteredLinear3V.H | 14 +- .../linearUpwind/linearUpwind.H | 5 +- .../linearUpwind/linearUpwindV.C | 136 ++++++++++++++++++ .../linearUpwindV.H | 94 +----------- .../linearUpwindV/linearUpwindV.C | 39 ----- .../schemes/UpwindFitScheme/UpwindFitData.H | 4 +- .../schemes/UpwindFitScheme/UpwindFitScheme.H | 2 +- .../biLinearFit/biLinearFitPolynomial.H | 3 +- .../cubicUpwindFit/cubicUpwindFitPolynomial.H | 2 +- .../schemes/fixedBlended/fixedBlended.H | 65 ++++++++- .../schemes/harmonic/harmonic.H | 9 +- .../schemes/linearFit/linearFitPolynomial.H | 3 +- .../schemes/localMax/localMax.H | 7 +- .../schemes/localMin/localMin.H | 7 +- .../outletStabilised/outletStabilised.H | 16 ++- .../quadraticFit/quadraticFitPolynomial.H | 2 +- .../quadraticLinearFitPolynomial.H | 2 +- .../quadraticLinearUpwindFitPolynomial.H | 2 +- .../quadraticUpwindFitPolynomial.H | 2 +- .../schemes/reverseLinear/reverseLinear.H | 1 + .../schemes/skewCorrected/skewCorrected.H | 2 +- 32 files changed, 271 insertions(+), 190 deletions(-) create mode 100644 src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.C rename src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/{linearUpwindV => linearUpwind}/linearUpwindV.H (58%) delete mode 100644 src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwindV/linearUpwindV.C diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index ddd50de180..54afdb3551 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -206,7 +206,7 @@ $(limitedSchemes)/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationS $(limitedSchemes)/upwind/upwind.C $(limitedSchemes)/blended/blended.C $(limitedSchemes)/linearUpwind/linearUpwind.C -$(limitedSchemes)/linearUpwindV/linearUpwindV.C +$(limitedSchemes)/linearUpwind/linearUpwindV.C $(limitedSchemes)/Gamma/Gamma.C $(limitedSchemes)/SFCD/SFCD.C $(limitedSchemes)/Minmod/Minmod.C diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C index c3af907ea5..c4f0bf524a 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C @@ -21,7 +21,7 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - + \*---------------------------------------------------------------------------*/ #include "cellLimitedGrad.H" @@ -377,7 +377,7 @@ tmp cellLimitedGrad::grad ); } } - + if (fv::debug) { Info<< "gradient limiter for: " << vsf.name() diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C index 4a4cbc9fa8..5a35033428 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C @@ -21,7 +21,7 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - + \*---------------------------------------------------------------------------*/ #include "cellMDLimitedGrad.H" diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/Limited/Limited.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/Limited/Limited.H index 8f1ce9a80d..ba6bdb8ed9 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/Limited/Limited.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/Limited/Limited.H @@ -41,7 +41,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class LimitedLimiter Declaration + Class LimitedLimiter Declaration \*---------------------------------------------------------------------------*/ template diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/Limited01/Limited01.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/Limited01/Limited01.H index c71a3a255b..694bd974cb 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/Limited01/Limited01.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/Limited01/Limited01.H @@ -41,7 +41,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class Limited01Limiter Declaration + Class Limited01Limiter Declaration \*---------------------------------------------------------------------------*/ template diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/QUICK/QUICK.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/QUICK/QUICK.H index 6b615a2b55..15f94d1ed8 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/QUICK/QUICK.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/QUICK/QUICK.H @@ -79,18 +79,17 @@ public: { scalar phiCD = cdWeight*phiP + (1 - cdWeight)*phiN; - scalar phif; - scalar phiU; + scalar phiU, phif; if (faceFlux > 0) { - phif = 0.5*(phiCD + phiP + (1 - cdWeight)*(d & gradcP)); phiU = phiP; + phif = 0.5*(phiCD + phiP + (1 - cdWeight)*(d & gradcP)); } else { - phif = 0.5*(phiCD + phiN - cdWeight*(d & gradcN)); phiU = phiN; + phif = 0.5*(phiCD + phiN - cdWeight*(d & gradcN)); } // Calculate the effective limiter for the QUICK interpolation diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/QUICK/QUICKV.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/QUICK/QUICKV.H index 7551aae4ab..f8917861c7 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/QUICK/QUICKV.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/QUICK/QUICKV.H @@ -81,8 +81,7 @@ public: scalar phiCD = gradfV & (cdWeight*phiP + (1 - cdWeight)*phiN); - scalar phif; - scalar phiU; + scalar phiU, phif; if (faceFlux > 0) { @@ -95,7 +94,7 @@ public: phif = 0.5*(phiCD + phiU - cdWeight*(gradfV & (d & gradcN))); } - // Calculate the effective limiter for the linearUpwind interpolation + // Calculate the effective limiter for the QUICK interpolation scalar QLimiter = (phif - phiU)/stabilise(phiCD - phiU, SMALL); // Limit the limiter between upwind and downwind diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear/filteredLinear.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear/filteredLinear.H index 8029667f0f..996699759c 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear/filteredLinear.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear/filteredLinear.H @@ -26,7 +26,7 @@ Class Foam::filteredLinearLimiter Description - Class to generate weighting factors for the filtered-linear + Class to generate weighting factors for the filteredLinear differencing scheme. The aim is to remove high-frequency modes with "staggering" diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear2/filteredLinear2.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear2/filteredLinear2.H index be5df5575c..90503633e1 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear2/filteredLinear2.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear2/filteredLinear2.H @@ -26,7 +26,7 @@ Class Foam::filteredLinear2Limiter Description - Class to generate weighting factors for the filtered-linear-2 + Class to generate weighting factors for the filteredLinear2 differencing scheme. The aim is to remove high-frequency modes with "staggering" diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear2/filteredLinear2V.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear2/filteredLinear2V.H index 74f7348eb2..f2565b49d8 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear2/filteredLinear2V.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear2/filteredLinear2V.H @@ -26,11 +26,13 @@ Class Foam::filteredLinear2VLimiter Description - Class to generate weighting factors for the filteredLinear2V differencing - scheme. The aim is to remove high-frequency modes with "staggering" - characteristics from vector fields by comparing the face gradient in the - direction of maximum gradient with both neighbouring cell gradients and - introduce small amounts of upwind in order to damp these modes. + Class to generate weighting factors for the filteredLinear2V + differencing scheme. + + The aim is to remove high-frequency modes with "staggering" + characteristics from vector fields by comparing the face gradient in + the direction of maximum gradient with both neighbouring cell gradients + and introduce small amounts of upwind in order to damp these modes. Used in conjunction with the template class LimitedScheme. diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear3/filteredLinear3.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear3/filteredLinear3.H index 3edc0aba41..6afcb84982 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear3/filteredLinear3.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear3/filteredLinear3.H @@ -26,7 +26,7 @@ Class Foam::filteredLinear3Limiter Description - Class to generate weighting factors for the filtered-linear-3 + Class to generate weighting factors for the filteredLinear differencing scheme. The aim is to remove high-frequency modes with "staggering" @@ -79,7 +79,7 @@ public: << "coefficient = " << k_ << " should be >= 0 and <= 1" << exit(FatalIOError); - } + } } scalar limiter diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear3/filteredLinear3V.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear3/filteredLinear3V.H index c88d6d3052..a27a233aff 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear3/filteredLinear3V.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/filteredLinear3/filteredLinear3V.H @@ -26,11 +26,13 @@ Class Foam::filteredLinear3VLimiter Description - Class to generate weighting factors for the filteredLinear3V differencing - scheme. The aim is to remove high-frequency modes with "staggering" - characteristics from vector fields by comparing the face gradient in the - direction of maximum gradient with both neighbouring cell gradients and - introduce small amounts of upwind in order to damp these modes. + Class to generate weighting factors for the filteredLinear3V + differencing scheme. + + The aim is to remove high-frequency modes with "staggering" + characteristics from vector fields by comparing the face gradient in + the direction of maximum gradient with both neighbouring cell gradients + and introduce small amounts of upwind in order to damp these modes. Used in conjunction with the template class LimitedScheme. @@ -77,7 +79,7 @@ public: << "coefficient = " << k_ << " should be >= 0 and <= 1" << exit(FatalIOError); - } + } } scalar limiter diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.H index 7637a22f6e..2b51590f85 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.H @@ -90,7 +90,7 @@ public: ) {} - //- Construct from Istream. + //- Construct from Istream. // The name of the flux field is read from the Istream and looked-up // from the mesh objectRegistry linearUpwind @@ -142,8 +142,9 @@ public: virtual tmp > correction ( - const GeometricField& vf + const GeometricField& ) const; + }; diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.C new file mode 100644 index 0000000000..db4a31c551 --- /dev/null +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.C @@ -0,0 +1,136 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "linearUpwindV.H" +#include "fvMesh.H" +#include "volFields.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template +Foam::tmp > +Foam::linearUpwindV::correction +( + const GeometricField& vf +) const +{ + const fvMesh& mesh = this->mesh(); + + tmp > tsfCorr + ( + new GeometricField + ( + IOobject + ( + vf.name(), + mesh.time().timeName(), + mesh + ), + mesh, + dimensioned + ( + vf.name(), + vf.dimensions(), + pTraits::zero + ) + ) + ); + + GeometricField& sfCorr = tsfCorr(); + + const surfaceScalarField& faceFlux = this->faceFlux_; + const surfaceScalarField& w = mesh.weights(); + + const labelList& own = mesh.owner(); + const labelList& nei = mesh.neighbour(); + + const vectorField& C = mesh.C(); + const vectorField& Cf = mesh.Cf(); + + GeometricField + ::type, fvPatchField, volMesh> + gradVf = gradScheme_().grad(vf); + + forAll(faceFlux, facei) + { + vector maxCorr; + + if (faceFlux[facei] > 0.0) + { + maxCorr = + (1.0 - w[facei]) + *(vf[nei[facei]] - vf[own[facei]]); + + sfCorr[facei] = + (Cf[facei] - C[own[facei]]) & gradVf[own[facei]]; + } + else + { + maxCorr = + w[facei]*(vf[own[facei]] - vf[nei[facei]]); + + sfCorr[facei] = + (Cf[facei] - C[nei[facei]]) & gradVf[nei[facei]]; + } + + scalar sfCorrs = magSqr(sfCorr[facei]); + scalar maxCorrs = sfCorr[facei] & maxCorr; + + if (sfCorrs > 0) + { + if (maxCorrs < 0) + { + sfCorr[facei] = vector::zero; + } + else if (sfCorrs > maxCorrs) + { + sfCorr[facei] *= maxCorrs/(sfCorrs + VSMALL); + } + } + else if (sfCorrs < 0) + { + if (maxCorrs > 0) + { + sfCorr[facei] = vector::zero; + } + else if (sfCorrs < maxCorrs) + { + sfCorr[facei] *= maxCorrs/(sfCorrs - VSMALL); + } + } + } + + return tsfCorr; +} + + +namespace Foam +{ + makelimitedSurfaceInterpolationTypeScheme(linearUpwindV, vector) +} + +// ************************************************************************* // diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwindV/linearUpwindV.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.H similarity index 58% rename from src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwindV/linearUpwindV.H rename to src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.H index 6982cde3d6..7f8c9de742 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwindV/linearUpwindV.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.H @@ -90,7 +90,7 @@ public: ) {} - //- Construct from Istream. + //- Construct from Istream. // The name of the flux field is read from the Istream and looked-up // from the mesh objectRegistry linearUpwindV @@ -142,97 +142,9 @@ public: virtual tmp > correction ( - const GeometricField& vf - ) const - { - const fvMesh& mesh = this->mesh(); + const GeometricField& + ) const; - tmp > tsfCorr - ( - new GeometricField - ( - IOobject - ( - vf.name(), - mesh.time().timeName(), - mesh - ), - mesh, - dimensioned - ( - vf.name(), - vf.dimensions(), - pTraits::zero - ) - ) - ); - - GeometricField& sfCorr = tsfCorr(); - - const surfaceScalarField& faceFlux = this->faceFlux_; - const surfaceScalarField& w = mesh.weights(); - - const labelList& own = mesh.owner(); - const labelList& nei = mesh.neighbour(); - - const vectorField& C = mesh.C(); - const vectorField& Cf = mesh.Cf(); - - GeometricField - ::type, fvPatchField, volMesh> - gradVf = gradScheme_().grad(vf); - - forAll(faceFlux, facei) - { - vector maxCorr; - - if (faceFlux[facei] > 0.0) - { - maxCorr = - (1.0 - w[facei]) - *(vf[nei[facei]] - vf[own[facei]]); - - sfCorr[facei] = - (Cf[facei] - C[own[facei]]) & gradVf[own[facei]]; - } - else - { - maxCorr = - w[facei]*(vf[own[facei]] - vf[nei[facei]]); - - sfCorr[facei] = - (Cf[facei] - C[nei[facei]]) & gradVf[nei[facei]]; - } - - scalar sfCorrs = magSqr(sfCorr[facei]); - scalar maxCorrs = sfCorr[facei] & maxCorr; - - if (sfCorrs > 0) - { - if (maxCorrs < 0) - { - sfCorr[facei] = vector::zero; - } - else if (sfCorrs > maxCorrs) - { - sfCorr[facei] *= maxCorrs/(sfCorrs + VSMALL); - } - } - else if (sfCorrs < 0) - { - if (maxCorrs > 0) - { - sfCorr[facei] = vector::zero; - } - else if (sfCorrs < maxCorrs) - { - sfCorr[facei] *= maxCorrs/(sfCorrs - VSMALL); - } - } - } - - return tsfCorr; - } }; diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwindV/linearUpwindV.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwindV/linearUpwindV.C deleted file mode 100644 index e1ef0dc025..0000000000 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwindV/linearUpwindV.C +++ /dev/null @@ -1,39 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "linearUpwindV.H" -#include "fvMesh.H" -#include "volFields.H" -#include "surfaceFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makelimitedSurfaceInterpolationTypeScheme(linearUpwindV, vector) -} - -// ************************************************************************* // diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.H index cd52bc8764..de0636c4d3 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.H @@ -58,11 +58,11 @@ class UpwindFitData // Private data //- For each face of the mesh store the coefficients to multiply the - // stencil cell values by if the flow is from the owner + // stencil cell values by if the flow is from the owner List owncoeffs_; //- For each face of the mesh store the coefficients to multiply the - // stencil cell values by if the flow is from the neighbour + // stencil cell values by if the flow is from the neighbour List neicoeffs_; diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitScheme.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitScheme.H index 67dad671fa..30444aafa4 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitScheme.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitScheme.H @@ -26,7 +26,7 @@ Class Foam::UpwindFitScheme Description - Upwind biased fit surface interpolation scheme which applies an explicit + Upwind biased fit surface interpolation scheme that applies an explicit correction to linear. \*---------------------------------------------------------------------------*/ diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/biLinearFit/biLinearFitPolynomial.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/biLinearFit/biLinearFitPolynomial.H index 5960f54ee2..ad8975d2e1 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/biLinearFit/biLinearFitPolynomial.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/biLinearFit/biLinearFitPolynomial.H @@ -27,7 +27,8 @@ Class Description BiLinear polynomial for interpolation fitting. - Can be used with the CentredFit scheme to crate a biLinear surface + + Can be used with the CentredFit scheme to create a biLinear surface interpolation scheme \*---------------------------------------------------------------------------*/ diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubicUpwindFit/cubicUpwindFitPolynomial.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubicUpwindFit/cubicUpwindFitPolynomial.H index dab0871b8e..182a5608c2 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubicUpwindFit/cubicUpwindFitPolynomial.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubicUpwindFit/cubicUpwindFitPolynomial.H @@ -28,7 +28,7 @@ Class Description Cubic polynomial for upwind biased interpolation fitting. - Can be used with the UpwindFit scheme to crate a cubic surface + Can be used with the UpwindFit scheme to create a cubic surface interpolation scheme \*---------------------------------------------------------------------------*/ diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/fixedBlended/fixedBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/fixedBlended/fixedBlended.H index a3e615cc52..cffa51d223 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/fixedBlended/fixedBlended.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/fixedBlended/fixedBlended.H @@ -125,6 +125,7 @@ public: } } + //- Construct from mesh, faceFlux and Istream fixedBlended ( @@ -165,7 +166,8 @@ public: // Member Functions //- Return the interpolation weighting factors - tmp weights + tmp + weights ( const GeometricField& vf ) const @@ -175,15 +177,74 @@ public: + (scalar(1.0) - blendingFactor_)*tScheme2_().weights(vf); } + //- Return the face-interpolate of the given cell field // with explicit correction tmp > - interpolate(const GeometricField& vf) const + interpolate + ( + const GeometricField& vf + ) const { return blendingFactor_*tScheme1_().interpolate(vf) + (scalar(1.0) - blendingFactor_)*tScheme2_().interpolate(vf); } + + + //- Return true if this scheme uses an explicit correction + virtual bool corrected() const + { + return tScheme1_().corrected() || tScheme2_().corrected(); + } + + + //- Return the explicit correction to the face-interpolate + // for the given field + virtual tmp > + correction + ( + const GeometricField& vf + ) const + { + if (tScheme1_().corrected()) + { + if (tScheme2_().corrected()) + { + return + ( + blendingFactor_ + * tScheme1_().correction(vf) + + (scalar(1.0) - blendingFactor_) + * tScheme2_().correction(vf) + ); + } + else + { + return + ( + blendingFactor_ + * tScheme1_().correction(vf) + ); + } + } + else if (tScheme2_().corrected()) + { + return + ( + (scalar(1.0) - blendingFactor_) + * tScheme2_().correction(vf) + ); + } + else + { + return tmp > + ( + NULL + ); + } + } + }; diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/harmonic/harmonic.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/harmonic/harmonic.H index be52e6837a..594c3fcd43 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/harmonic/harmonic.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/harmonic/harmonic.H @@ -26,9 +26,10 @@ Class Foam::harmonic Description - Harmonic-mean differencing scheme class. This scheme interpolates 1/field - using a scheme specified at run-time and return the reciprocal of the - interpolate. + Harmonic-mean differencing scheme class. + + This scheme interpolates 1/field using a scheme specified at run-time + and return the reciprocal of the interpolate. SourceFiles harmonic.C @@ -76,7 +77,7 @@ public: surfaceInterpolationScheme(mesh) {} - //- Construct from Istream. + //- Construct from Istream. // The name of the flux field is read from the Istream and looked-up // from the mesh objectRegistry harmonic diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearFit/linearFitPolynomial.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearFit/linearFitPolynomial.H index 72192a71be..3c0a095200 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearFit/linearFitPolynomial.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearFit/linearFitPolynomial.H @@ -27,7 +27,8 @@ Class Description Linear polynomial for interpolation fitting. - Can be used with the CentredFit scheme to crate a linear surface + + Can be used with the CentredFit scheme to create a linear surface interpolation scheme \*---------------------------------------------------------------------------*/ diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMax/localMax.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMax/localMax.H index 108c6e8973..3fe3f21001 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMax/localMax.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMax/localMax.H @@ -26,9 +26,10 @@ Class Foam::localMax Description - LocalMax-mean differencing scheme class. This scheme interpolates 1/field - using a scheme specified at run-time and return the reciprocal of the - interpolate. + LocalMax-mean differencing scheme class. + + This scheme interpolates 1/field using a scheme specified at run-time + and return the reciprocal of the interpolate. SourceFiles localMax.C diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMin/localMin.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMin/localMin.H index b5e2e3ba42..302e5bfd85 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMin/localMin.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMin/localMin.H @@ -26,9 +26,10 @@ Class Foam::localMin Description - LocalMin-mean differencing scheme class. This scheme interpolates 1/field - using a scheme specified at run-time and return the reciprocal of the - interpolate. + LocalMin-mean differencing scheme class. + + This scheme interpolates 1/field using a scheme specified at run-time + and return the reciprocal of the interpolate. SourceFiles localMin.C diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/outletStabilised/outletStabilised.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/outletStabilised/outletStabilised.H index cb32f8e0c1..dbe27c5996 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/outletStabilised/outletStabilised.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/outletStabilised/outletStabilised.H @@ -27,9 +27,11 @@ Class Description Outlet-stabilised interpolation scheme which applies upwind differencing - to the faces of teh cells adjacent to outlets. This is particularly - useful to stabilise the velocity at entrainment boundaries for LES - cases using linear or other centred differencing schemes. + to the faces of the cells adjacent to outlets. + + This is particularly useful to stabilise the velocity at entrainment + boundaries for LES cases using linear or other centred differencing + schemes. SourceFiles outletStabilised.C @@ -138,7 +140,7 @@ public: forAll(vf.boundaryField(), patchi) { - if + if ( isA > (vf.boundaryField()[patchi]) @@ -187,7 +189,7 @@ public: { if (tScheme_().corrected()) { - tmp > tcorr = + tmp > tcorr = tScheme_().correction(vf); GeometricField& corr = tcorr(); @@ -197,7 +199,7 @@ public: forAll(vf.boundaryField(), patchi) { - if + if ( isA > (vf.boundaryField()[patchi]) @@ -230,7 +232,7 @@ public: } else { - return + return tmp >(NULL); } } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticFit/quadraticFitPolynomial.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticFit/quadraticFitPolynomial.H index 5ba7520df1..e55ba88ea3 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticFit/quadraticFitPolynomial.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticFit/quadraticFitPolynomial.H @@ -28,7 +28,7 @@ Class Description Quadratic polynomial for centred interpolation fitting. - Can be used with the CentredFit scheme to crate a quadratic surface + Can be used with the CentredFit scheme to create a quadratic surface interpolation scheme \*---------------------------------------------------------------------------*/ diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearFit/quadraticLinearFitPolynomial.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearFit/quadraticLinearFitPolynomial.H index 75446b8214..0b9ef63b82 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearFit/quadraticLinearFitPolynomial.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearFit/quadraticLinearFitPolynomial.H @@ -30,7 +30,7 @@ Description quadratic normal to the face, linear in the plane of the face for consistency with 2nd-order Gauss. - Can be used with the CentredFit scheme to crate a quadratic surface + Can be used with the CentredFit scheme to create a quadratic surface interpolation scheme \*---------------------------------------------------------------------------*/ diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearUpwindFit/quadraticLinearUpwindFitPolynomial.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearUpwindFit/quadraticLinearUpwindFitPolynomial.H index b904d6baa8..5bfc56be79 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearUpwindFit/quadraticLinearUpwindFitPolynomial.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearUpwindFit/quadraticLinearUpwindFitPolynomial.H @@ -28,7 +28,7 @@ Class Description Quadratic polynomial for upwind biased interpolation fitting. - Can be used with the UpwindFit scheme to crate a quadratic surface + Can be used with the UpwindFit scheme to create a quadratic surface interpolation scheme \*---------------------------------------------------------------------------*/ diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticUpwindFit/quadraticUpwindFitPolynomial.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticUpwindFit/quadraticUpwindFitPolynomial.H index 7256d601a3..0646af67d4 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticUpwindFit/quadraticUpwindFitPolynomial.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticUpwindFit/quadraticUpwindFitPolynomial.H @@ -28,7 +28,7 @@ Class Description Quadratic polynomial for upwind biased interpolation fitting. - Can be used with the UpwindFit scheme to crate a quadratic surface + Can be used with the UpwindFit scheme to create a quadratic surface interpolation scheme \*---------------------------------------------------------------------------*/ diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/reverseLinear/reverseLinear.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/reverseLinear/reverseLinear.H index c778503daa..2d5bc309e9 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/reverseLinear/reverseLinear.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/reverseLinear/reverseLinear.H @@ -27,6 +27,7 @@ Class Description Inversed weight central-differencing interpolation scheme class. + Useful for inverse weighted and harmonic interpolations. SourceFiles diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrected.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrected.H index 7996828086..047f5c7df1 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrected.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrected.H @@ -26,7 +26,7 @@ Class Foam::skewCorrected Description - Skewness-corrected interpolation scheme which applies an explicit + Skewness-corrected interpolation scheme that applies an explicit correction to given scheme. SourceFiles