relaxedNonOrthoGaussLaplacianScheme.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2019 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fv::relaxedNonOrthoGaussLaplacianScheme
28 
29 Description
30  Basic second-order laplacian using face-gradients and Gauss' theorem.
31 
32 Usage
33  Minimal example by using \c system/fvSchemes:
34  \verbatim
35  laplacianSchemes
36  {
37  laplacian(<term>) relaxedNonOrthoGauss <other options>;
38  }
39  \endverbatim
40 
41  and by using \c system/fvSolution:
42  \verbatim
43  relaxationFactors
44  {
45  equations
46  {
47  <term> <relaxation factor>;
48  }
49  }
50  \endverbatim
51 
52 SourceFiles
53  relaxedNonOrthoGaussLaplacianScheme.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef relaxedNonOrthoGaussLaplacianScheme_H
58 #define relaxedNonOrthoGaussLaplacianScheme_H
59 
60 #include "laplacianScheme.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace fv
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class relaxedNonOrthoGaussLaplacianScheme Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 template<class Type, class GType>
78 :
79  public fv::laplacianScheme<Type, GType>
80 {
81  // Private Member Functions
82 
84  (
85  const surfaceVectorField& SfGammaCorr,
87  );
88 
89  //- No copy construct
91  (
93  ) = delete;
94 
95  //- No copy assignment
96  void operator=(const relaxedNonOrthoGaussLaplacianScheme&) = delete;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("relaxedNonOrthoGauss");
103 
104 
105  // Constructors
106 
107  //- Construct null
109  :
110  laplacianScheme<Type, GType>(mesh)
111  {}
112 
113  //- Construct from Istream
115  :
116  laplacianScheme<Type, GType>(mesh, is)
117  {}
118 
119  //- Construct from mesh, interpolation and snGradScheme schemes
121  (
122  const fvMesh& mesh,
124  const tmp<snGradScheme<Type>>& sngs
125  )
126  :
127  laplacianScheme<Type, GType>(mesh, igs, sngs)
128  {}
129 
130 
131  //- Destructor
132  virtual ~relaxedNonOrthoGaussLaplacianScheme() = default;
133 
134 
135  // Member Functions
136 
138  (
139  const surfaceScalarField& gammaMagSf,
140  const surfaceScalarField& deltaCoeffs,
142  );
143 
145  (
147  );
148 
150  (
153  );
154 
156  (
159  );
160 };
161 
162 
163 // Use macros to emulate partial-specialisation of the Laplacian functions
164 // for scalar diffusivity gamma
165 
166 #define defineFvmLaplacianScalarGamma(Type) \
167  \
168 template<> \
169 tmp<fvMatrix<Type>> \
170 relaxedNonOrthoGaussLaplacianScheme<Type, scalar>::fvmLaplacian \
171 ( \
172  const GeometricField<scalar, fvsPatchField, surfaceMesh>&, \
173  const GeometricField<Type, fvPatchField, volMesh>& \
174 ); \
175  \
176 template<> \
177 tmp<GeometricField<Type, fvPatchField, volMesh>> \
178 relaxedNonOrthoGaussLaplacianScheme<Type, scalar>::fvcLaplacian \
179 ( \
180  const GeometricField<scalar, fvsPatchField, surfaceMesh>&, \
181  const GeometricField<Type, fvPatchField, volMesh>& \
182 );
183 
184 
190 
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 } // End namespace fv
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 } // End namespace Foam
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #ifdef NoRepository
204 #endif
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
Foam::fv::laplacianScheme::mesh
const fvMesh & mesh() const
Return mesh reference.
Definition: laplacianScheme.H:172
Foam::sphericalTensor
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
Definition: sphericalTensor.H:54
Foam::fv::relaxedNonOrthoGaussLaplacianScheme::fvmLaplacian
tmp< fvMatrix< Type > > fvmLaplacian(const GeometricField< GType, fvsPatchField, surfaceMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
Definition: relaxedNonOrthoGaussLaplacianScheme.C:159
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fv::relaxedNonOrthoGaussLaplacianScheme::relaxedNonOrthoGaussLaplacianScheme
relaxedNonOrthoGaussLaplacianScheme(const fvMesh &mesh)
Construct null.
Definition: relaxedNonOrthoGaussLaplacianScheme.H:107
relaxedNonOrthoGaussLaplacianScheme.C
Foam::fv::relaxedNonOrthoGaussLaplacianScheme::fvcLaplacian
tmp< GeometricField< Type, fvPatchField, volMesh > > fvcLaplacian(const GeometricField< Type, fvPatchField, volMesh > &)
Definition: relaxedNonOrthoGaussLaplacianScheme.C:139
laplacianScheme.H
Foam::fv::laplacianScheme
Abstract base class for laplacian schemes.
Definition: laplacianScheme.H:70
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::fv::relaxedNonOrthoGaussLaplacianScheme::TypeName
TypeName("relaxedNonOrthoGauss")
Runtime type information.
Foam::symmTensor
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Definition: symmTensor.H:59
Foam::fv::relaxedNonOrthoGaussLaplacianScheme::fvmLaplacianUncorrected
static tmp< fvMatrix< Type > > fvmLaplacianUncorrected(const surfaceScalarField &gammaMagSf, const surfaceScalarField &deltaCoeffs, const GeometricField< Type, fvPatchField, volMesh > &)
Definition: relaxedNonOrthoGaussLaplacianScheme.C:49
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
Foam::fv::relaxedNonOrthoGaussLaplacianScheme::relaxedNonOrthoGaussLaplacianScheme
relaxedNonOrthoGaussLaplacianScheme(const fvMesh &mesh, Istream &is)
Construct from Istream.
Definition: relaxedNonOrthoGaussLaplacianScheme.H:113
fv
labelList fv(nPoints)
Foam::fv::relaxedNonOrthoGaussLaplacianScheme
Basic second-order laplacian using face-gradients and Gauss' theorem.
Definition: relaxedNonOrthoGaussLaplacianScheme.H:76
Foam::fv::relaxedNonOrthoGaussLaplacianScheme::~relaxedNonOrthoGaussLaplacianScheme
virtual ~relaxedNonOrthoGaussLaplacianScheme()=default
Destructor.
defineFvmLaplacianScalarGamma
#define defineFvmLaplacianScalarGamma(Type)
Definition: relaxedNonOrthoGaussLaplacianScheme.H:165
Foam::surfaceInterpolationScheme< GType >
Foam::fv::snGradScheme
Abstract base class for runtime selected snGrad surface normal gradient schemes.
Definition: snGradScheme.H:76
Foam::GeometricField< vector, fvsPatchField, surfaceMesh >
Foam::tensor
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.
Definition: symmTensor.H:61