fvcDdt.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-2017 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 "fvcDdt.H"
29#include "fvMesh.H"
30#include "ddtScheme.H"
31
32// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33
34namespace Foam
35{
36
37// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38
39namespace fvc
40{
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44template<class Type>
45tmp<GeometricField<Type, fvPatchField, volMesh>>
47(
48 const dimensioned<Type> dt,
49 const fvMesh& mesh
50)
51{
53 (
54 mesh,
55 mesh.ddtScheme("ddt(" + dt.name() + ')')
56 ).ref().fvcDdt(dt);
57}
58
59
60template<class Type>
63(
65)
66{
68 (
69 vf.mesh(),
70 vf.mesh().ddtScheme("ddt(" + vf.name() + ')')
71 ).ref().fvcDdt(vf);
72}
73
74
75template<class Type>
78(
81)
82{
84 (
85 vf.mesh(),
86 vf.mesh().ddtScheme("ddt(" + rho.name() + ',' + vf.name() + ')')
87 ).ref().fvcDdt(rho, vf);
88}
89
90
91template<class Type>
94(
95 const volScalarField& rho,
97)
98{
100 (
101 vf.mesh(),
102 vf.mesh().ddtScheme("ddt(" + rho.name() + ',' + vf.name() + ')')
103 ).ref().fvcDdt(rho, vf);
104}
105
106
107template<class Type>
110(
111 const volScalarField& alpha,
112 const volScalarField& rho,
114)
115{
117 (
118 vf.mesh(),
119 vf.mesh().ddtScheme
120 (
121 "ddt("
122 + alpha.name() + ','
123 + rho.name() + ','
124 + vf.name() + ')'
125 )
126 ).ref().fvcDdt(alpha, rho, vf);
127}
128
129
130template<class Type>
133(
135)
136{
138 (
139 sf.mesh(),
140 sf.mesh().ddtScheme("ddt(" + sf.name() + ')')
141 ).ref().fvcDdt(sf);
142}
143
144
145template<class Type>
148(
149 const one&,
151)
152{
153 return ddt(vf);
154}
155
156
157template<class Type>
160(
162 const one&
163)
164{
165 return ddt(vf);
166}
167
168
169template<class Type>
172(
175)
176{
178 (
179 U.mesh(),
180 U.mesh().ddtScheme("ddt(" + U.name() + ')')
181 ).ref().fvcDdtUfCorr(U, Uf);
182}
183
184
185template<class Type>
188(
190 const GeometricField
191 <
192 typename flux<Type>::type,
195 >& phi
196)
197{
199 (
200 U.mesh(),
201 U.mesh().ddtScheme("ddt(" + U.name() + ')')
202 ).ref().fvcDdtPhiCorr(U, phi);
203}
204
205
206template<class Type>
209(
211 const GeometricField
212 <
213 typename flux<Type>::type,
216 >& phi,
218)
219{
220 if (U.mesh().dynamic())
221 {
222 return ddtCorr(U, Uf());
223 }
224 else
225 {
226 return ddtCorr(U, phi);
227 }
228}
229
230
231template<class Type>
234(
235 const volScalarField& rho,
238)
239{
241 (
242 U.mesh(),
243 U.mesh().ddtScheme("ddt(" + U.name() + ')')
244 ).ref().fvcDdtUfCorr(rho, U, Uf);
245}
246
247
248template<class Type>
251(
252 const volScalarField& rho,
254 const GeometricField
255 <
256 typename flux<Type>::type,
259 >& phi
260)
261{
263 (
264 U.mesh(),
265 U.mesh().ddtScheme("ddt(" + rho.name() + ',' + U.name() + ')')
266 ).ref().fvcDdtPhiCorr(rho, U, phi);
267}
268
269
270template<class Type>
273(
274 const volScalarField& rho,
276 const GeometricField
277 <
278 typename flux<Type>::type,
281 >& phi,
283)
284{
285 if (U.mesh().dynamic())
286 {
287 return ddtCorr(rho, U, Uf());
288 }
289 else
290 {
291 return ddtCorr(rho, U, phi);
292 }
293}
294
295
296// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
297
298} // End namespace fvc
299
300// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
301
302} // End namespace Foam
303
304// ************************************************************************* //
surfaceScalarField & phi
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
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Generic dimensioned Type class.
const word & name() const
Return const reference to name.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Definition: fvsPatchField.H:79
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Definition: one.H:62
Mesh data needed to do the Finite Volume discretisation.
Definition: surfaceMesh.H:52
A class for managing temporary objects.
Definition: tmp.H:65
type
Volume classification types.
Definition: volumeType.H:66
U
Definition: pEqn.H:72
ddtCorr
Definition: readControls.H:9
dynamicFvMesh & mesh
autoPtr< surfaceVectorField > Uf
Calculate the first temporal derivative.
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:47
Namespace for OpenFOAM.
volScalarField & alpha