All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fvcFluxTemplates.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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  Istream& schemeData
49 )
50 {
52  (
53  vf.mesh(),
54  phi,
55  schemeData
56  )().flux(phi, vf);
57 }
58 
59 
60 template<class Type>
62 flux
63 (
64  const surfaceScalarField& phi,
66  const word& name
67 )
68 {
69  return fvc::flux(phi, vf, vf.mesh().divScheme(name));
70 }
71 
72 
73 template<class Type>
75 flux
76 (
77  const tmp<surfaceScalarField>& tphi,
79  const word& name
80 )
81 {
83  (
84  fvc::flux(tphi(), vf, name)
85  );
86  tphi.clear();
87  return Flux;
88 }
89 
90 
91 template<class Type>
93 flux
94 (
95  const surfaceScalarField& phi,
97  const word& name
98 )
99 {
101  (
102  fvc::flux(phi, tvf(), name)
103  );
104  tvf.clear();
105  return Flux;
106 }
107 
108 
109 template<class Type>
111 flux
112 (
113  const tmp<surfaceScalarField>& tphi,
115  const word& name
116 )
117 {
119  (
120  fvc::flux(tphi(), tvf(), name)
121  );
122  tphi.clear();
123  tvf.clear();
124  return Flux;
125 }
126 
127 
128 template<class Type>
130 flux
131 (
132  const surfaceScalarField& phi,
134 )
135 {
136  return fvc::flux
137  (
138  phi, vf, "flux("+phi.name()+','+vf.name()+')'
139  );
140 }
141 
142 
143 template<class Type>
145 flux
146 (
147  const tmp<surfaceScalarField>& tphi,
149 )
150 {
152  (
153  fvc::flux(tphi(), vf)
154  );
155  tphi.clear();
156  return Flux;
157 }
158 
159 
160 template<class Type>
162 flux
163 (
164  const surfaceScalarField& phi,
166 )
167 {
169  (
170  fvc::flux(phi, tvf())
171  );
172  tvf.clear();
173  return Flux;
174 }
175 
176 
177 template<class Type>
179 flux
180 (
181  const tmp<surfaceScalarField>& tphi,
183 )
184 {
186  (
187  fvc::flux(tphi(), tvf())
188  );
189  tphi.clear();
190  tvf.clear();
191  return Flux;
192 }
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace fvc
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace Foam
202 
203 // ************************************************************************* //
const word & name() const
Return name.
Definition: IOobject.H:303
void clear() const
If object pointer points to valid object:
Definition: tmpI.H:237
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
A class for handling words, derived from string.
Definition: word.H:59
Calculate the face-flux of the given field.
phi
Definition: correctPhi.H:3
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:53
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
Definition: fvcFlux.C:32
Namespace for OpenFOAM.