gaussLaplacianScheme.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::fv::gaussLaplacianScheme
29 
30 Group
31  grpFvLaplacianSchemes
32 
33 Description
34  Basic second-order laplacian using face-gradients and Gauss' theorem.
35 
36 SourceFiles
37  gaussLaplacianScheme.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef gaussLaplacianScheme_H
42 #define gaussLaplacianScheme_H
43 
44 #include "laplacianScheme.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace fv
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class gaussLaplacianScheme Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class Type, class GType>
62 :
63  public fv::laplacianScheme<Type, GType>
64 {
65  // Private Member Functions
66 
68  (
69  const surfaceVectorField& SfGammaCorr,
71  );
72 
73  //- No copy construct
75 
76  //- No copy assignment
77  void operator=(const gaussLaplacianScheme&) = delete;
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("Gauss");
84 
85 
86  // Constructors
87 
88  //- Construct null
90  :
91  laplacianScheme<Type, GType>(mesh)
92  {}
93 
94  //- Construct from Istream
96  :
97  laplacianScheme<Type, GType>(mesh, is)
98  {}
99 
100  //- Construct from mesh, interpolation and snGradScheme schemes
102  (
103  const fvMesh& mesh,
105  const tmp<snGradScheme<Type>>& sngs
106  )
107  :
108  laplacianScheme<Type, GType>(mesh, igs, sngs)
109  {}
110 
111 
112  //- Destructor
113  virtual ~gaussLaplacianScheme() = default;
114 
115 
116  // Member Functions
117 
119  (
120  const surfaceScalarField& gammaMagSf,
121  const surfaceScalarField& deltaCoeffs,
123  );
124 
126  (
128  );
129 
131  (
134  );
135 
137  (
140  );
141 };
142 
143 
144 // Use macros to emulate partial-specialisation of the Laplacian functions
145 // for scalar diffusivity gamma
146 
147 #define defineFvmLaplacianScalarGamma(Type) \
148  \
149 template<> \
150 tmp<fvMatrix<Type>> gaussLaplacianScheme<Type, scalar>::fvmLaplacian \
151 ( \
152  const GeometricField<scalar, fvsPatchField, surfaceMesh>&, \
153  const GeometricField<Type, fvPatchField, volMesh>& \
154 ); \
155  \
156 template<> \
157 tmp<GeometricField<Type, fvPatchField, volMesh>> \
158 gaussLaplacianScheme<Type, scalar>::fvcLaplacian \
159 ( \
160  const GeometricField<scalar, fvsPatchField, surfaceMesh>&, \
161  const GeometricField<Type, fvPatchField, volMesh>& \
162 );
163 
164 
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace fv
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #ifdef NoRepository
183  #include "gaussLaplacianScheme.C"
184 #endif
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
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::gaussLaplacianScheme::TypeName
TypeName("Gauss")
Runtime type information.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fv::gaussLaplacianScheme::fvcLaplacian
tmp< GeometricField< Type, fvPatchField, volMesh > > fvcLaplacian(const GeometricField< Type, fvPatchField, volMesh > &)
Definition: gaussLaplacianScheme.C:140
laplacianScheme.H
Foam::fv::laplacianScheme
Abstract base class for laplacian schemes.
Definition: laplacianScheme.H:70
Foam::fv::gaussLaplacianScheme::~gaussLaplacianScheme
virtual ~gaussLaplacianScheme()=default
Destructor.
Foam::fv::gaussLaplacianScheme
Basic second-order laplacian using face-gradients and Gauss' theorem.
Definition: gaussLaplacianScheme.H:60
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::fv::gaussLaplacianScheme::fvmLaplacian
tmp< fvMatrix< Type > > fvmLaplacian(const GeometricField< GType, fvsPatchField, surfaceMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
Definition: gaussLaplacianScheme.C:160
Foam::fv::gaussLaplacianScheme::fvmLaplacianUncorrected
static tmp< fvMatrix< Type > > fvmLaplacianUncorrected(const surfaceScalarField &gammaMagSf, const surfaceScalarField &deltaCoeffs, const GeometricField< Type, fvPatchField, volMesh > &)
Definition: gaussLaplacianScheme.C:49
Foam::symmTensor
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Definition: symmTensor.H:59
defineFvmLaplacianScalarGamma
#define defineFvmLaplacianScalarGamma(Type)
Definition: gaussLaplacianScheme.H:146
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
fv
labelList fv(nPoints)
gaussLaplacianScheme.C
Foam::surfaceInterpolationScheme< GType >
Foam::fv::gaussLaplacianScheme::gaussLaplacianScheme
gaussLaplacianScheme(const fvMesh &mesh, Istream &is)
Construct from Istream.
Definition: gaussLaplacianScheme.H:94
Foam::fv::snGradScheme
Abstract base class for snGrad schemes.
Definition: snGradScheme.H:65
Foam::GeometricField< vector, fvsPatchField, surfaceMesh >
Foam::tensor
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.
Definition: symmTensor.H:61
Foam::fv::gaussLaplacianScheme::gaussLaplacianScheme
gaussLaplacianScheme(const fvMesh &mesh)
Construct null.
Definition: gaussLaplacianScheme.H:88