You are on page 1of 1

1 #include <iostream>

2 #include <math.h>
3 using namespace std;
4
5 float calc_flooding_velocity(float pg,float pl)
6 {
7 float rhs=(float)(0.25*pg*pl*9.81)/(100.0*pow(0.9,0.2));
8 return sqrt(rhs)*3600.0;
9 }
10
11 float calc_diameter(float area)
12 {
13 float pi=3.14157;
14 return sqrt((area*4.0)/pi);
15 }
16 float MTC_ammonia(float Gg,float Gl)
17 {
18 return 0.0142*pow((Gg*2.205)/31.0,0.72)*pow((Gl*2.205)/31.0,0.38);
19 }
20 float HoG(float Gg, float Gl,float P,float y1, float y2, float Man, float Gop,float Ma)
21 {
22 float kga=MTC_ammonia(Gg,Gl);
23 float Ggm=Gop*((1.0/Ma)+((y1+y2)/Man));
24 return Ggm/(kga*P);
25 }
26
27 float NoG(float Gg,float Gl,float m, float y1, float y2, float ye2,float ye1)
28 {
29 float c=(1-(m*(Gg/Gl)));
30 float nog=(1/c)*(log(c*((y1-ye1)/(y2-ye2)))+(m*(Gg/Gl)));
31 return nog;
32 }
33 int main()
34 {
35 float Gl,Gg,pl,pg,y1,ye1,y2,ye2,m,P,Ma,Man;
36 cout<<"Enter liquid flow rate in kg/hr:"<< endl;
37 cin>>Gl;
38 cout<<"Enter gas flow rate in kg/hr:"<<endl;
39 cin>>Gg;
40 cout<<"Enter liquid density in lb/cubic feet:"<<endl;
41 cin>>pl;
42 cout<<"Enter gas density in lb/cubic feet:"<<endl;
43 cin>>pg;
44 cout<<"Enter y1"<<endl;
45 cin>>y1;
46 cout<<"Enter ye1"<<endl;
47 cin>>ye1;
48 cout<<"Enter y2"<<endl;
49 cin>>y2;
50 cout<<"Enter ye2"<<endl;
51 cin>>ye2;
52 cout<<"Enter m"<<endl;
53 cin>>m;
54 cout<<"Enter the pressure in the absorber(P) in atm"<<endl;
55 cin>>P;
56 cout<<"Enter the molecular weight of ammonia in g/mol"<<endl;
57 cin>>Ma;
58 cout<<"Enter the molecular weight of acrylonitrile in g/mol"<<endl;
59 cin>>Man;
60 float Gf=calc_flooding_velocity(pg,pl); //Calculated flooding velocity
61 float Gop=0.6*Gf; //Operating velocity is 60% of flooding velocity
62 float area=(Gg*2.205)/Gop;
63 float D=calc_diameter(area);
64 float hog=HoG(Gg,Gl,P,y1,y2,Man,Gop,Ma);
65 cout<<"HoG = "<<hog<<endl;
66 float nog=NoG(Gg,Gl,m,y1,y2,ye2,ye1);
67 cout<<"NoG = "<<nog<<endl;
68 cout<<"Z = "<<nog*hog<<endl;
69 return 0;
70 }
71

You might also like