ReactingParcelI.H 4.99 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::ReactingParcel<ParcelType>::constantProperties::constantProperties
(
31
    const dictionary& parentDict
32
33
)
:
34
    ThermoParcel<ParcelType>::constantProperties(parentDict),
35
    pMin_(readScalar(this->dict().lookup("pMin"))),
36
    constantVolume_(this->dict().lookup("constantVolume")),
37
38
    Tvap_(readScalar(this->dict().lookup("Tvap"))),
    Tbp_(readScalar(this->dict().lookup("Tbp")))
39
40
41
42
43
44
45
{}


template<class ParcelType>
inline Foam::ReactingParcel<ParcelType>::trackData::trackData
(
    ReactingCloud<ParcelType>& cloud,
46
    typename ThermoParcel<ParcelType>::trackData::trackPart part
47
48
)
:
49
    ThermoParcel<ParcelType>::trackData(cloud, part),
50
    cloud_(cloud),
51
52
53
54
55
56
57
58
    pInterp_
    (
        interpolation<scalar>::New
        (
            cloud.solution().interpolationSchemes(),
            cloud.p()
        )
    )
59
60
61
{}


Andrew Heather's avatar
Andrew Heather committed
62
63
64
65
66
template<class ParcelType>
inline Foam::ReactingParcel<ParcelType>::ReactingParcel
(
    ReactingCloud<ParcelType>& owner,
    const vector& position,
67
68
69
    const label cellI,
    const label tetFaceI,
    const label tetPtI
Andrew Heather's avatar
Andrew Heather committed
70
71
)
:
72
    ThermoParcel<ParcelType>(owner, position, cellI, tetFaceI, tetPtI),
Andrew Heather's avatar
Andrew Heather committed
73
74
75
76
77
78
    mass0_(0.0),
    Y_(0),
    pc_(0.0)
{}


79
80
81
82
83
template<class ParcelType>
inline Foam::ReactingParcel<ParcelType>::ReactingParcel
(
    ReactingCloud<ParcelType>& owner,
    const vector& position,
84
    const label cellI,
85
86
    const label tetFaceI,
    const label tetPtI,
87
88
    const label typeId,
    const scalar nParticle0,
89
    const scalar d0,
graham's avatar
graham committed
90
    const scalar dTarget0,
91
    const vector& U0,
92
    const vector& f0,
93
94
    const vector& angularMomentum0,
    const vector& torque0,
95
    const scalarField& Y0,
96
97
98
99
100
101
102
    const constantProperties& constProps
)
:
    ThermoParcel<ParcelType>
    (
        owner,
        position,
103
        cellI,
104
105
        tetFaceI,
        tetPtI,
106
107
        typeId,
        nParticle0,
108
        d0,
graham's avatar
graham committed
109
        dTarget0,
110
        U0,
111
        f0,
112
113
        angularMomentum0,
        torque0,
114
115
116
        constProps
    ),
    mass0_(0.0),
117
    Y_(Y0),
118
    pc_(0.0)
119
120
121
122
123
124
125
126
{
    // Set initial parcel mass
    mass0_ = this->mass();
}


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

127
128
129
130
131
132
133
134
template<class ParcelType>
inline Foam::scalar
Foam::ReactingParcel<ParcelType>::constantProperties::pMin() const
{
    return pMin_;
}


135
136
137
138
139
140
141
142
template<class ParcelType>
inline Foam::Switch
Foam::ReactingParcel<ParcelType>::constantProperties::constantVolume() const
{
    return constantVolume_;
}


143
144
145
146
147
148
149
150
template<class ParcelType>
inline Foam::scalar
Foam::ReactingParcel<ParcelType>::constantProperties::Tvap() const
{
    return Tvap_;
}


Andrew Heather's avatar
Andrew Heather committed
151
152
153
154
155
156
157
158
template<class ParcelType>
inline Foam::scalar
Foam::ReactingParcel<ParcelType>::constantProperties::Tbp() const
{
    return Tbp_;
}


159
160
161
162
163
164
165
166
167
168
169
// * * * * * * * * * * * trackData Member Functions  * * * * * * * * * * * * //

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


template<class ParcelType>
170
inline const Foam::interpolation<Foam::scalar>&
171
172
Foam::ReactingParcel<ParcelType>::trackData::pInterp() const
{
173
    return pInterp_();
174
175
176
177
178
179
}


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

template<class ParcelType>
180
inline Foam::scalar Foam::ReactingParcel<ParcelType>::mass0() const
181
{
182
    return mass0_;
183
184
185
186
}


template<class ParcelType>
187
inline const Foam::scalarField& Foam::ReactingParcel<ParcelType>::Y() const
188
{
189
    return Y_;
190
191
192
193
}


template<class ParcelType>
194
inline Foam::scalar Foam::ReactingParcel<ParcelType>::pc() const
195
{
196
    return pc_;
197
198
199
200
}


template<class ParcelType>
201
inline Foam::scalar& Foam::ReactingParcel<ParcelType>::mass0()
202
203
204
205
206
207
{
    return mass0_;
}


template<class ParcelType>
208
inline Foam::scalarField& Foam::ReactingParcel<ParcelType>::Y()
209
{
210
    return Y_;
211
212
213
214
}


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