/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation ------------------------------------------------------------------------------- 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 3 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, see . Class Foam::LimitedScheme Group grpFvLimitedSurfaceInterpolationSchemes Description Class to create NVD/TVD limited weighting-factors. The particular differencing scheme class is supplied as a template argument, the weight function of which is called by the weight function of this class for the internal faces as well as faces of coupled patches (e.g. processor-processor patches). The weight function is supplied the central-differencing weighting factor, the face-flux, the cell and face gradients (from which the normalised variable distribution may be created) and the cell centre distance. This code organisation is both neat and efficient, allowing for convenient implementation of new schemes to run on parallelised cases. SourceFiles LimitedScheme.C \*---------------------------------------------------------------------------*/ #ifndef LimitedScheme_H #define LimitedScheme_H #include "limitedSurfaceInterpolationScheme.H" #include "LimitFuncs.H" #include "NVDTVD.H" #include "NVDVTVDV.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ Class LimitedScheme Declaration \*---------------------------------------------------------------------------*/ template class LimitFunc> class LimitedScheme : public limitedSurfaceInterpolationScheme, public Limiter { // Private Member Functions //- Calculate the limiter void calcLimiter ( const GeometricField& phi, surfaceScalarField& limiterField ) const; //- No copy construct LimitedScheme(const LimitedScheme&) = delete; //- No copy assignment void operator=(const LimitedScheme&) = delete; public: //- Runtime type information TypeName("LimitedScheme"); typedef Limiter LimiterType; // Constructors //- Construct from mesh and faceFlux and limiter scheme LimitedScheme ( const fvMesh& mesh, const surfaceScalarField& faceFlux, const Limiter& weight ) : limitedSurfaceInterpolationScheme(mesh, faceFlux), Limiter(weight) {} //- Construct from mesh and Istream. // The name of the flux field is read from the Istream and looked-up // from the mesh objectRegistry LimitedScheme ( const fvMesh& mesh, Istream& is ) : limitedSurfaceInterpolationScheme(mesh, is), Limiter(is) {} //- Construct from mesh, faceFlux and Istream LimitedScheme ( const fvMesh& mesh, const surfaceScalarField& faceFlux, Istream& is ) : limitedSurfaceInterpolationScheme(mesh, faceFlux), Limiter(is) {} // Member Functions //- Return the interpolation weighting factors virtual tmp limiter ( const GeometricField& ) const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Add the patch constructor functions to the hash tables #define makeLimitedSurfaceInterpolationTypeScheme\ ( \ SS, \ LIMITER, \ NVDTVD, \ LIMFUNC, \ TYPE \ ) \ \ typedef LimitedScheme, limitFuncs::LIMFUNC> \ LimitedScheme##TYPE##LIMITER##NVDTVD##LIMFUNC##_; \ defineTemplateTypeNameAndDebugWithName \ (LimitedScheme##TYPE##LIMITER##NVDTVD##LIMFUNC##_, #SS, 0); \ \ surfaceInterpolationScheme::addMeshConstructorToTable \ , limitFuncs::LIMFUNC>> \ add##SS##LIMFUNC##TYPE##MeshConstructorToTable_; \ \ surfaceInterpolationScheme::addMeshFluxConstructorToTable \ , limitFuncs::LIMFUNC>> \ add##SS##LIMFUNC##TYPE##MeshFluxConstructorToTable_; \ \ limitedSurfaceInterpolationScheme::addMeshConstructorToTable \ , limitFuncs::LIMFUNC>> \ add##SS##LIMFUNC##TYPE##MeshConstructorToLimitedTable_; \ \ limitedSurfaceInterpolationScheme::addMeshFluxConstructorToTable \ , limitFuncs::LIMFUNC>> \ add##SS##LIMFUNC##TYPE##MeshFluxConstructorToLimitedTable_; #define makeLimitedSurfaceInterpolationScheme(SS, LIMITER) \ \ makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,scalar) \ makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,vector) \ makeLimitedSurfaceInterpolationTypeScheme \ ( \ SS, \ LIMITER, \ NVDTVD, \ magSqr, \ sphericalTensor \ ) \ makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,symmTensor)\ makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDTVD,magSqr,tensor) #define makeLimitedVSurfaceInterpolationScheme(SS, LIMITER) \ makeLimitedSurfaceInterpolationTypeScheme(SS,LIMITER,NVDVTVDV,null,vector) #define makeLLimitedSurfaceInterpolationTypeScheme\ ( \ SS, \ LLIMITER, \ LIMITER, \ NVDTVD, \ LIMFUNC, \ TYPE \ ) \ \ typedef LimitedScheme>, limitFuncs::LIMFUNC> \ LimitedScheme##TYPE##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_; \ defineTemplateTypeNameAndDebugWithName \ (LimitedScheme##TYPE##LLIMITER##LIMITER##NVDTVD##LIMFUNC##_, #SS, 0); \ \ surfaceInterpolationScheme::addMeshConstructorToTable \ >, limitFuncs::LIMFUNC>> \ add##SS##LIMFUNC##TYPE##MeshConstructorToTable_; \ \ surfaceInterpolationScheme::addMeshFluxConstructorToTable \ >, limitFuncs::LIMFUNC>> \ add##SS##LIMFUNC##TYPE##MeshFluxConstructorToTable_; \ \ limitedSurfaceInterpolationScheme::addMeshConstructorToTable \ >, limitFuncs::LIMFUNC>> \ add##SS##LIMFUNC##TYPE##MeshConstructorToLimitedTable_; \ \ limitedSurfaceInterpolationScheme::addMeshFluxConstructorToTable \ >, limitFuncs::LIMFUNC>> \ add##SS##LIMFUNC##TYPE##MeshFluxConstructorToLimitedTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository #include "LimitedScheme.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //