ThermoParcelI.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 "ThermoParcel.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class ParcelType>
32 :
33  ParcelType::constantProperties(),
34  T0_(this->dict_, 0.0),
35  TMin_(this->dict_, 0.0),
36  TMax_(this->dict_, vGreat),
37  Cp0_(this->dict_, 0.0),
38  epsilon0_(this->dict_, 0.0),
39  f0_(this->dict_, 0.0)
40 {}
41 
42 
43 template<class ParcelType>
45 (
46  const constantProperties& cp
47 )
48 :
49  ParcelType::constantProperties(cp),
50  T0_(cp.T0_),
51  TMin_(cp.TMin_),
52  TMax_(cp.TMax_),
53  Cp0_(cp.Cp0_),
54  epsilon0_(cp.epsilon0_),
55  f0_(cp.f0_)
56 {}
57 
58 
59 template<class ParcelType>
61 (
62  const dictionary& parentDict
63 )
64 :
65  ParcelType::constantProperties(parentDict),
66  T0_(this->dict_, "T0"),
67  TMin_(this->dict_, "TMin", 200.0),
68  TMax_(this->dict_, "TMax", 5000.0),
69  Cp0_(this->dict_, "Cp0"),
70  epsilon0_(this->dict_, "epsilon0"),
71  f0_(this->dict_, "f0")
72 {}
73 
74 
75 template<class ParcelType>
77 (
78  const polyMesh& mesh,
79  const barycentric& coordinates,
80  const label celli,
81  const label tetFacei,
82  const label tetPti,
83  const label facei
84 )
85 :
86  ParcelType(mesh, coordinates, celli, tetFacei, tetPti, facei),
87  T_(0.0),
88  Cp_(0.0)
89 {}
90 
91 
92 template<class ParcelType>
94 (
95  const polyMesh& mesh,
96  const vector& position,
97  const label celli
98 )
99 :
100  ParcelType(mesh, position, celli),
101  T_(0.0),
102  Cp_(0.0)
103 {}
104 
105 
106 // * * * * * * * * * constantProperties Member Functions * * * * * * * * * * //
107 
108 template<class ParcelType>
109 inline Foam::scalar
111 {
112  return T0_.value();
113 }
114 
115 
116 template<class ParcelType>
117 inline Foam::scalar
119 {
120  return TMin_.value();
121 }
122 
123 
124 template<class ParcelType>
125 inline Foam::scalar
127 {
128  return TMax_.value();
129 }
130 
131 
132 template<class ParcelType>
133 inline void
135 {
136  TMax_.setValue(TMax);
137 }
138 
139 
140 template<class ParcelType>
141 inline Foam::scalar
143 {
144  return Cp0_.value();
145 }
146 
147 
148 template<class ParcelType>
149 inline Foam::scalar
151 {
152  return epsilon0_.value();
153 }
154 
155 
156 template<class ParcelType>
157 inline Foam::scalar
159 {
160  return f0_.value();
161 }
162 
163 
164 // * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * //
165 
166 template<class ParcelType>
167 inline Foam::scalar Foam::ThermoParcel<ParcelType>::T() const
168 {
169  return T_;
170 }
171 
172 
173 template<class ParcelType>
174 inline Foam::scalar Foam::ThermoParcel<ParcelType>::Cp() const
175 {
176  return Cp_;
177 }
178 
179 
180 template<class ParcelType>
181 inline Foam::scalar& Foam::ThermoParcel<ParcelType>::T()
182 {
183  return T_;
184 }
185 
186 
187 template<class ParcelType>
189 {
190  return Cp_;
191 }
192 
193 
194 // ************************************************************************* //
Class to hold thermo particle constant properties.
Definition: ThermoParcel.H:90
void setTMax(const scalar TMax)
Set the maximum temperature [K].
scalar f0() const
Return const access to the particle scattering factor [].
scalar TMin() const
Return const access to minimum temperature [K].
scalar epsilon0() const
Return const access to the particle emissivity [].
scalar Cp0() const
Return const access to the particle specific heat capacity.
scalar TMax() const
Return const access to maximum temperature [K].
scalar T0() const
Return const access to the particle initial temperature [K].
scalar Cp() const
Return const access to specific heat capacity.
scalar T() const
Return const access to temperature.
scalar Cp_
Specific heat capacity [J/kg/K].
Definition: ThermoParcel.H:271
scalar T_
Temperature [K].
Definition: ThermoParcel.H:268
ThermoParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti, const label facei)
Construct from mesh, coordinates and topology.
Definition: ThermoParcelI.H:77
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
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy, recursively if necessary, the source to the destination.
Definition: POSIX.C:753