steadyStateDdtScheme.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 "steadyStateDdtScheme.H"
29 #include "fvcDiv.H"
30 #include "fvMatrices.H"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 namespace fv
40 {
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 template<class Type>
45 tmp<GeometricField<Type, fvPatchField, volMesh>>
47 (
48  const dimensioned<Type>& dt
49 )
50 {
52  (
53  IOobject
54  (
55  "ddt("+dt.name()+')',
56  mesh().time().timeName(),
57  mesh()
58  ),
59  mesh(),
61  );
62 }
63 
64 
65 template<class Type>
68 (
70 )
71 {
73  (
74  IOobject
75  (
76  "ddt("+vf.name()+')',
77  mesh().time().timeName(),
78  mesh()
79  ),
80  mesh(),
81  dimensioned<Type>(vf.dimensions()/dimTime, Zero)
82  );
83 }
84 
85 
86 template<class Type>
89 (
90  const dimensionedScalar& rho,
92 )
93 {
95  (
96  IOobject
97  (
98  "ddt("+rho.name()+','+vf.name()+')',
99  mesh().time().timeName(),
100  mesh()
101  ),
102  mesh(),
103  dimensioned<Type>(rho.dimensions()*vf.dimensions()/dimTime, Zero)
104  );
105 }
106 
107 
108 template<class Type>
111 (
112  const volScalarField& rho,
114 )
115 {
117  (
118  IOobject
119  (
120  "ddt("+rho.name()+','+vf.name()+')',
121  mesh().time().timeName(),
122  mesh()
123  ),
124  mesh(),
125  dimensioned<Type>(rho.dimensions()*vf.dimensions()/dimTime, Zero)
126  );
127 }
128 
129 
130 template<class Type>
133 (
134  const volScalarField& alpha,
135  const volScalarField& rho,
137 )
138 {
140  (
141  IOobject
142  (
143  "ddt("+alpha.name()+','+rho.name()+','+vf.name()+')',
144  mesh().time().timeName(),
145  mesh()
146  ),
147  mesh(),
148  dimensioned<Type>(rho.dimensions()*vf.dimensions()/dimTime, Zero)
149  );
150 }
151 
152 
153 template<class Type>
156 (
158 )
159 {
160  tmp<fvMatrix<Type>> tfvm
161  (
162  new fvMatrix<Type>
163  (
164  vf,
165  vf.dimensions()*dimVol/dimTime
166  )
167  );
168 
169  return tfvm;
170 }
171 
172 
173 template<class Type>
176 (
177  const dimensionedScalar& rho,
179 )
180 {
181  tmp<fvMatrix<Type>> tfvm
182  (
183  new fvMatrix<Type>
184  (
185  vf,
186  rho.dimensions()*vf.dimensions()*dimVol/dimTime
187  )
188  );
189 
190  return tfvm;
191 }
192 
193 
194 template<class Type>
197 (
198  const volScalarField& rho,
200 )
201 {
202  tmp<fvMatrix<Type>> tfvm
203  (
204  new fvMatrix<Type>
205  (
206  vf,
207  rho.dimensions()*vf.dimensions()*dimVol/dimTime
208  )
209  );
210 
211  return tfvm;
212 }
213 
214 
215 template<class Type>
218 (
219  const volScalarField& alpha,
220  const volScalarField& rho,
222 )
223 {
224  tmp<fvMatrix<Type>> tfvm
225  (
226  new fvMatrix<Type>
227  (
228  vf,
229  alpha.dimensions()*rho.dimensions()*vf.dimensions()*dimVol/dimTime
230  )
231  );
232 
233  return tfvm;
234 }
235 
236 
237 template<class Type>
240 (
243 )
244 {
245  tmp<fluxFieldType> tCorr
246  (
247  new fluxFieldType
248  (
249  IOobject
250  (
251  "ddtCorr(" + U.name() + ',' + Uf.name() + ')',
252  mesh().time().timeName(),
253  mesh()
254  ),
255  mesh(),
257  (
258  Uf.dimensions()*dimArea/dimTime, Zero
259  )
260  )
261  );
262 
263  tCorr.ref().setOriented();
264 
265  return tCorr;
266 }
267 
268 
269 template<class Type>
272 (
274  const fluxFieldType& phi
275 )
276 {
277  tmp<fluxFieldType> tCorr
278  (
279  new fluxFieldType
280  (
281  IOobject
282  (
283  "ddtCorr(" + U.name() + ',' + phi.name() + ')',
284  mesh().time().timeName(),
285  mesh()
286  ),
287  mesh(),
289  (
290  phi.dimensions()/dimTime, Zero
291  )
292  )
293  );
294 
295  tCorr.ref().setOriented();
296 
297  return tCorr;
298 }
299 
300 
301 template<class Type>
304 (
305  const volScalarField& rho,
308 )
309 {
310  tmp<fluxFieldType> tCorr
311  (
312  new fluxFieldType
313  (
314  IOobject
315  (
316  "ddtCorr("
317  + rho.name()
318  + ',' + U.name() + ',' + Uf.name() + ')',
319  mesh().time().timeName(),
320  mesh()
321  ),
322  mesh(),
324  (
325  Uf.dimensions()*dimArea/dimTime, Zero
326  )
327  )
328  );
329 
330  tCorr.ref().setOriented();
331 
332  return tCorr;
333 }
334 
335 
336 template<class Type>
339 (
340  const volScalarField& rho,
342  const fluxFieldType& phi
343 )
344 {
345  tmp<fluxFieldType> tCorr
346  (
347  new fluxFieldType
348  (
349  IOobject
350  (
351  "ddtCorr("
352  + rho.name()
353  + ',' + U.name() + ',' + phi.name() + ')',
354  mesh().time().timeName(),
355  mesh()
356  ),
357  mesh(),
359  (
360  phi.dimensions()/dimTime, Zero
361  )
362  )
363  );
364 
365  tCorr.ref().setOriented();
366 
367  return tCorr;
368 }
369 
370 
371 template<class Type>
373 (
375 )
376 {
378  (
379  IOobject
380  (
381  "meshPhi",
382  mesh().time().timeName(),
383  mesh(),
386  false
387  ),
388  mesh(),
390  );
391 }
392 
393 
394 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
395 
396 } // End namespace fv
397 
398 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
399 
400 } // End namespace Foam
401 
402 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
Foam::fv::steadyStateDdtScheme::fvcDdtPhiCorr
tmp< fluxFieldType > fvcDdtPhiCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const fluxFieldType &phi)
Definition: steadyStateDdtScheme.C:272
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
steadyStateDdtScheme.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Uf
autoPtr< surfaceVectorField > Uf
Definition: createUfIfPresent.H:33
fvcDiv.H
Calculate the divergence of the given field.
Foam::dimensioned::name
const word & name() const
Return const reference to name.
Definition: dimensionedType.C:406
Foam::fv::steadyStateDdtScheme::fvcDdt
tmp< GeometricField< Type, fvPatchField, volMesh > > fvcDdt(const dimensioned< Type > &)
Definition: steadyStateDdtScheme.C:47
rho
rho
Definition: readInitialConditions.H:88
fvMatrices.H
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:53
Foam::tmp::ref
T & ref() const
Definition: tmpI.H:227
Foam::dimArea
const dimensionSet dimArea(sqr(dimLength))
Definition: dimensionSets.H:59
Foam::fv::steadyStateDdtScheme::fvcDdtUfCorr
tmp< fluxFieldType > fvcDdtUfCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
Definition: steadyStateDdtScheme.C:240
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
timeName
word timeName
Definition: getTimeIndex.H:3
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:42
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
fv
labelList fv(nPoints)
U
U
Definition: pEqn.H:72
Foam::tmp::New
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:68
Foam::dimVol
const dimensionSet dimVol(dimVolume)
Older spelling for dimVolume.
Definition: dimensionSets.H:64
Foam::dimensioned::dimensions
const dimensionSet & dimensions() const
Return const reference to dimensions.
Definition: dimensionedType.C:420
Foam::dimVolume
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:60
Foam::GeometricField< Type, fvPatchField, volMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:188
Foam::fv::steadyStateDdtScheme::fvmDdt
tmp< fvMatrix< Type > > fvmDdt(const GeometricField< Type, fvPatchField, volMesh > &)
Definition: steadyStateDdtScheme.C:156
Foam::fv::steadyStateDdtScheme::meshPhi
tmp< surfaceScalarField > meshPhi(const GeometricField< Type, fvPatchField, volMesh > &)
Definition: steadyStateDdtScheme.C:373