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 -------------------------------------------------------------------------------
10 License
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 
34 namespace Foam
35 {
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 namespace fvc
40 {
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 template<class Type>
45 tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
46 flux
47 (
48  const surfaceScalarField& phi,
50  const word& name
51 )
52 {
54  (
55  vf.mesh(),
56  phi,
57  vf.mesh().divScheme(name)
58  )().flux(phi, vf);
59 }
60 
61 
62 template<class Type>
64 flux
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 
80 template<class Type>
82 flux
83 (
84  const surfaceScalarField& phi,
86  const word& name
87 )
88 {
90  (
91  fvc::flux(phi, tvf(), name)
92  );
93  tvf.clear();
94  return Flux;
95 }
96 
97 
98 template<class Type>
100 flux
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 
117 template<class Type>
119 flux
120 (
121  const surfaceScalarField& phi,
123 )
124 {
125  return fvc::flux
126  (
127  phi, vf, "flux("+phi.name()+','+vf.name()+')'
128  );
129 }
130 
131 
132 template<class Type>
134 flux
135 (
136  const tmp<surfaceScalarField>& tphi,
138 )
139 {
141  (
142  fvc::flux(tphi(), vf)
143  );
144  tphi.clear();
145  return Flux;
146 }
147 
148 
149 template<class Type>
151 flux
152 (
153  const surfaceScalarField& phi,
155 )
156 {
158  (
159  fvc::flux(phi, tvf())
160  );
161  tvf.clear();
162  return Flux;
163 }
164 
165 
166 template<class Type>
168 flux
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 // ************************************************************************* //
convectionScheme.H
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp::clear
void clear() const noexcept
Definition: tmpI.H:287
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fv::convectionScheme::New
static tmp< convectionScheme< Type > > New(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &schemeData)
Return a pointer to a new convectionScheme created on freestore.
Definition: convectionScheme.C:61
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fvcFlux.H
Calculate the face-flux of the given field.
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >