Loading...
Searching...
No Matches
fusedGaussLaplacianScheme.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 Copyright (C) 2024 M. Janssens
11-------------------------------------------------------------------------------
12License
13 This file is part of OpenFOAM.
14
15 OpenFOAM is free software: you can redistribute it and/or modify it
16 under the terms of the GNU General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
19
20 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27
28Class
29 Foam::fv::GaussLaplacianScheme
30
31Group
32 grpFvLaplacianSchemes
33
34Description
35 Variant of GaussLaplacian that avoids intermediate fields
36
37SourceFiles
38 fusedGaussLaplacianScheme.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef fusedGaussLaplacianScheme_H
43#define fusedGaussLaplacianScheme_H
44
45#include "laplacianScheme.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53
54namespace fv
55{
56
57/*---------------------------------------------------------------------------*\
58 Class fusedGaussLaplacianScheme Declaration
59\*---------------------------------------------------------------------------*/
60
61template<class Type, class GType>
62class fusedGaussLaplacianScheme
63:
64 public fv::laplacianScheme<Type, GType>
65{
66 // Private Member Functions
67
68 //- Helper for calculate source correction. Partially expression
69 // templated. Move to fvMatrixExpression.H?
70 template<class E1, class E2>
71 static void fvmCorrection
72 (
74 const dimensionSet& gammaDim,
75 const E1& gammaMagSf,
76 const E2& corr
77 );
78
79 //- See gaussLaplacianScheme
81 (
82 const surfaceVectorField& SfGammaCorr,
84 );
85
86 //- No copy construct
87 fusedGaussLaplacianScheme(const fusedGaussLaplacianScheme&)
88 = delete;
89
90 //- No copy assignment
91 void operator=(const fusedGaussLaplacianScheme&) = delete;
92
93
94public:
95
96 //- Runtime type information
97 TypeName("fusedGauss");
98
99
100 // Constructors
101
102 //- Construct null
103 fusedGaussLaplacianScheme(const fvMesh& mesh)
104 :
105 laplacianScheme<Type, GType>(mesh)
106 {}
107
108 //- Construct from Istream
110 :
111 laplacianScheme<Type, GType>(mesh, is)
112 {}
113
114 //- Construct from mesh, interpolation and snGradScheme schemes
116 (
117 const fvMesh& mesh,
120 )
121 :
122 laplacianScheme<Type, GType>(mesh, igs, sngs)
123 {}
124
125
126 //- Destructor
127 virtual ~fusedGaussLaplacianScheme() = default;
128
129
130 // Member Functions
131
133 (
134 const surfaceScalarField& gammaMagSf,
135 const surfaceScalarField& deltaCoeffs,
137 );
138
143 //static void gradComponent
144 //(
145 // const surfaceScalarField& weights,
146 // const GeometricField<Type, fvPatchField, volMesh>& vf,
147 // const direction cmpt,
148 // GeometricField<Type, fvPatchField, volMesh>& gGrad
149 //);
150
152 (
154 );
155
157 (
160 );
161
163 (
166 );
167
168
169 // New: override laplacianScheme::fvc/mLaplacian for scalar gamma and
170 // scalar,vector volField
171
173 (
176 );
177
179 (
182 );
183};
184
185
186// Use macros to emulate partial-specialisation of the Laplacian functions
187// for scalar diffusivity gamma
188
189#define defineFvmLaplacianScalarGamma(Type) \
190 \
191template<> \
192tmp<fvMatrix<Type>> fusedGaussLaplacianScheme<Type, scalar>::fvmLaplacian \
193( \
194 const GeometricField<scalar, fvsPatchField, surfaceMesh>&, \
195 const GeometricField<Type, fvPatchField, volMesh>& \
196); \
197 \
198template<> \
199tmp<GeometricField<Type, fvPatchField, volMesh>> \
200fusedGaussLaplacianScheme<Type, scalar>::fvcLaplacian \
201( \
202 const GeometricField<scalar, fvsPatchField, surfaceMesh>&, \
203 const GeometricField<Type, fvPatchField, volMesh>& \
204);
205
211
212#undef defineFvmLaplacianScalarGamma
213
214// Unweighted laplacian
215template<>
216tmp<GeometricField<scalar, fvPatchField, volMesh>>
218(
219 const GeometricField<scalar, fvPatchField, volMesh>&
221template<>
226);
227
228// Weighted laplacian
229template<>
232(
235);
236template<>
239(
242);
243
244
245// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246
247} // End namespace fv
248
249// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250
251} // End namespace Foam
253// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
254
255#ifdef NoRepository
257#endif
258
259// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
260
261#endif
262
263// ************************************************************************* //
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition fvMatrix.H:118
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
virtual tmp< GeometricField< Type, fvPatchField, volMesh > > fvcLaplacian(const GeometricField< Type, fvPatchField, volMesh > &)
virtual ~fusedGaussLaplacianScheme()=default
Destructor.
fusedGaussLaplacianScheme(const fvMesh &mesh, Istream &is)
Construct from Istream.
fusedGaussLaplacianScheme(const fvMesh &mesh)
Construct null.
virtual tmp< fvMatrix< Type > > fvmLaplacian(const GeometricField< GType, fvsPatchField, surfaceMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
static tmp< fvMatrix< Type > > fvmLaplacianUncorrected(const surfaceScalarField &gammaMagSf, const surfaceScalarField &deltaCoeffs, const GeometricField< Type, fvPatchField, volMesh > &)
fusedGaussLaplacianScheme(const fvMesh &mesh, const tmp< surfaceInterpolationScheme< GType > > &igs, const tmp< snGradScheme< Type > > &sngs)
Construct from mesh, interpolation and snGradScheme schemes.
TypeName("fusedGauss")
Runtime type information.
Abstract base class for laplacian schemes.
laplacianScheme(const laplacianScheme &)=delete
No copy construct.
const fvMesh & mesh() const
Return mesh reference.
Abstract base class for runtime selected snGrad surface normal gradient schemes.
Abstract base class for surface interpolation schemes.
Tensor of scalars, i.e. Tensor<scalar>.
A class for managing temporary objects.
Definition tmp.H:75
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
dynamicFvMesh & mesh
#define defineFvmLaplacianScalarGamma(Type)
Namespace of functions to calculate implicit derivatives returning a matrix.
Namespace for OpenFOAM.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Tensor< scalar > tensor
Definition symmTensor.H:57
Vector< scalar > vector
Definition vector.H:57
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Definition symmTensor.H:55
labelList fv(nPoints)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68