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 | Copyright (C) 2011-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "fvcFlux.H"
27 #include "fvMesh.H"
28 #include "convectionScheme.H"
29 
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 
37 namespace fvc
38 {
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 template<class Type>
43 tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
44 flux
45 (
46  const surfaceScalarField& phi,
48  const word& name
49 )
50 {
52  (
53  vf.mesh(),
54  phi,
55  vf.mesh().divScheme(name)
56  )().flux(phi, vf);
57 }
58 
59 
60 template<class Type>
62 flux
63 (
64  const tmp<surfaceScalarField>& tphi,
66  const word& name
67 )
68 {
70  (
71  fvc::flux(tphi(), vf, name)
72  );
73  tphi.clear();
74  return Flux;
75 }
76 
77 
78 template<class Type>
80 flux
81 (
82  const surfaceScalarField& phi,
84  const word& name
85 )
86 {
88  (
89  fvc::flux(phi, tvf(), name)
90  );
91  tvf.clear();
92  return Flux;
93 }
94 
95 
96 template<class Type>
98 flux
99 (
100  const tmp<surfaceScalarField>& tphi,
102  const word& name
103 )
104 {
106  (
107  fvc::flux(tphi(), tvf(), name)
108  );
109  tphi.clear();
110  tvf.clear();
111  return Flux;
112 }
113 
114 
115 template<class Type>
117 flux
118 (
119  const surfaceScalarField& phi,
121 )
122 {
123  return fvc::flux
124  (
125  phi, vf, "flux("+phi.name()+','+vf.name()+')'
126  );
127 }
128 
129 
130 template<class Type>
132 flux
133 (
134  const tmp<surfaceScalarField>& tphi,
136 )
137 {
139  (
140  fvc::flux(tphi(), vf)
141  );
142  tphi.clear();
143  return Flux;
144 }
145 
146 
147 template<class Type>
149 flux
150 (
151  const surfaceScalarField& phi,
153 )
154 {
156  (
157  fvc::flux(phi, tvf())
158  );
159  tvf.clear();
160  return Flux;
161 }
162 
163 
164 template<class Type>
166 flux
167 (
168  const tmp<surfaceScalarField>& tphi,
170 )
171 {
173  (
174  fvc::flux(tphi(), tvf())
175  );
176  tphi.clear();
177  tvf.clear();
178  return Flux;
179 }
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace fvc
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace Foam
189 
190 // ************************************************************************* //
surfaceScalarField & phi
void clear() const
If object pointer points to valid object:
Definition: tmpI.H:230
A class for handling words, derived from string.
Definition: word.H:59
Calculate the face-flux of the given field.
const Mesh & mesh() const
Return mesh.
static tmp< convectionScheme< Type > > New(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &schemeData)
Return a pointer to a new convectionScheme created on freestore.
A class for managing temporary objects.
Definition: PtrList.H:54
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
Definition: fvcFlux.C:32
const word & name() const
Return name.
Definition: IOobject.H:260
Namespace for OpenFOAM.