ThermoParcelI.H 5.93 KB
Newer Older
1
2
3
4
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
5
    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
6
7
8
9
10
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

11
12
13
14
    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
15
16
17
18
19
20
21

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    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
27
28
29
30

\*---------------------------------------------------------------------------*/

// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //

template<class ParcelType>
inline Foam::ThermoParcel<ParcelType>::constantProperties::constantProperties
(
31
    const dictionary& parentDict
32
33
)
:
34
    KinematicParcel<ParcelType>::constantProperties(parentDict),
35
36
    T0_(readScalar(this->dict().lookup("T0"))),
    TMin_(readScalar(this->dict().lookup("TMin"))),
37
    Cp0_(readScalar(this->dict().lookup("Cp0"))),
38
39
40
    epsilon0_(readScalar(this->dict().lookup("epsilon0"))),
    f0_(readScalar(this->dict().lookup("f0"))),
    Pr_(readScalar(this->dict().lookup("Pr")))
41
42
43
44
45
46
47
{}


template<class ParcelType>
inline Foam::ThermoParcel<ParcelType>::trackData::trackData
(
    ThermoCloud<ParcelType>& cloud,
48
    typename KinematicParcel<ParcelType>::trackData::trackPart part
49
50
)
:
51
52
    KinematicParcel<ParcelType>::trackData(cloud, part),
    cloud_(cloud),
53
54
55
56
57
58
59
60
61
62
63
64
    Cp_
    (
        IOobject
        (
            "Cp",
            cloud.db().time().timeName(),
            cloud.db(),
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
        cloud.thermo().thermo().Cp()
    ),
65
    TInterp_
66
    (
67
68
69
70
71
        interpolation<scalar>::New
        (
            cloud.solution().interpolationSchemes(),
            cloud.T()
        )
72
    ),
73
74
75
76
77
78
79
80
    CpInterp_
    (
        interpolation<scalar>::New
        (
            cloud.solution().interpolationSchemes(),
            Cp_
        )
    )
81
82
83
{}


Andrew Heather's avatar
Andrew Heather committed
84
85
86
87
88
template<class ParcelType>
inline Foam::ThermoParcel<ParcelType>::ThermoParcel
(
    ThermoCloud<ParcelType>& owner,
    const vector& position,
89
90
91
    const label cellI,
    const label tetFaceI,
    const label tetPtI
Andrew Heather's avatar
Andrew Heather committed
92
93
)
:
94
    KinematicParcel<ParcelType>(owner, position, cellI, tetFaceI, tetPtI),
Andrew Heather's avatar
Andrew Heather committed
95
    T_(0.0),
96
    Cp_(0.0),
Andrew Heather's avatar
Andrew Heather committed
97
    Tc_(0.0),
98
    Cpc_(0.0)
Andrew Heather's avatar
Andrew Heather committed
99
100
101
{}


102
103
104
105
106
template<class ParcelType>
inline Foam::ThermoParcel<ParcelType>::ThermoParcel
(
    ThermoCloud<ParcelType>& owner,
    const vector& position,
107
    const label cellI,
108
109
    const label tetFaceI,
    const label tetPtI,
110
111
    const label typeId,
    const scalar nParticle0,
112
    const scalar d0,
graham's avatar
graham committed
113
    const scalar dTarget0,
114
    const vector& U0,
115
    const vector& f0,
116
117
    const vector& angularMomentum0,
    const vector& torque0,
118
119
120
    const constantProperties& constProps
)
:
121
    KinematicParcel<ParcelType>
122
123
124
    (
        owner,
        position,
125
        cellI,
126
127
        tetFaceI,
        tetPtI,
128
129
        typeId,
        nParticle0,
130
        d0,
graham's avatar
graham committed
131
        dTarget0,
132
        U0,
133
        f0,
134
135
        angularMomentum0,
        torque0,
136
137
138
        constProps
    ),
    T_(constProps.T0()),
139
    Cp_(constProps.Cp0()),
140
    Tc_(0.0),
141
    Cpc_(0.0)
142
143
144
145
146
147
{}


// * * * * * * * * * constantProperties Member Functions * * * * * * * * * * //

template <class ParcelType>
148
inline Foam::scalar
149
150
151
152
153
154
Foam::ThermoParcel<ParcelType>::constantProperties::T0() const
{
    return T0_;
}


155
156
157
158
159
160
161
162
template <class ParcelType>
inline Foam::scalar
Foam::ThermoParcel<ParcelType>::constantProperties::TMin() const
{
    return TMin_;
}


163
template <class ParcelType>
164
inline Foam::scalar
165
Foam::ThermoParcel<ParcelType>::constantProperties::Cp0() const
166
{
167
    return Cp0_;
168
169
170
171
}


template <class ParcelType>
172
inline Foam::scalar
173
174
175
176
177
178
179
Foam::ThermoParcel<ParcelType>::constantProperties::epsilon0() const
{
    return epsilon0_;
}


template <class ParcelType>
180
inline Foam::scalar
181
182
183
184
185
186
Foam::ThermoParcel<ParcelType>::constantProperties::f0() const
{
    return f0_;
}


187
188
189
190
191
192
193
194
template <class ParcelType>
inline Foam::scalar
Foam::ThermoParcel<ParcelType>::constantProperties::Pr() const
{
    return Pr_;
}


195
196
197
198
199
200
201
202
203
204
// * * * * * * * * * * * trackData Member Functions  * * * * * * * * * * * * //

template<class ParcelType>
inline Foam::ThermoCloud<ParcelType>&
Foam::ThermoParcel<ParcelType>::trackData::cloud()
{
    return cloud_;
}


205
206
207
208
209
210
211
212
template<class ParcelType>
inline const Foam::volScalarField&
Foam::ThermoParcel<ParcelType>::trackData::Cp() const
{
    return Cp_;
}


213
template<class ParcelType>
214
inline const Foam::interpolation<Foam::scalar>&
215
216
Foam::ThermoParcel<ParcelType>::trackData::TInterp() const
{
217
    return TInterp_();
218
219
220
221
}


template<class ParcelType>
222
inline const Foam::interpolation<Foam::scalar>&
223
Foam::ThermoParcel<ParcelType>::trackData::CpInterp() const
224
{
225
    return CpInterp_();
226
227
228
229
230
231
}


// * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * //

template<class ParcelType>
232
inline Foam::scalar Foam::ThermoParcel<ParcelType>::T() const
233
234
235
236
237
238
{
    return T_;
}


template<class ParcelType>
239
inline Foam::scalar Foam::ThermoParcel<ParcelType>::Cp() const
240
{
241
    return Cp_;
242
243
244
}


245
246
247
template<class ParcelType>
inline Foam::scalar Foam::ThermoParcel<ParcelType>::hs() const
{
248
    return Cp_*(T_ - 298.15);
249
250
251
}


252
template<class ParcelType>
253
inline Foam::scalar& Foam::ThermoParcel<ParcelType>::T()
254
{
255
    return T_;
256
257
258
259
}


template<class ParcelType>
260
inline Foam::scalar& Foam::ThermoParcel<ParcelType>::Cp()
261
{
262
    return Cp_;
263
264
265
266
}


// ************************************************************************* //