fvcFluxTemplates.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 "fvcFlux.H"
29#include "fvMesh.H"
30#include "convectionScheme.H"
31
32// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33
34namespace Foam
35{
36
37// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38
39namespace fvc
40{
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44template<class Type>
45tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
47(
50 const word& name
51)
52{
54 (
55 vf.mesh(),
56 phi,
57 vf.mesh().divScheme(name)
58 )().flux(phi, vf);
59}
60
61
62template<class Type>
65(
66 const tmp<surfaceScalarField>& tphi,
68 const word& name
69)
70{
72 (
73 fvc::flux(tphi(), vf, name)
74 );
75 tphi.clear();
76 return Flux;
77}
78
79
80template<class Type>
83(
86 const word& name
87)
88{
90 (
91 fvc::flux(phi, tvf(), name)
92 );
93 tvf.clear();
94 return Flux;
95}
96
97
98template<class Type>
101(
102 const tmp<surfaceScalarField>& tphi,
104 const word& name
105)
106{
108 (
109 fvc::flux(tphi(), tvf(), name)
110 );
111 tphi.clear();
112 tvf.clear();
113 return Flux;
114}
115
116
117template<class Type>
120(
121 const surfaceScalarField& phi,
123)
124{
125 return fvc::flux
126 (
127 phi, vf, "flux("+phi.name()+','+vf.name()+')'
128 );
129}
130
131
132template<class Type>
135(
136 const tmp<surfaceScalarField>& tphi,
138)
139{
141 (
142 fvc::flux(tphi(), vf)
143 );
144 tphi.clear();
145 return Flux;
146}
147
148
149template<class Type>
152(
153 const surfaceScalarField& phi,
155)
156{
158 (
159 fvc::flux(phi, tvf())
160 );
161 tvf.clear();
162 return Flux;
163}
164
165
166template<class Type>
169(
170 const tmp<surfaceScalarField>& tphi,
172)
173{
175 (
176 fvc::flux(tphi(), tvf())
177 );
178 tphi.clear();
179 tvf.clear();
180 return Flux;
181}
182
183
184// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185
186} // End namespace fvc
187
188// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189
190} // End namespace Foam
191
192// ************************************************************************* //
surfaceScalarField & phi
const Mesh & mesh() const
Return mesh.
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:65
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
A class for managing temporary objects.
Definition: tmp.H:65
void clear() const noexcept
Definition: tmpI.H:287
A class for handling words, derived from Foam::string.
Definition: word.H:68
Calculate the face-flux of the given field.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
Definition: fvcFlux.C:34
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59