fvcDiv.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 "fvcDiv.H"
29#include "fvMesh.H"
30#include "fvcSurfaceIntegrate.H"
31#include "divScheme.H"
32#include "convectionScheme.H"
33
34// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35
36namespace Foam
37{
38
39// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40
41namespace fvc
42{
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46template<class Type>
47tmp<GeometricField<Type, fvPatchField, volMesh>>
49(
51)
52{
54 (
56 (
57 "div("+ssf.name()+')',
59 )
60 );
61}
62
63
64template<class Type>
67(
69)
70{
72 tssf.clear();
73 return Div;
74}
75
76
77template<class Type>
78tmp
79<
81 <
83 >
84>
86(
88 const word& name
89)
90{
92 (
93 vf.mesh(), vf.mesh().divScheme(name)
94 ).ref().fvcDiv(vf);
95}
96
97
98template<class Type>
99tmp
100<
102 <
104 >
105>
107(
109 const word& name
110)
111{
112 typedef typename innerProduct<vector, Type>::type DivType;
114 (
115 fvc::div(tvvf(), name)
116 );
117 tvvf.clear();
118 return Div;
119}
120
121template<class Type>
122tmp
123<
125 <
127 >
128>
130(
132)
133{
134 return fvc::div(vf, "div("+vf.name()+')');
135}
136
137
138template<class Type>
139tmp
140<
142 <
144 >
145>
147(
149)
150{
151 typedef typename innerProduct<vector, Type>::type DivType;
153 tvvf.clear();
154 return Div;
155}
156
157
158template<class Type>
161(
164 const word& name
165)
166{
168 (
169 vf.mesh(),
170 flux,
171 vf.mesh().divScheme(name)
172 ).ref().fvcDiv(flux, vf);
173}
174
175
176template<class Type>
179(
180 const tmp<surfaceScalarField>& tflux,
182 const word& name
183)
184{
186 (
187 fvc::div(tflux(), vf, name)
188 );
189 tflux.clear();
190 return Div;
191}
192
193
194template<class Type>
197(
200 const word& name
201)
202{
204 (
205 fvc::div(flux, tvf(), name)
206 );
207 tvf.clear();
208 return Div;
209}
210
211
212template<class Type>
215(
216 const tmp<surfaceScalarField>& tflux,
218 const word& name
219)
220{
222 (
223 fvc::div(tflux(), tvf(), name)
224 );
225 tflux.clear();
226 tvf.clear();
227 return Div;
228}
229
230
231template<class Type>
234(
237)
238{
239 return fvc::div
240 (
241 flux, vf, "div("+flux.name()+','+vf.name()+')'
242 );
243}
244
245
246template<class Type>
249(
250 const tmp<surfaceScalarField>& tflux,
252)
253{
255 (
256 fvc::div(tflux(), vf)
257 );
258 tflux.clear();
259 return Div;
260}
261
262
263template<class Type>
266(
269)
270{
272 (
273 fvc::div(flux, tvf())
274 );
275 tvf.clear();
276 return Div;
277}
278
279
280template<class Type>
283(
284 const tmp<surfaceScalarField>& tflux,
286)
287{
289 (
290 fvc::div(tflux(), tvf())
291 );
292 tflux.clear();
293 tvf.clear();
294 return Div;
295}
296
297
298// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
299
300} // End namespace fvc
301
302// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
303
304} // End namespace Foam
305
306// ************************************************************************* //
const Mesh & mesh() const
Return mesh.
Generic GeometricField class.
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
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:82
A class for managing temporary objects.
Definition: tmp.H:65
void clear() const noexcept
Definition: tmpI.H:287
Mesh data needed to do the Finite Volume discretisation.
Definition: volMesh.H:54
type
Volume classification types.
Definition: volumeType.H:66
A class for handling words, derived from Foam::string.
Definition: word.H:68
Calculate the divergence of the given field.
Surface integrate surfaceField creating a volField. Surface sum a surfaceField creating a volField.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:49
void surfaceIntegrate(Field< Type > &ivf, const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59