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

common.h

00001 /* 00002 00003 freesteam - IAPWS-IF97 steam tables library 00004 Copyright (C) 2004-2005 John Pye 00005 00006 This program is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU General Public License 00008 as published by the Free Software Foundation; either version 2 00009 of the License, or (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 00020 */ 00021 00022 #ifndef COMMON_H 00023 #define COMMON_H 00024 00025 #include "units.h" 00026 00027 // this is the precision of all the parameters used in the Steam Calculator: 00028 typedef double Num; 00029 #define NUM_DEFINED 00030 00031 // define a method (for use in header files) 00032 #define METHOD_H_OBJ(funcname) Num funcname(SteamCalculator *c) 00033 00034 const SpecificGasConstant R=0.461526 * kJ_kgK; // Specific gas constant for water from IF97 00035 00036 #define REG4_TOL 0.001 // relative err on pressures considerd to be equal to psat. 00037 00038 const Temperature TB_HIGH = 863.15 * Kelvin; 00039 const Temperature T_MIN = ZeroCelsius; 00040 const Temperature T_MAX = 1073.15 * Kelvin; 00041 const Temperature T_CRIT = 647.096 * Kelvin; // critical-point temperature 00042 const Temperature T_TRIPLE = 273.16 * Kelvin; // triple-point temperature 00043 const Temperature REG2_TEMP_REF = 540.0 * Kelvin; 00044 const Temperature REG1_TEMP_REF = 1386.0 * Kelvin; 00045 const Temperature REG1_T_LOW = ZeroCelsius; 00046 const Temperature REG2_T_LOW = ZeroCelsius; 00047 const Temperature REG2_T_HIGH = T_MAX; 00048 00049 const Temperature T_REG1_REG3 = 623.15 * Kelvin; 00050 const Temperature TB_LOW = T_REG1_REG3; 00051 00052 const Temperature T_MIN_VOL = fromcelsius(3.984); 00053 00054 const Pressure P_MAX = 100.0 * MPa; 00055 const Pressure PB_LOW = 16.5292 * MPa; 00056 const Pressure P_MIN = 0.0 * Pascal; 00057 const Pressure P_CRIT = 22.064 * MPa; // critical-point pressure 00058 const Pressure P_TRIPLE = 611.657 * Pascal; // triple-point pressure 00059 const Pressure REG4_P_MIN = 611.213 * Pascal; // minimum pressure for region 4 (IF-97 eq 31 & p 35) / [MPa] 00060 const Pressure REG2_P_HIGH = P_MAX; 00061 const Pressure REG1_P_HIGH = P_MAX; 00062 const Pressure REG1_PRES_REF = 16.53 * MPa; 00063 const Pressure REG2_PRES_REF = 1.0 * MPa; 00064 00065 const Density RHO_CRIT = 322.0 * kg / metre3; // critical-point density / [kg/m³] 00066 00068 const DynamicViscosity IAPS85_VISC_REF = 55.071 * micro * Pascal * second; 00069 00071 const Density IAPS85_DENS_REF = 317.763 * kg_m3; 00072 00074 const Temperature IAPS85_TEMP_REF = 647.226 * Kelvin; 00075 00077 const Pressure IAPS85_PRES_REF = 22.115 * MPa; // MPa (THIS IS *NOT* EQUAL TO P_CRIT!) 00078 00080 const Conductivity IAPS85_THCOND_REF = 0.49450 * Watt / metre / Kelvin; 00081 00082 const Temperature IAPS85_TEMP_REG2_REF = 540.0 * Kelvin; 00083 00084 const Pressure STEAM_P_EPS = 1.0e-5 * MPa; 00085 const Temperature STEAM_T_EPS = 5.0e-4 * Kelvin; 00086 00087 const Temperature EPS_T_CRIT=0.00007 * Kelvin; 00088 00089 const Temperature T_CRIT_PLUS=(T_CRIT + STEAM_T_EPS); 00090 00091 const Density REG3_ZEROIN_DENS_MAX = 765.0 * kg_m3; 00092 const Density REG3_ZEROIN_TOL= 1e-18 * kg_m3; 00093 00094 #define MPA_TO_BAR(PRES) (((Num)(PRES)) * 10.0 ) 00095 #define BAR_TO_MPA(PRES) (((Num)(PRES)) * 0.1 ) 00096 #define PA_TO_MPA(PRES) (((Num)(PRES)) * 0.000001 ) 00097 #define MPA_TO_PA(PRES) (((Num)(PRES)) * 1.0E6 ) 00098 #define KJKG_TO_JKG(JKG) (((Num)(KJKG)) * 1000.0 ) 00099 #define BAR_TO_PA(PRES) (((Num)(PRES)) * 100.0E3 ) 00100 #define KPA_TO_MPA(PRES) (((Num)(PRES)) * 0.001 ) 00101 00102 #define W_TO_KW(W) (((Num)(W))*0.001) 00103 #define KJ_TO_J(KJ) (((Num)(KJ))*0.001) 00104 #define J_TO_KJ(J) (((Num)(J))*0.001) 00105 00106 const Acceleration GRAV = 9.81 * Newton / kg; // N/kg, gravitation acceleration 00107 00108 #define PI 3.14159265358 00109 00110 // Property 'Alternative' codes for use with SatCurve and B23Curve and Solver2 00111 00112 const int SOLVE_IENERGY=0; 00113 const int SOLVE_ENTHALPY=1; 00114 00115 const int SOLVE_ENTROPY=0; 00116 const int SOLVE_CV=1; 00117 const int SOLVE_CP=2; 00118 00119 // square a value but only evaluate it once in GNU C's CPP. 00120 00121 template<class T> 00122 T sq(const T& t){ 00123 return t*t; 00124 } 00125 00126 #endif 00127

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