fvmLaplacian.C
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-------------------------------------------------------------------------------
10License
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\*---------------------------------------------------------------------------*/
27
28#include "volFields.H"
29#include "surfaceFields.H"
30#include "fvMatrix.H"
31#include "laplacianScheme.H"
32
33// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34
35namespace Foam
36{
37
38// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39
40namespace fvm
41{
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45template<class Type>
46tmp<fvMatrix<Type>>
48(
50 const word& name
51)
52{
54 (
56 (
57 "1",
58 vf.time().constant(),
59 vf.mesh(),
61 ),
62 vf.mesh(),
63 dimensionedScalar("1", dimless, 1.0)
64 );
65
66 return fvm::laplacian(Gamma, vf, name);
67}
68
69
70template<class Type>
73(
75)
76{
78 (
80 (
81 "1",
82 vf.time().constant(),
83 vf.mesh(),
85 ),
86 vf.mesh(),
87 dimensionedScalar("1", dimless, 1.0)
88 );
89
90 return fvm::laplacian
91 (
92 Gamma,
93 vf,
94 "laplacian(" + vf.name() + ')'
95 );
96}
97
98
99template<class Type>
102(
103 const zero&,
105 const word& name
106)
107{
108 return tmp<fvMatrix<Type>>
109 (
110 new fvMatrix<Type>(vf, dimensionSet(0, 0, -2, 0, 0))
111 );
112}
113
114
115template<class Type>
118(
119 const zero&,
121)
122{
123 return tmp<fvMatrix<Type>>
124 (
125 new fvMatrix<Type>(vf, dimensionSet(0, 0, -2, 0, 0))
126 );
127}
128
129
130template<class Type>
133(
134 const one&,
136 const word& name
137)
138{
139 return fvm::laplacian(vf, name);
140}
141
142
143template<class Type>
146(
147 const one&,
149)
150{
151 return fvm::laplacian(vf);
152}
153
154
155template<class Type, class GType>
158(
161 const word& name
162)
163{
165 (
167 (
168 gamma.name(),
169 vf.instance(),
170 vf.mesh(),
172 ),
173 vf.mesh(),
174 gamma
175 );
176
177 return fvm::laplacian(Gamma, vf, name);
178}
179
180
181template<class Type, class GType>
184(
187)
188{
190 (
192 (
193 gamma.name(),
194 vf.instance(),
195 vf.mesh(),
197 ),
198 vf.mesh(),
199 gamma
200 );
201
202 return fvm::laplacian(Gamma, vf);
203}
204
205
206// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207
208template<class Type, class GType>
211(
214 const word& name
215)
216{
218 (
219 vf.mesh(),
220 vf.mesh().laplacianScheme(name)
221 ).ref().fvmLaplacian(gamma, vf);
222}
223
224
225template<class Type, class GType>
228(
231 const word& name
232)
233{
234 tmp<fvMatrix<Type>> Laplacian(fvm::laplacian(tgamma(), vf, name));
235 tgamma.clear();
236 return Laplacian;
237}
238
239
240template<class Type, class GType>
243(
246)
247{
248 return fvm::laplacian
249 (
250 gamma,
251 vf,
252 "laplacian(" + gamma.name() + ',' + vf.name() + ')'
253 );
254}
255
256
257template<class Type, class GType>
260(
263)
264{
265 tmp<fvMatrix<Type>> Laplacian(fvm::laplacian(tgamma(), vf));
266 tgamma.clear();
267 return Laplacian;
268}
269
270
271// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
272
273template<class Type, class GType>
276(
279 const word& name
280)
281{
283 (
284 vf.mesh(),
285 vf.mesh().laplacianScheme(name)
286 ).ref().fvmLaplacian(gamma, vf);
287}
288
289
290template<class Type, class GType>
293(
296 const word& name
297)
298{
299 tmp<fvMatrix<Type>> tLaplacian = fvm::laplacian(tgamma(), vf, name);
300 tgamma.clear();
301 return tLaplacian;
302}
303
304
305template<class Type, class GType>
308(
311)
312{
313 return fvm::laplacian
314 (
315 gamma,
316 vf,
317 "laplacian(" + gamma.name() + ',' + vf.name() + ')'
318 );
319}
320
321
322template<class Type, class GType>
325(
328)
329{
330 tmp<fvMatrix<Type>> tfvm(fvm::laplacian(tGamma(), vf));
331 tGamma.clear();
332 return tfvm;
333}
334
335
336// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
337
338} // End namespace fvm
339
340// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
341
342} // End namespace Foam
343
344// ************************************************************************* //
const Mesh & mesh() const
Return mesh.
Generic GeometricField class.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:65
const Time & time() const
Return Time associated with the objectRegistry.
Definition: IOobject.C:506
const fileName & instance() const noexcept
Read access to instance path component.
Definition: IOobjectI.H:196
const word & constant() const
Return constant name.
Definition: TimePathsI.H:96
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:109
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:121
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Definition: one.H:62
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
const scalar gamma
Definition: EEqn.H:9
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvmLaplacian.C:48
Namespace for OpenFOAM.
const dimensionSet dimless
Dimensionless.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::surfaceFields.