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  "ddt("+dt.name()+')',
55  mesh(),
56  Foam::zero{},
57  dt.dimensions()/dimTime
58  );
59 }
60 
61 
62 template<class Type>
65 (
66  const dimensioned<Type> dt
67 )
68 {
70  (
71  "ddt("+dt.name()+')',
73  mesh(),
74  Foam::zero{},
75  dt.dimensions()/dimTime
76  );
77 }
78 
79 
80 template<class Type>
83 (
85 )
86 {
88  (
89  "ddt("+vf.name()+')',
91  mesh(),
92  Foam::zero{},
93  vf.dimensions()/dimTime
94  );
95 }
96 
97 
98 template<class Type>
101 (
103 )
104 {
106  (
107  "ddt0("+vf.name()+')',
109  mesh(),
110  Foam::zero{},
111  vf.dimensions()/dimTime
112  );
113 }
114 
115 
116 template<class Type>
119 (
120  const dimensionedScalar& rho,
122 )
123 {
125  (
126  "ddt("+rho.name()+','+vf.name()+')',
128  mesh(),
129  Foam::zero{},
130  rho.dimensions()*vf.dimensions()/dimTime
131  );
132 }
133 
134 template<class Type>
137 (
138  const dimensionedScalar& rho,
140 )
141 {
143  (
144  "ddt0("+rho.name()+','+vf.name()+')',
146  mesh(),
147  Foam::zero{},
148  rho.dimensions()*vf.dimensions()/dimTime
149  );
150 }
151 
152 
153 template<class Type>
156 (
157  const areaScalarField& rho,
159 )
160 {
162  (
163  "ddt("+rho.name()+','+vf.name()+')',
165  mesh(),
166  Foam::zero{},
167  rho.dimensions()*vf.dimensions()/dimTime
168  );
169 }
170 
171 
172 template<class Type>
175 (
176  const areaScalarField& rho,
178 )
179 {
181  (
182  "ddt0("+rho.name()+','+vf.name()+')',
184  mesh(),
185  Foam::zero{},
186  rho.dimensions()*vf.dimensions()/dimTime
187  );
188 }
189 
190 template<class Type>
193 (
195 )
196 {
197  tmp<faMatrix<Type>> tfam
198  (
199  new faMatrix<Type>
200  (
201  vf,
203  )
204  );
205 
206  return tfam;
207 }
208 
209 
210 template<class Type>
213 (
214  const dimensionedScalar& rho,
216 )
217 {
218  tmp<faMatrix<Type>> tfam
219  (
220  new faMatrix<Type>
221  (
222  vf,
223  rho.dimensions()*vf.dimensions()*dimArea/dimTime
224  )
225  );
226 
227  return tfam;
228 }
229 
230 
231 template<class Type>
234 (
235  const areaScalarField& rho,
237 )
238 {
239  tmp<faMatrix<Type>> tfam
240  (
241  new faMatrix<Type>
242  (
243  vf,
244  rho.dimensions()*vf.dimensions()*dimArea/dimTime
245  )
246  );
247 
248  return tfam;
249 }
250 
251 
252 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
253 
254 } // End namespace fa
255 
256 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
257 
258 } // End namespace Foam
259 
260 // ************************************************************************* //
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:195
Generic GeometricField class.
Generic dimensioned Type class.
dynamicFvMesh & mesh
const dimensionSet & dimensions() const noexcept
Return const reference to dimensions.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
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 representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:57
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Request registration (bool: true)
const dimensionSet dimArea(sqr(dimLength))
Definition: dimensionSets.H:57
Namespace for OpenFOAM.
const dimensionSet & dimensions() const noexcept
Return dimensions.