OpenFOAM: API Guide
v2112
The open source CFD toolbox
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
,
49
const
GeometricField<Type, fvPatchField, volMesh>
& vf,
50
const
word
&
name
51
)
52
{
53
return
fv::convectionScheme<Type>::New
54
(
55
vf.mesh(),
56
phi
,
57
vf.mesh().divScheme(
name
)
58
)().flux(
phi
, vf);
59
}
60
61
62
template
<
class
Type>
63
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
>
64
flux
65
(
66
const
tmp<surfaceScalarField>
& tphi,
67
const
GeometricField<Type, fvPatchField, volMesh>
& vf,
68
const
word
&
name
69
)
70
{
71
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
> Flux
72
(
73
fvc::flux
(tphi(), vf,
name
)
74
);
75
tphi.
clear
();
76
return
Flux;
77
}
78
79
80
template
<
class
Type>
81
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
>
82
flux
83
(
84
const
surfaceScalarField
&
phi
,
85
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf,
86
const
word
&
name
87
)
88
{
89
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
> Flux
90
(
91
fvc::flux
(
phi
, tvf(),
name
)
92
);
93
tvf.clear();
94
return
Flux;
95
}
96
97
98
template
<
class
Type>
99
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
>
100
flux
101
(
102
const
tmp<surfaceScalarField>
& tphi,
103
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf,
104
const
word
&
name
105
)
106
{
107
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
> Flux
108
(
109
fvc::flux
(tphi(), tvf(),
name
)
110
);
111
tphi.
clear
();
112
tvf.clear();
113
return
Flux;
114
}
115
116
117
template
<
class
Type>
118
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
>
119
flux
120
(
121
const
surfaceScalarField
&
phi
,
122
const
GeometricField<Type, fvPatchField, volMesh>
& vf
123
)
124
{
125
return
fvc::flux
126
(
127
phi
, vf,
"flux("
+
phi
.name()+
','
+vf.name()+
')'
128
);
129
}
130
131
132
template
<
class
Type>
133
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
>
134
flux
135
(
136
const
tmp<surfaceScalarField>
& tphi,
137
const
GeometricField<Type, fvPatchField, volMesh>
& vf
138
)
139
{
140
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
> Flux
141
(
142
fvc::flux
(tphi(), vf)
143
);
144
tphi.
clear
();
145
return
Flux;
146
}
147
148
149
template
<
class
Type>
150
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
>
151
flux
152
(
153
const
surfaceScalarField
&
phi
,
154
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf
155
)
156
{
157
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
> Flux
158
(
159
fvc::flux
(
phi
, tvf())
160
);
161
tvf.clear();
162
return
Flux;
163
}
164
165
166
template
<
class
Type>
167
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
>
168
flux
169
(
170
const
tmp<surfaceScalarField>
& tphi,
171
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf
172
)
173
{
174
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
> Flux
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 >
src
finiteVolume
finiteVolume
fvc
fvcFluxTemplates.C
Generated by
1.8.17
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.