DSMCParcelI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 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 "DSMCParcel.H"
27 #include "mathematicalConstants.H"
28 
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
31 template<class ParcelType>
33 :
34  mass_(0),
35  d_(0)
36 {}
37 
38 
39 template<class ParcelType>
41 (
42  const dictionary& dict
43 )
44 :
45  mass_(dict.template lookup<scalar>("mass")),
46  d_(dict.template lookup<scalar>("diameter")),
47  internalDegreesOfFreedom_
48  (
49  dict.template lookup<int>("internalDegreesOfFreedom")
50  ),
51  omega_(dict.template lookup<scalar>("omega"))
52 {}
53 
54 
55 template<class ParcelType>
57 (
58  const polyMesh& mesh,
59  const vector& position,
60  const label celli,
61  const vector& U,
62  const scalar Ei,
63  const label typeId
64 )
65 :
66  ParcelType(mesh, position, celli),
67  U_(U),
68  Ei_(Ei),
70 {}
71 
72 
73 // * * * * * * * * * constantProperties Member Functions * * * * * * * * * * //
74 
75 template<class ParcelType>
76 inline Foam::scalar
78 {
79  return mass_;
80 }
81 
82 
83 template<class ParcelType>
85 {
86  return d_;
87 }
88 
89 
90 template<class ParcelType>
91 inline Foam::scalar
93 {
94  return constant::mathematical::pi*d_*d_;
95 }
96 
97 
98 template<class ParcelType>
99 inline Foam::direction
101 const
102 {
103  return internalDegreesOfFreedom_;
104 }
105 
106 
107 template<class ParcelType>
108 inline Foam::scalar
110 {
111  return omega_;
112 }
113 
114 
115 // * * * * * * * * * * DSMCParcel Member Functions * * * * * * * * * * //
116 
117 template<class ParcelType>
119 {
120  return typeId_;
121 }
122 
123 
124 template<class ParcelType>
126 {
127  return U_;
128 }
129 
130 
131 template<class ParcelType>
132 inline Foam::scalar Foam::DSMCParcel<ParcelType>::Ei() const
133 {
134  return Ei_;
135 }
136 
137 
138 template<class ParcelType>
140 {
141  return U_;
142 }
143 
144 
145 template<class ParcelType>
146 inline Foam::scalar& Foam::DSMCParcel<ParcelType>::Ei()
147 {
148  return Ei_;
149 }
150 
151 
152 // ************************************************************************* //
scalar d() const
Return const access to the hard sphere diameter [m].
Definition: DSMCParcelI.H:84
constantProperties()
Null constructor, allows List of constantProperties to be.
Definition: DSMCParcelI.H:32
scalar omega() const
Return the viscosity index.
Definition: DSMCParcelI.H:109
scalar mass() const
Return const access to the particle mass [kg].
Definition: DSMCParcelI.H:77
scalar sigmaT() const
Return the reference total collision cross section.
Definition: DSMCParcelI.H:92
direction internalDegreesOfFreedom() const
Return the internalDegreesOfFreedom.
Definition: DSMCParcelI.H:100
label typeId_
Parcel type id.
Definition: DSMCParcel.H:147
label typeId() const
Return type id.
Definition: DSMCParcelI.H:118
const vector & U() const
Return const access to velocity.
Definition: DSMCParcelI.H:125
scalar Ei() const
Return const access to internal energy.
Definition: DSMCParcelI.H:132
DSMCParcel(const polyMesh &mesh, const vector &position, const label celli, const vector &U, const scalar Ei, const label typeId)
Construct from a position and a cell, searching for the rest of the.
Definition: DSMCParcelI.H:57
vector U_
Velocity of Parcel [m/s].
Definition: DSMCParcel.H:140
scalar Ei_
Internal energy of the Parcel, covering all non-translational.
Definition: DSMCParcel.H:144
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
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
uint8_t direction
Definition: direction.H:45
dictionary dict