fvcLaplacian.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 "fvcLaplacian.H"
29#include "fvMesh.H"
30#include "laplacianScheme.H"
31
32// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33
34namespace Foam
35{
36
37// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38
39namespace fvc
40{
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44template<class Type>
45tmp<GeometricField<Type, fvPatchField, volMesh>>
47(
49 const word& name
50)
51{
53 (
54 vf.mesh(),
55 vf.mesh().laplacianScheme(name)
56 ).ref().fvcLaplacian(vf);
57}
58
59
60template<class Type>
63(
65 const word& name
66)
67{
69 (
70 fvc::laplacian(tvf(), name)
71 );
72 tvf.clear();
73 return Laplacian;
74}
75
76
77template<class Type>
80(
82)
83{
84 return fvc::laplacian(vf, "laplacian(" + vf.name() + ')');
85}
86
87
88template<class Type>
91(
93)
94{
96 (
97 fvc::laplacian(tvf())
98 );
99 tvf.clear();
100 return Laplacian;
101}
102
103
104// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105
106template<class Type, class GType>
109(
112 const word& name
113)
114{
116 (
118 (
119 gamma.name(),
120 vf.instance(),
121 vf.mesh(),
123 ),
124 vf.mesh(),
125 gamma
126 );
127
128 return fvc::laplacian(Gamma, vf, name);
129}
130
131
132template<class Type, class GType>
135(
138 const word& name
139)
140{
142 (
143 fvc::laplacian(gamma, tvf(), name)
144 );
145 tvf.clear();
146 return Laplacian;
147}
148
149
150template<class Type, class GType>
153(
156)
157{
159 (
161 (
162 gamma.name(),
163 vf.instance(),
164 vf.mesh(),
166 ),
167 vf.mesh(),
168 gamma
169 );
170
171 return fvc::laplacian(Gamma, vf);
172}
173
174
175template<class Type, class GType>
178(
181)
182{
184 (
185 fvc::laplacian(gamma, tvf())
186 );
187 tvf.clear();
188 return Laplacian;
189}
190
191
192// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193
194template<class Type, class GType>
197(
200 const word& name
201)
202{
204 (
205 vf.mesh(),
206 vf.mesh().laplacianScheme(name)
207 ).ref().fvcLaplacian(gamma, vf);
208}
209
210
211template<class Type, class GType>
214(
217 const word& name
218)
219{
221 (
222 fvc::laplacian(tgamma(), vf, name)
223 );
224 tgamma.clear();
225 return Laplacian;
226}
227
228
229template<class Type, class GType>
232(
235 const word& name
236)
237{
239 (
240 fvc::laplacian(gamma, tvf(), name)
241 );
242 tvf.clear();
243 return Laplacian;
244}
245
246
247template<class Type, class GType>
250(
253 const word& name
254)
255{
257 (
258 fvc::laplacian(tgamma(), tvf(), name)
259 );
260 tgamma.clear();
261 tvf.clear();
262 return Laplacian;
263}
264
265
266template<class Type, class GType>
269(
272)
273{
274 return fvc::laplacian
275 (
276 gamma,
277 vf,
278 "laplacian(" + gamma.name() + ',' + vf.name() + ')'
279 );
280}
281
282
283template<class Type, class GType>
286(
289)
290{
291 return fvc::laplacian
292 (
293 tgamma,
294 vf,
295 "laplacian(" + tgamma().name() + ',' + vf.name() + ')'
296 );
297}
298
299
300template<class Type, class GType>
303(
306)
307{
308 return fvc::laplacian
309 (
310 gamma,
311 tvf,
312 "laplacian(" + gamma.name() + ',' + tvf().name() + ')'
313 );
314}
315
316
317template<class Type, class GType>
320(
323)
324{
325 return fvc::laplacian
326 (
327 tgamma,
328 tvf,
329 "laplacian(" + tgamma().name() + ',' + tvf().name() + ')'
330 );
331}
332
333
334// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
335
336template<class Type, class GType>
339(
342 const word& name
343)
344{
346 (
347 vf.mesh(),
348 vf.mesh().laplacianScheme(name)
349 ).ref().fvcLaplacian(gamma, vf);
350}
351
352
353template<class Type, class GType>
356(
359 const word& name
360)
361{
363 (
364 fvc::laplacian(tgamma(), vf, name)
365 );
366 tgamma.clear();
367 return Laplacian;
368}
369
370
371template<class Type, class GType>
374(
377 const word& name
378)
379{
381 (
382 fvc::laplacian(gamma, tvf(), name)
383 );
384 tvf.clear();
385 return Laplacian;
386}
387
388
389template<class Type, class GType>
391(
394 const word& name
395)
396{
398 (
399 fvc::laplacian(tgamma(), tvf(), name)
400 );
401 tgamma.clear();
402 tvf.clear();
403 return Laplacian;
404}
405
406
407template<class Type, class GType>
410(
413)
414{
415 return fvc::laplacian
416 (
417 gamma,
418 vf,
419 "laplacian(" + gamma.name() + ',' + vf.name() + ')'
420 );
421}
422
423
424template<class Type, class GType>
427(
430)
431{
433 (
434 fvc::laplacian(tgamma(), vf)
435 );
436 tgamma.clear();
437 return Laplacian;
438}
439
440
441template<class Type, class GType>
444(
447)
448{
450 (
451 fvc::laplacian(gamma, tvf())
452 );
453 tvf.clear();
454 return Laplacian;
455}
456
457
458template<class Type, class GType>
460(
463)
464{
466 (
467 fvc::laplacian(tgamma(), tvf())
468 );
469 tgamma.clear();
470 tvf.clear();
471 return Laplacian;
472}
473
474
475// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
476
477} // End namespace fvc
478
479// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
480
481} // End namespace Foam
482
483// ************************************************************************* //
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 fileName & instance() const noexcept
Read access to instance path component.
Definition: IOobjectI.H:196
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Generic dimensioned Type class.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
const scalar gamma
Definition: EEqn.H:9
Calculate the laplacian of the given field.
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:47
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59