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>
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(),
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,
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();
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 // ************************************************************************* //
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:150
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
Definition: tmpI.H:210
tmp< GeometricField< Type, fvPatchField, volMesh > > fvcDdt(const dimensioned< Type > &)
const dimensionSet dimVol(dimVolume)
Older spelling for dimVolume.
Definition: dimensionSets.H:65
Generic GeometricField class.
Definition: areaFieldsFwd.H:50
Generic dimensioned Type class.
Ignore writing from objectRegistry::writeObject()
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
tmp< fluxFieldType > fvcDdtPhiCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const fluxFieldType &phi)
word timeName
Definition: getTimeIndex.H:3
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
dynamicFvMesh & mesh
labelList fv(nPoints)
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Definition: tmp.H:203
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:64
autoPtr< surfaceVectorField > Uf
const dimensionSet & dimensions() const noexcept
Return const reference to dimensions.
Calculate the divergence of the given field.
tmp< fluxFieldType > fvcDdtUfCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
const word & name() const noexcept
Return const reference to name.
tmp< surfaceScalarField > meshPhi(const GeometricField< Type, fvPatchField, volMesh > &)
U
Definition: pEqn.H:72
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Nothing to be read.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
A special matrix type and solver, designed for finite volume solutions of scalar equations.
tmp< fvMatrix< Type > > fvmDdt(const GeometricField< Type, fvPatchField, volMesh > &)
A class for managing temporary objects.
Definition: HashPtrTable.H:50
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:166
const dimensionSet dimArea(sqr(dimLength))
Definition: dimensionSets.H:57
Namespace for OpenFOAM.
const dimensionSet & dimensions() const noexcept
Return dimensions.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:157