00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#ifndef COMMON_H
00023
#define COMMON_H
00024
00025
#include "units.h"
00026
00027
00028
typedef double Num;
00029
#define NUM_DEFINED
00030
00031
00032
#define METHOD_H_OBJ(funcname) Num funcname(SteamCalculator *c)
00033
00034
const SpecificGasConstant R=0.461526 * kJ_kgK;
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;
00042
const Temperature T_TRIPLE = 273.16 * Kelvin;
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;
00058
const Pressure P_TRIPLE = 611.657 * Pascal;
00059
const Pressure REG4_P_MIN = 611.213 * Pascal;
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;
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;
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;
00107
00108
#define PI 3.14159265358
00109
00110
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
00120
00121
template<
class T>
00122 T sq(
const T& t){
00123
return t*t;
00124 }
00125
00126
#endif
00127