Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

iapws95.h

00001 /************************************************************************* 00002 00003 The thermodynamic properties of water calculated with the 00004 IAPWS95 equations. Variables and units: 00005 00006 T Temperature, K 00007 rho Density, kg/m^3 00008 p Pressure, MPa 00009 u Specific internal energy, kJ/kg 00010 h Specific enthalpy, kJ/kg 00011 s Specific entropy, kJ/(kg*K) 00012 cv Isochoric specific heat, kJ/(kg*K) 00013 cp Isobaric specific heat, kJ/(kg*K) 00014 w Speed of sound, m/s 00015 00016 References: 00017 00018 [1] The International Association for the Properties of 00019 Water and Steam, "Release on the IAPWS Formulation 1995 00020 for the Thermodynamic Properties of Ordinary Water 00021 Substance for General and Scientific Use", dated 00022 September 1996, Fredericia, Denmark. See the "Releases" 00023 section of the website http://www.iapws.org/. 00024 00025 [2] NIST Chemistry Webbook: 00026 http://webbook.nist.gov/chemistry/fluid/ 00027 00028 ---------------------------------------------------------------------- 00029 00030 Copyright (C) Don Peterson 2004 00031 Modified by John Pye 2004 00032 00033 This program is free software; you can redistribute it 00034 and/or modify it under the terms of the GNU General Public 00035 License as published by the Free Software Foundation; either 00036 version 2 of the License, or (at your option) any later 00037 version. 00038 00039 This program is distributed in the hope that it will be 00040 useful, but WITHOUT ANY WARRANTY; without even the implied 00041 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00042 PURPOSE. See the GNU General Public License for more 00043 details. 00044 00045 You should have received a copy of the GNU General Public 00046 License along with this program; if not, write to the Free 00047 Software Foundation, Inc., 59 Temple Place, Suite 330, 00048 Boston, MA 02111-1307 USA 00049 00050 *************************************************************************/ 00051 00052 #ifndef IAPWS95_H 00053 #define IAPWS95_H 00054 00055 #ifndef NUM_DEFINED 00056 // When integrating with the IF97 stuff, Num is already defined so don't redefine it... 00057 typedef double Num; 00058 #endif 00059 00060 namespace IAPWS95 00061 { 00062 // Universal gas constant in kJ/(kg*K) 00063 const Num R_ = 0.46151805; 00064 00065 // Critical temperature of water in K 00066 const Num Tc_ = 647.096; 00067 00068 // Critical density of water in kg/m^3 00069 const Num rhoc_ = 322; 00070 00071 const Num n0[] = { 00072 0.0, 00073 -8.32044648201, 6.6832105268, 3.00632, 0.012436, 00074 0.97315, 1.27950, 0.96956, 0.24873 00075 }; 00076 00077 const Num gamma0[] = { 00078 0.0, 0.0, 0.0, 0.0, 00079 1.28728967, 00080 3.53734222, 00081 7.74073708, 00082 9.24437796, 00083 27.5075105 00084 }; 00085 00086 const Num n[] = { 0, 00087 0.12533547935523e-1, 0.78957634722828e+1, -0.87803203303561e+1, 00088 0.31802509345418e+0, -0.26145533859358e+0, -0.78199751687981e-2, 00089 0.88089493102134e-2, -0.66856572307965e+0, 0.20433810950965e+0, 00090 -0.66212605039687e-4, -0.19232721156002e+0, -0.25709043003438e+0, 00091 0.16074868486251e+0, -0.40092828925807e-1, 0.39343422603254e-6, 00092 -0.75941377088144e-5, 0.56250979351888e-3, -0.15608652257135e-4, 00093 0.11537996422951e-8, 0.36582165144204e-6, -0.13251180074668e-11, 00094 -0.62639586912454e-9, -0.10793600908932e+0, 0.17611491008752e-1, 00095 0.22132295167546e+0, -0.40247669763528e+0, 0.58083399985759e+0, 00096 0.49969146990806e-2, -0.31358700712549e-1, -0.74315929710341e+0, 00097 0.47807329915480e+0, 0.20527940895948e-1, -0.13636435110343e+0, 00098 0.14180634400617e-1, 0.83326504880713e-2, -0.29052336009585e-1, 00099 0.38615085574206e-1, -0.20393486513704e-1, -0.16554050063734e-2, 00100 0.19955571979541e-2, 0.15870308324157e-3, -0.16388568342530e-4, 00101 0.43613615723811e-1, 0.34994005463765e-1, -0.76788197844621e-1, 00102 0.22446277332006e-1, -0.62689710414685e-4, -0.55711118565645e-9, 00103 -0.19905718354408e+0, 0.31777497330738e+0, -0.11841182425981e+0, 00104 -0.31306260323435e+2, 0.31546140237781e+2, -0.25213154341695e+4, 00105 -0.14874640856724e+0, 0.31806110878444e+0 00106 }; 00107 00108 const Num c[] = { 00109 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00110 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00111 2, 2, 2, 3, 3, 3, 3, 4, 6, 6, 6, 6 00112 }; 00113 00114 const Num d[] = { 00115 0, 1, 1, 1, 2, 2, 3, 4, 1, 1, 1, 2, 2, 3, 4, 00116 4, 5, 7, 9, 10, 11, 13, 15, 1, 2, 2, 2, 3, 4, 4, 00117 4, 5, 6, 6, 7, 9, 9, 9, 9, 9, 10, 10, 12, 3, 4, 00118 4, 5, 14, 3, 6, 6, 6, 3, 3, 3 00119 }; 00120 00121 const Num t[] = { 0, 00122 -0.5, 0.875, 1, 0.5, 0.75, 0.375, 1, 4, 6, 12, 1, 00123 5, 4, 2, 13, 9, 3, 4, 11, 4, 13, 1, 7, 1, 9, 10, 00124 10, 3, 7, 10, 10, 6, 10, 10, 1, 2, 3, 4, 8, 6, 9, 00125 8, 16, 22, 23, 23, 10, 50, 44, 46, 50, 0, 1, 4 00126 }; 00127 00128 // We need to make these arrays near the same size as n, so pad 00129 // them using macros. 00130 #define ARY10 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 00131 #define ARY50 ARY10, ARY10, ARY10, ARY10, ARY10 00132 #define ARY52 ARY50, 0, 0 00133 #define ARY55 ARY52, 0, 0, 0 00134 00135 const Num a[] = { ARY55, 3.5, 3.5 }; 00136 const Num b[] = { ARY55, 0.85, 0.95 }; 00137 const Num A[] = { ARY55, 0.32, 0.32 }; 00138 const Num B[] = { ARY55, 0.2, 0.2 }; 00139 const Num C[] = { ARY55, 28, 32 }; 00140 const Num D[] = { ARY55, 700, 800 }; 00141 00142 // Note these are slightly different sizes 00143 const Num alpha[] = { ARY52, 20, 20, 20 }; 00144 const Num beta[] = { ARY52, 150, 150, 250, 0.3, 0.3 }; 00145 const Num gamma[] = { ARY52, 1.21, 1.21, 1.25 }; 00146 00147 enum Limits 00148 { 00149 eGamma1 = 4, 00150 eGamma2 = 9, 00151 ePhir1 = 1, 00152 ePhir2 = 8, 00153 ePhir3 = 52, 00154 ePhir4 = 55, 00155 ePhir5 = 57 00156 }; 00157 00158 Num phi0(const Num &,const Num &); 00159 Num phi0delta(const Num &,const Num &); 00160 Num phi0deltadelta(const Num &,const Num &); 00161 Num phi0tau(const Num &,const Num &); 00162 Num phi0tautau(const Num &,const Num &); 00163 Num phi0deltatau(const Num &,const Num &); 00164 Num phir(const Num &,const Num &); 00165 Num phirdelta(const Num &,const Num &); 00166 Num phirdeltadelta(const Num &,const Num &); 00167 Num phirtau(const Num &,const Num &); 00168 Num phirtautau(const Num &,const Num &); 00169 Num phirdeltatau(const Num &,const Num &); 00170 Num phi0(const Num &,const Num &); 00171 Num phi0(const Num &,const Num &); 00172 Num phi0(const Num &,const Num &); 00173 } 00174 00203 class Water95 00204 { 00205 public: 00206 Water95(); 00207 ~Water95() {} 00208 Num p(const Num & T, const Num & rho); 00209 Num u(const Num & T, const Num & rho); 00210 Num h(const Num & T, const Num & rho); 00211 Num s(const Num & T, const Num & rho); 00212 Num cp(const Num & T, const Num & rho); 00213 Num cv(const Num & T, const Num & rho); 00214 Num w(const Num & T, const Num & rho); 00215 00216 // Constants 00217 const Num & R; 00218 const Num & Tc; 00219 const Num & rhoc; 00220 }; 00221 00222 00223 #endif

Generated on Tue Mar 22 19:07:05 2005 for freesteam by doxygen 1.3.8