twoPhaseMixtureEThermo.H 8.94 KB
Newer Older
1
2
3
4
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
OpenFOAM bot's avatar
OpenFOAM bot committed
5
    \\  /    A nd           | www.openfoam.com
6
     \\/     M anipulation  |
OpenFOAM bot's avatar
OpenFOAM bot committed
7
-------------------------------------------------------------------------------
8
    Copyright (C) 2016-2021 OpenCFD Ltd.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

    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.

    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
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

Class
    Foam::twoPhaseMixtureEThermo

Description

SourceFiles
    twoPhaseMixtureEThermo.C

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

Andrew Heather's avatar
Andrew Heather committed
36
37
#ifndef twoPhaseMixtureEThermo_H
#define twoPhaseMixtureEThermo_H
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

#include "volFields.H"

#include "basicThermo.H"
#include "thermoIncompressibleTwoPhaseMixture.H"

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

namespace Foam
{

/*---------------------------------------------------------------------------*\
                    Class twoPhaseMixtureEThermo Declaration
\*---------------------------------------------------------------------------*/

class twoPhaseMixtureEThermo
:
    public basicThermo,
    public thermoIncompressibleTwoPhaseMixture
{

protected:

    // Protected Data

        //- Saturation Temperature
        dimensionedScalar TSat_;

public:

    TypeName("twoPhaseMixtureEThermo");

    // Constructor
    twoPhaseMixtureEThermo
    (
        const volVectorField& U,
        const surfaceScalarField& phi
    );


    //- Destructor
79
    virtual ~twoPhaseMixtureEThermo() = default;
80
81
82
83
84


    // Member Functions


Andrew Heather's avatar
Andrew Heather committed
85
        //- Return access to the internal energy field [J/Kg]
86
87
        virtual volScalarField& he()
        {
88
89
            NotImplemented;
            return p();
90
91
        }

Andrew Heather's avatar
Andrew Heather committed
92
        //- Return access to the internal energy field [J/Kg]
93
94
        virtual const volScalarField& he() const
        {
95
96
            NotImplemented;
            return p();
97
98
99
        }

        //- Enthalpy/Internal energy
Andrew Heather's avatar
Andrew Heather committed
100
        //- for given pressure and temperature [J/kg]
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
        virtual tmp<volScalarField> he
        (
            const volScalarField& p,
            const volScalarField& T
        ) const;

        //- Enthalpy/Internal energy for cell-set [J/kg]
        virtual tmp<scalarField> he
        (
            const scalarField& p,
            const scalarField& T,
            const labelList& cells
        ) const;

        //- Enthalpy/Internal energy for patch [J/kg]
        virtual tmp<scalarField> he
        (
            const scalarField& p,
            const scalarField& T,
            const label patchi
        ) const;

        //- Chemical enthalpy [J/kg]
        virtual tmp<volScalarField> hc() const;

        //- Temperature from enthalpy/internal energy for cell-set
        virtual tmp<scalarField> THE
        (
            const scalarField& h,
            const scalarField& p,
            const scalarField& T0,      // starting temperature
            const labelList& cells
        ) const;

        //- Temperature from enthalpy/internal energy for patch
        virtual tmp<scalarField> THE
        (
            const scalarField& h,
            const scalarField& p,
            const scalarField& T0,      // starting temperature
            const label patchi
        ) const;


        //- Return true if the equation of state is incompressible
Andrew Heather's avatar
Andrew Heather committed
146
        //- i.e. rho != f(p)
147
148
        bool incompressible() const
        {
149
            return true;
150
151
152
        }

        //- Return true if the equation of state is isochoric
Andrew Heather's avatar
Andrew Heather committed
153
        //- i.e. rho = const
154
155
        bool isochoric() const
        {
156
            return false;
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
        }

        //- Return rho of the mixture
        virtual tmp<volScalarField> rho() const;

        //- Return rho for patch
        virtual tmp<scalarField> rho(const label patchi) const;

        //- Return Cp of the mixture
        virtual tmp<volScalarField> Cp() const;

        //- Heat capacity at constant pressure for patch [J/kg/K]
        virtual tmp<scalarField> Cp
        (
            const scalarField& p,
            const scalarField& T,
            const label patchi
        ) const;

176
        //- Heat capacity using pressure and temperature
177
        virtual tmp<scalarField> Cp
178
179
        (
            const scalarField& p,
180
            const scalarField& T,
181
182
183
184
185
186
187
            const labelList& cells
        ) const
        {
            NotImplemented;
            return tmp<scalarField>::New(p);
        }

Andrew Heather's avatar
Andrew Heather committed
188
        //- Return Cv of the mixture
189
190
191
192
193
194
195
196
197
198
        virtual tmp<volScalarField> Cv() const;

        //- Heat capacity at constant volume for patch [J/kg/K]
        virtual tmp<scalarField> Cv
        (
            const scalarField& p,
            const scalarField& T,
            const label patchI
        ) const;

199
200
201
202
        //- Density from pressure and temperature
        virtual tmp<scalarField> rhoEoS
        (
            const scalarField& p,
203
            const scalarField& T,
204
205
206
207
208
209
210
            const labelList& cells
        ) const
        {
            NotImplemented;
            return tmp<scalarField>::New(p);
        }

211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
        //- Gamma = Cp/Cv []
        virtual tmp<volScalarField> gamma() const;

        //- Gamma = Cp/Cv for patch []
        virtual tmp<scalarField> gamma
        (
            const scalarField& p,
            const scalarField& T,
            const label patchi
        ) const;

         //- Heat capacity at constant pressure/volume [J/kg/K]
        virtual tmp<volScalarField> Cpv() const;

        //- Heat capacity at constant pressure/volume for patch [J/kg/K]
        virtual tmp<scalarField> Cpv
        (
            const scalarField& p,
            const scalarField& T,
            const label patchi
        ) const;

        //- Heat capacity ratio []
        virtual tmp<volScalarField> CpByCpv() const;

        //- Heat capacity ratio for patch []
        virtual tmp<scalarField> CpByCpv
        (
            const scalarField& p,
            const scalarField& T,
            const label patchi
        ) const;

244
245
246
        //- Molecular weight [kg/kmol]
        virtual tmp<volScalarField> W() const;

247
248
249
250
        //- Thermal diffusivity for temperature of mixture [J/m/s/K]
        virtual tmp<volScalarField> kappa() const;

        //- Thermal diffusivity for temperature
Andrew Heather's avatar
Andrew Heather committed
251
        //- of mixture for patch [J/m/s/K]
252
253
254
255
256
        virtual tmp<scalarField> kappa
        (
            const label patchi
        ) const;

257
258
259
260
261
262
        //- Thermal diffusivity for energy of mixture [kg/m/s]
        virtual tmp<volScalarField> alphahe() const;

        //- Thermal diffusivity for energy of mixture for patch [kg/m/s]
        virtual tmp<scalarField> alphahe(const label patchi) const;

263
        //- Effective thermal diffusivity for temperature
Andrew Heather's avatar
Andrew Heather committed
264
        //- of mixture [J/m/s/K]
265
266
267
268
269
270
        virtual tmp<volScalarField> kappaEff
        (
            const volScalarField&
        ) const;

        //- Effective thermal diffusivity for temperature
Andrew Heather's avatar
Andrew Heather committed
271
        //- of mixture for patch [J/m/s/K]
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
        virtual tmp<scalarField> kappaEff
        (
            const scalarField& alphat,
            const label patchi
        ) const;

        //- Effective thermal diffusivity of mixture [kg/m/s]
        virtual tmp<volScalarField> alphaEff
        (
            const volScalarField& alphat
        ) const;

        //- Effective thermal diffusivity of mixture for patch [kg/m/s]
        virtual tmp<scalarField> alphaEff
        (
            const scalarField& alphat,
            const label patchi
        ) const;


Andrew Heather's avatar
Andrew Heather committed
292
        //- Correct the thermo fields
293
294
        virtual void correct();

295
296
297
        //- Return the name of the thermo physics
        virtual word thermoName() const;

298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
        //- Read properties
        virtual bool read();


        // Access to thermodynamic state variables

            //- Return const-access to the saturation temperature
            const dimensionedScalar& TSat() const
            {
                return TSat_;
            }

            //- Return transport properties dictionary
            const incompressibleTwoPhaseMixture& transportPropertiesDict()
            {
                return *this;
            }
};


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

} // End namespace Foam

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

#endif

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