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-2023 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  label& nLocateBoundaryHits,
62  const vector& U,
63  const scalar Ei,
64  const label typeId
65 )
66 :
67  ParcelType(mesh, position, celli, nLocateBoundaryHits),
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 // ************************************************************************* //
scalar d() const
Return const access to the hard sphere diameter [m].
Definition: DSMCParcelI.H:85
constantProperties()
Null constructor, allows List of constantProperties to be.
Definition: DSMCParcelI.H:32
scalar omega() const
Return the viscosity index.
Definition: DSMCParcelI.H:110
scalar mass() const
Return const access to the particle mass [kg].
Definition: DSMCParcelI.H:78
scalar sigmaT() const
Return the reference total collision cross section.
Definition: DSMCParcelI.H:93
direction internalDegreesOfFreedom() const
Return the internalDegreesOfFreedom.
Definition: DSMCParcelI.H:101
label typeId_
Parcel type id.
Definition: DSMCParcel.H:147
label typeId() const
Return type id.
Definition: DSMCParcelI.H:119
const vector & U() const
Return const access to velocity.
Definition: DSMCParcelI.H:126
scalar Ei() const
Return const access to internal energy.
Definition: DSMCParcelI.H:133
vector U_
Velocity of Parcel [m/s].
Definition: DSMCParcel.H:140
DSMCParcel(const polyMesh &mesh, const vector &position, const label celli, label &nLocateBoundaryHits, 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
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:162
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