steadyStateFaDdtScheme.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) 2016-2017 Wikki Ltd
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 "steadyStateFaDdtScheme.H"
29 #include "facDiv.H"
30 #include "faMatrices.H"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 namespace fa
40 {
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 template<class Type>
45 tmp<GeometricField<Type, faPatchField, areaMesh>>
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 (
69  const dimensioned<Type> dt
70 )
71 {
73  (
74  IOobject
75  (
76  "ddt("+dt.name()+')',
77  mesh()().time().timeName(),
78  mesh()()
79  ),
80  mesh(),
82  );
83 }
84 
85 
86 template<class Type>
89 (
91 )
92 {
94  (
95  IOobject
96  (
97  "ddt("+vf.name()+')',
98  mesh()().time().timeName(),
99  mesh()()
100  ),
101  mesh(),
102  dimensioned<Type>(vf.dimensions()/dimTime, Zero)
103  );
104 }
105 
106 
107 template<class Type>
110 (
112 )
113 {
115  (
116  IOobject
117  (
118  "ddt0("+vf.name()+')',
119  mesh()().time().timeName(),
120  mesh()()
121  ),
122  mesh(),
123  dimensioned<Type>(vf.dimensions()/dimTime, Zero)
124  );
125 }
126 
127 
128 template<class Type>
131 (
132  const dimensionedScalar& rho,
134 )
135 {
137  (
138  IOobject
139  (
140  "ddt("+rho.name()+','+vf.name()+')',
141  mesh()().time().timeName(),
142  mesh()()
143  ),
144  mesh(),
145  dimensioned<Type>(rho.dimensions()*vf.dimensions()/dimTime, Zero)
146  );
147 }
148 
149 template<class Type>
152 (
153  const dimensionedScalar& rho,
155 )
156 {
158  (
159  IOobject
160  (
161  "ddt0("+rho.name()+','+vf.name()+')',
162  mesh()().time().timeName(),
163  mesh()()
164  ),
165  mesh(),
166  dimensioned<Type>(rho.dimensions()*vf.dimensions()/dimTime, Zero)
167  );
168 }
169 
170 
171 template<class Type>
174 (
175  const areaScalarField& rho,
177 )
178 {
180  (
181  IOobject
182  (
183  "ddt("+rho.name()+','+vf.name()+')',
184  mesh()().time().timeName(),
185  mesh()()
186  ),
187  mesh(),
188  dimensioned<Type>(rho.dimensions()*vf.dimensions()/dimTime, Zero)
189  );
190 }
191 
192 
193 template<class Type>
196 (
197  const areaScalarField& rho,
199 )
200 {
202  (
203  IOobject
204  (
205  "ddt0("+rho.name()+','+vf.name()+')',
206  mesh()().time().timeName(),
207  mesh()()
208  ),
209  mesh(),
210  dimensioned<Type>(rho.dimensions()*vf.dimensions()/dimTime, Zero)
211  );
212 }
213 
214 template<class Type>
217 (
219 )
220 {
221  tmp<faMatrix<Type>> tfam
222  (
223  new faMatrix<Type>
224  (
225  vf,
226  vf.dimensions()*dimArea/dimTime
227  )
228  );
229 
230  return tfam;
231 }
232 
233 
234 template<class Type>
237 (
238  const dimensionedScalar& rho,
240 )
241 {
242  tmp<faMatrix<Type>> tfam
243  (
244  new faMatrix<Type>
245  (
246  vf,
247  rho.dimensions()*vf.dimensions()*dimArea/dimTime
248  )
249  );
250 
251  return tfam;
252 }
253 
254 
255 template<class Type>
258 (
259  const areaScalarField& rho,
261 )
262 {
263  tmp<faMatrix<Type>> tfam
264  (
265  new faMatrix<Type>
266  (
267  vf,
268  rho.dimensions()*vf.dimensions()*dimArea/dimTime
269  )
270  );
271 
272  return tfam;
273 }
274 
275 
276 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
277 
278 } // End namespace fa
279 
280 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
281 
282 } // End namespace Foam
283 
284 // ************************************************************************* //
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::faMatrix
A special matrix type and solver, designed for finite area solutions of scalar equations....
Definition: faMatricesFwd.H:43
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::dimensioned::name
const word & name() const
Return const reference to name.
Definition: dimensionedType.C:406
faMatrices.H
facDiv.H
Calculate the divergence of the given field.
rho
rho
Definition: readInitialConditions.H:88
Foam::fa::steadyStateFaDdtScheme::famDdt
tmp< faMatrix< Type > > famDdt(const GeometricField< Type, faPatchField, areaMesh > &)
Definition: steadyStateFaDdtScheme.C:217
steadyStateFaDdtScheme.H
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:53
Foam::dimArea
const dimensionSet dimArea(sqr(dimLength))
Definition: dimensionSets.H:59
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
Foam::fa::steadyStateFaDdtScheme::facDdt0
tmp< GeometricField< Type, faPatchField, areaMesh > > facDdt0(const dimensioned< Type >)
Definition: steadyStateFaDdtScheme.C:68
Foam::fa::steadyStateFaDdtScheme::facDdt
tmp< GeometricField< Type, faPatchField, areaMesh > > facDdt(const dimensioned< Type >)
Definition: steadyStateFaDdtScheme.C:47
Foam::dimensioned::dimensions
const dimensionSet & dimensions() const
Return const reference to dimensions.
Definition: dimensionedType.C:420
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53