FreeFOAM The Cross-Platform CFD Toolkit
DsmcCloudI_.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
27 
28 template<class ParcelType>
30 {
31  return cloudName_;
32 }
33 
34 
35 template<class ParcelType>
37 {
38  return mesh_;
39 }
40 
41 
42 template<class ParcelType>
43 inline const Foam::IOdictionary&
45 {
46  return particleProperties_;
47 }
48 
49 
50 template<class ParcelType>
51 inline const Foam::List<Foam::word>&
53 {
54  return typeIdList_;
55 }
56 
57 
58 template<class ParcelType>
59 inline Foam::scalar Foam::DsmcCloud<ParcelType>::nParticle() const
60 {
61  return nParticle_;
62 }
63 
64 
65 template<class ParcelType>
68 {
69  return cellOccupancy_;
70 }
71 
72 
73 template<class ParcelType>
75 {
76  return sigmaTcRMax_;
77 }
78 
79 
80 template<class ParcelType>
81 inline Foam::scalarField&
83 {
84  return collisionSelectionRemainder_;
85 }
86 
87 
88 template<class ParcelType>
91 {
92  return constProps_;
93 }
94 
95 
96 template<class ParcelType>
97 inline const typename ParcelType::constantProperties&
99 (
100  label typeId
101 ) const
102 {
103  if (typeId < 0 || typeId >= constProps_.size())
104  {
105  FatalErrorIn("Foam::DsmcCloud<ParcelType>::constProps(label typeId)")
106  << "constantProperties for requested typeId index "
107  << typeId << " do not exist" << nl
108  << abort(FatalError);
109  }
110 
111  return constProps_[typeId];
112 }
113 
114 
115 template<class ParcelType>
117 {
118  return rndGen_;
119 }
120 
121 
122 template<class ParcelType>
123 inline Foam::volScalarField::GeometricBoundaryField&
125 {
126  return q_.boundaryField();
127 }
128 
129 
130 template<class ParcelType>
131 inline Foam::volVectorField::GeometricBoundaryField&
133 {
134  return fD_.boundaryField();
135 }
136 
137 
138 template<class ParcelType>
139 inline Foam::volScalarField::GeometricBoundaryField&
141 {
142  return rhoN_.boundaryField();
143 }
144 
145 
146 template<class ParcelType>
147 inline Foam::volScalarField::GeometricBoundaryField&
149 {
150  return rhoM_.boundaryField();
151 }
152 
153 
154 template<class ParcelType>
155 inline Foam::volScalarField::GeometricBoundaryField&
157 {
158  return linearKE_.boundaryField();
159 }
160 
161 
162 template<class ParcelType>
163 inline Foam::volScalarField::GeometricBoundaryField&
165 {
166  return internalE_.boundaryField();
167 }
168 
169 
170 template<class ParcelType>
171 inline Foam::volScalarField::GeometricBoundaryField&
173 {
174  return iDof_.boundaryField();
175 }
176 
177 
178 template<class ParcelType>
179 inline Foam::volVectorField::GeometricBoundaryField&
181 {
182  return momentum_.boundaryField();
183 }
184 
185 
186 template<class ParcelType>
187 inline const Foam::volScalarField&
189 {
190  return boundaryT_;
191 }
192 
193 
194 template<class ParcelType>
195 inline const Foam::volVectorField&
197 {
198  return boundaryU_;
199 }
200 
201 
202 template<class ParcelType>
205 {
206  return binaryCollisionModel_;
207 }
208 
209 
210 template<class ParcelType>
213 {
214  return binaryCollisionModel_();
215 }
216 
217 
218 template<class ParcelType>
221 {
222  return wallInteractionModel_;
223 }
224 
225 
226 template<class ParcelType>
229 {
230  return wallInteractionModel_();
231 }
232 
233 
234 template<class ParcelType>
237 {
238  return inflowBoundaryModel_;
239 }
240 
241 
242 template<class ParcelType>
245 {
246  return inflowBoundaryModel_();
247 }
248 
249 
250 template<class ParcelType>
251 inline Foam::scalar Foam::DsmcCloud<ParcelType>::massInSystem() const
252 {
253  scalar sysMass = 0.0;
254 
255  forAllConstIter(typename DsmcCloud<ParcelType>, *this, iter)
256  {
257  const ParcelType& p = iter();
258 
259  const typename ParcelType::constantProperties& cP = constProps
260  (
261  p.typeId()
262  );
263 
264  sysMass += cP.mass();
265  }
266 
267  return nParticle_*sysMass;
268 }
269 
270 
271 template<class ParcelType>
273 {
274  vector linearMomentum(vector::zero);
275 
276  forAllConstIter(typename DsmcCloud<ParcelType>, *this, iter)
277  {
278  const ParcelType& p = iter();
279 
280  const typename ParcelType::constantProperties& cP = constProps
281  (
282  p.typeId()
283  );
284 
285  linearMomentum += cP.mass()*p.U();
286  }
287 
288  return nParticle_*linearMomentum;
289 }
290 
291 
292 template<class ParcelType>
293 inline Foam::scalar
295 {
296  scalar linearKineticEnergy = 0.0;
297 
298  forAllConstIter(typename DsmcCloud<ParcelType>, *this, iter)
299  {
300  const ParcelType& p = iter();
301 
302  const typename ParcelType::constantProperties& cP = constProps
303  (
304  p.typeId()
305  );
306 
307  linearKineticEnergy += 0.5*cP.mass()*(p.U() & p.U());
308  }
309 
310  return nParticle_*linearKineticEnergy;
311 }
312 
313 
314 template<class ParcelType>
315 inline Foam::scalar
317 {
318  scalar internalEnergy = 0.0;
319 
320  forAllConstIter(typename DsmcCloud<ParcelType>, *this, iter)
321  {
322  const ParcelType& p = iter();
323 
324  internalEnergy += p.Ei();
325  }
326 
327  return nParticle_*internalEnergy;
328 }
329 
330 
331 template<class ParcelType>
333 (
334  scalar temperature,
335  scalar mass
336 ) const
337 {
338  return
339  2.0*sqrt(2.0*kb*temperature/(mathematicalConstant::pi*mass));
340 }
341 
342 
343 template<class ParcelType>
345 (
346  scalarField temperature,
347  scalar mass
348 ) const
349 {
350  return
351  2.0*sqrt(2.0*kb*temperature/(mathematicalConstant::pi*mass));
352 }
353 
354 
355 template<class ParcelType>
357 (
358  scalar temperature,
359  scalar mass
360 ) const
361 {
362  return sqrt(3.0*kb*temperature/mass);
363 }
364 
365 
366 template<class ParcelType>
368 (
369  scalarField temperature,
370  scalar mass
371 ) const
372 {
373  return sqrt(3.0*kb*temperature/mass);
374 }
375 
376 
377 template<class ParcelType>
378 inline Foam::scalar
380 (
381  scalar temperature,
382  scalar mass
383 ) const
384 {
385  return sqrt(2.0*kb*temperature/mass);
386 }
387 
388 
389 template<class ParcelType>
390 inline Foam::scalarField
392 (
393  scalarField temperature,
394  scalar mass
395 ) const
396 {
397  return sqrt(2.0*kb*temperature/mass);
398 }
399 
400 
401 template<class ParcelType>
403 {
404  return q_;
405 }
406 
407 
408 template<class ParcelType>
410 {
411  return fD_;
412 }
413 
414 
415 template<class ParcelType>
416 inline const Foam::volScalarField&
418 {
419  return rhoN_;
420 }
421 
422 
423 template<class ParcelType>
425 {
426  return rhoM_;
427 }
428 
429 
430 template<class ParcelType>
431 inline const Foam::volScalarField&
433 {
434  return dsmcRhoN_;
435 }
436 
437 
438 template<class ParcelType>
439 inline const Foam::volScalarField&
441 {
442  return linearKE_;
443 }
444 
445 
446 template<class ParcelType>
447 inline const Foam::volScalarField&
449 {
450  return internalE_;
451 }
452 
453 
454 template<class ParcelType>
455 inline const Foam::volScalarField&
457 {
458  return iDof_;
459 }
460 
461 
462 template<class ParcelType>
464 {
465  return momentum_;
466 }
467 
468 
469 template<class ParcelType>
471 {
473 }
474 
475 
476 // ************************ vim: set sw=4 sts=4 et: ************************ //