Cantera  2.3.0
RedlichKwong.h
Go to the documentation of this file.
1 //! @file RedlichKwong.h
2 
3 // This file is part of Cantera. See License.txt in the top-level directory or
4 // at http://www.cantera.org/license.txt for license and copyright information.
5 
6 #ifndef TPX_RK_H
7 #define TPX_RK_H
8 
9 #include "cantera/tpx/Sub.h"
10 #include "cantera/base/global.h"
11 #include <math.h>
12 
13 namespace tpx
14 {
15 const double GasConstant = 8314.3;
16 
17 //! @deprecated To be removed after Cantera 2.3.
18 class RedlichKwong : public Substance
19 {
20 
21 public:
22 
23  RedlichKwong() {
24  Cantera::warn_deprecated("class RedlichKwong",
25  "To be removed after Cantera 2.3.");
26  setParameters(1.0, 1.0, 1.0);
27  m_name = "Redlich-Kwong";
28  m_formula = "-";
29  }
30 
31  void setParameters(double Tc, double Pc, double MolWt) {
32  m_tcrit = Tc;
33  m_pcrit = Pc;
34  m_mw = MolWt;
35 
36  // compute the a and b parameters
37  m_a = 0.42748*GasConstant*GasConstant*m_tcrit*m_tcrit*sqrt(m_tcrit)/m_pcrit;
38  m_b = 0.08664*GasConstant*m_tcrit/m_pcrit;
39  }
40 
41  double a() {
42  return m_a;
43  }
44  double b() {
45  return m_b;
46  }
47 
48  double MolWt() {
49  return m_mw;
50  }
51  double Tcrit() {
52  return m_tcrit;
53  }
54  double Pcrit() {
55  return m_pcrit;
56  }
57  double Vcrit() {
58  return 0.3592725*GasConstant*T/(m_mw*m_pcrit);
59  }
60  double Tmin() {
61  return 0.0;
62  }
63  double Tmax() {
64  return 1.0e10;
65  }
66 
67  double Pp();
68  double up();
69  double sp();
70  double Psat();
71  double dPsatdT();
72 
73  // compressibility
74  double z();
75 
76  // enthalpy departure
77  double hresid();
78 
79  // entropy departure
80  double sresid();
81 
82  double ldens();
83 
84 protected:
85  double m_tcrit, m_pcrit, m_mw, m_a, m_b;
86 };
87 }
88 
89 #endif // ! TPX_RK_H
double MolWt()
Molecular weight [kg/kmol].
Definition: RedlichKwong.h:48
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:54
double up()
Internal energy of a single-phase state.
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, (see Input File Handling, Diagnostic Output, and Writing messages to the screen).
double Vcrit()
Critical specific volume [m^3/kg].
Definition: RedlichKwong.h:57
double Psat()
Saturation pressure, Pa.
double Pcrit()
Critical pressure [Pa].
Definition: RedlichKwong.h:54
double Tmax()
Maximum temperature for which the equation of state is valid.
Definition: RedlichKwong.h:63
double sp()
Entropy of a single-phase state.
double Tcrit()
Critical temperature [K].
Definition: RedlichKwong.h:51
double Tmin()
Minimum temperature for which the equation of state is valid.
Definition: RedlichKwong.h:60