DSMCParcelI.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) 2011-2015 OpenFOAM Foundation
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 #include "mathematicalConstants.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class ParcelType>
32 :
33  mass_(0),
34  d_(0)
35 {}
36 
37 
38 template<class ParcelType>
40 (
41  const dictionary& dict
42 )
43 :
44  mass_(readScalar(dict.lookup("mass"))),
45  d_(readScalar(dict.lookup("diameter"))),
46  internalDegreesOfFreedom_
47  (
48  readInt(dict.lookup("internalDegreesOfFreedom"))
49  ),
50  omega_(readScalar(dict.lookup("omega")))
51 {}
52 
53 
54 template<class ParcelType>
56 (
57  const polyMesh& mesh,
58  const vector& position,
59  const vector& U,
60  const scalar Ei,
61  const label cellI,
62  const label tetFaceI,
63  const label tetPtI,
64  const label typeId
65 )
66 :
67  ParcelType(mesh, position, cellI, tetFaceI, tetPtI),
68  U_(U),
69  Ei_(Ei),
71 {}
72 
73 
74 // * * * * * * * * * constantProperties Member Functions * * * * * * * * * * //
75 
76 template<class ParcelType>
77 inline Foam::scalar
79 {
80  return mass_;
81 }
82 
83 
84 template<class ParcelType>
86 {
87  return d_;
88 }
89 
90 
91 template<class ParcelType>
92 inline Foam::scalar
94 {
95  return constant::mathematical::pi*d_*d_;
96 }
97 
98 
99 template<class ParcelType>
100 inline Foam::direction
102 const
103 {
104  return internalDegreesOfFreedom_;
105 }
106 
107 
108 template<class ParcelType>
109 inline Foam::scalar
111 {
112  return omega_;
113 }
114 
115 
116 // * * * * * * * * * * DSMCParcel Member Functions * * * * * * * * * * //
117 
118 template<class ParcelType>
120 {
121  return typeId_;
122 }
123 
124 
125 template<class ParcelType>
127 {
128  return U_;
129 }
130 
131 
132 template<class ParcelType>
133 inline Foam::scalar Foam::DSMCParcel<ParcelType>::Ei() const
134 {
135  return Ei_;
136 }
137 
138 
139 template<class ParcelType>
141 {
142  return U_;
143 }
144 
145 
146 template<class ParcelType>
147 inline Foam::scalar& Foam::DSMCParcel<ParcelType>::Ei()
148 {
149  return Ei_;
150 }
151 
152 
153 // ************************************************************************* //
Foam::DSMCParcel::U
const vector & U() const
Return const access to velocity.
Definition: DSMCParcelI.H:126
mathematicalConstants.H
Foam::DSMCParcel::typeId
label typeId() const
Return type id.
Definition: DSMCParcelI.H:119
Foam::DSMCParcel::constantProperties::constantProperties
constantProperties()
Null constructor, allows List of constantProperties to be.
Definition: DSMCParcelI.H:31
Foam::DSMCParcel::typeId_
label typeId_
Parcel type id.
Definition: DSMCParcel.H:163
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::DSMCParcel::DSMCParcel
DSMCParcel(const polyMesh &mesh, const vector &position, const vector &U, const scalar Ei, const label cellI, const label tetFaceI, const label tetPtI, const label typeId)
Construct from components.
Definition: DSMCParcelI.H:56
Foam::readInt
int readInt(Istream &)
Definition: intIO.C:31
Foam::DSMCParcel::constantProperties::sigmaT
scalar sigmaT() const
Return the reference total collision cross section.
Definition: DSMCParcelI.H:93
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::DSMCParcel::constantProperties::internalDegreesOfFreedom
direction internalDegreesOfFreedom() const
Return the internalDegreesOfFreedom.
Definition: DSMCParcelI.H:101
Foam::DSMCParcel::constantProperties::omega
scalar omega() const
Return the viscosity index.
Definition: DSMCParcelI.H:110
Foam::DSMCParcel::U_
vector U_
Velocity of Parcel [m/s].
Definition: DSMCParcel.H:156
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::DSMCParcel::Ei_
scalar Ei_
Internal energy of the Parcel, covering all non-translational.
Definition: DSMCParcel.H:160
Foam::DSMCParcel::constantProperties::mass
scalar mass() const
Return const access to the particle mass [kg].
Definition: DSMCParcelI.H:78
Foam::readScalar
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
Definition: doubleScalar.H:63
Foam::Vector< scalar >
Foam::direction
unsigned char direction
Definition: direction.H:43
Foam::DSMCParcel::constantProperties::d
scalar d() const
Return const access to the hard sphere diameter [m].
Definition: DSMCParcelI.H:85
Foam::constant::mathematical::pi
const scalar pi(M_PI)
Foam::DSMCParcel::Ei
scalar Ei() const
Return const access to internal energy.
Definition: DSMCParcelI.H:133