-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_XN.cpp
63 lines (58 loc) · 1.35 KB
/
test_XN.cpp
1
2
3
4
5
6
7
8
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
36
37
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
#include "iostream"
#include "math.h"
using namespace std;
double T_ex=120,T_av=70;
double GetVapHeat(double T){
double HL=0.1;
if(T<=154.6 )
HL=1000.*(1-0.006468*T)/(0.003909-0.000022*T);
return HL;
}
double GetCp_mixt_ex(){
// double Cp_mixt_ex = 0.;
// for (int i = 0; i < CN; ++i)
// Cp_mixt_ex+=Y_ex[i]*Cp[i];
// return Cp_mixt_ex;
return 14000.;
}
double GetCp_mixt_w(){
// double GetCp_mixt_w = 0.;
// for (int i = 0; i < CN; ++i)
// GetCp_mixt_w+=Y_w[i]*Cp[i];
// return GetCp_mixt_w;
return 1670.;
}
double GetXi(double T){
double xi;
double Cpe = GetCp_mixt_ex();
double Cpw = GetCp_mixt_w();
double HL = GetVapHeat(T);
cout<<"GetXi:"<<(Cpe*T_ex-Cpw*T)<<" "<<(HL+Cpw*(T-T_av))<<endl;
xi=log(1.+(Cpe*T_ex-Cpw*T)/(HL+Cpw*(T-T_av)));
return xi;
}
double pow(double val, int pow){
double result;
if(pow){
result=val;
for (int i = 1; i < pow; ++i)
result*=val;
}
else if(!pow) result = 1.;
return result;
}
double GetO2PartPres(double T){
double A[4] = {-3630740., 150530., -2048.72, 9.31122};
double P_O2 = 0;
for (int i = 0; i < 4; ++i)
P_O2+=A[i] * pow(T,i);
return P_O2;
}
int main(int argc, char const *argv[])
{
for (double T = 0.; T < 200; ++T)
{
cout<<"T = "<< T<< " P = "<<GetO2PartPres(T)<<" HL = "<<GetVapHeat(T)<<" xi = "<<GetXi(T)<<endl;
}
return 0;
}