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>
47 (
48  const dimensioned<Type> dt
49 )
50 {
52  (
53  IOobject
54  (
55  "ddt("+dt.name()+')',
56  mesh().time().timeName(),
57  mesh().thisDb()
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().thisDb()
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().thisDb()
100  ),
101  mesh(),
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().thisDb()
121  ),
122  mesh(),
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().thisDb()
143  ),
144  mesh(),
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().thisDb()
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().thisDb()
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().thisDb()
208  ),
209  mesh(),
211  );
212 }
213 
214 template<class Type>
217 (
219 )
220 {
221  tmp<faMatrix<Type>> tfam
222  (
223  new faMatrix<Type>
224  (
225  vf,
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 // ************************************************************************* //
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:195
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Generic GeometricField class.
Definition: areaFieldsFwd.H:50
Generic dimensioned Type class.
dynamicFvMesh & mesh
const dimensionSet & dimensions() const noexcept
Return const reference to dimensions.
tmp< GeometricField< Type, faPatchField, areaMesh > > facDdt0(const dimensioned< Type >)
Calculate the divergence of the given field.
const word & name() const noexcept
Return const reference to name.
tmp< GeometricField< Type, faPatchField, areaMesh > > facDdt(const dimensioned< Type >)
A special matrix type and solver, designed for finite area solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: faMatricesFwd.H:37
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
tmp< faMatrix< Type > > famDdt(const GeometricField< Type, faPatchField, areaMesh > &)
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
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:127