《《輸油管道設(shè)計(jì)與管理》課程設(shè)計(jì)水力計(jì)算程序4頁》由會(huì)員分享,可在線閱讀,更多相關(guān)《《輸油管道設(shè)計(jì)與管理》課程設(shè)計(jì)水力計(jì)算程序4頁(4頁珍藏版)》請(qǐng)?jiān)谘b配圖網(wǎng)上搜索。
1、#include
#include
#define Q 1002.9 //流量,m^3/h;
#define D 0.559 //管外徑,m;
#define d 0.5384 //管內(nèi)徑,m;
#define v 9.028e-6 //運(yùn)動(dòng)粘度,m^2/s;
#define L 1953 //管道全長(zhǎng),Km;
#define Zz 1530 //終點(diǎn)海拔高度Zz=1530m;
#define ZQ 800 //起點(diǎn)海拔高度ZQ=0m;
2、#define rowt 853.5 //油品在計(jì)算溫度下的密度,Kg/m^3;
#define Hsq 0.3e6/(9.81*rowt) //首站進(jìn)站壓力,m水柱;
#define Hsz 0.2e6/(9.81*rowt) //末站剩余壓頭,m水液柱;
#define hm 10 //站內(nèi)損失,m;
main()
{
double Re, Re1, Re2, E, Qs;
double lamda, hl;
double A, N;
double ai;
double H, H
3、c,V;
Qs=Q/3600;
V=4*Qs/(3.14*d*d);
printf("\n 流速V=%f(m/s)\n\n",V);
printf(" 流量Qs=%f(m^3/s)\n\n",Qs);
Re=4*1002.9/(3.14*d*3600*v);
printf(" 雷諾數(shù)Re=%0.2E\n\n",Re);
E=2*0.1/(d*1000);
printf(" 相對(duì)當(dāng)量粗糙度E=%0.2E\n\n",E);
Re1=59.5/pow(E,8.0/7);
printf(" 第一邊界雷諾數(shù)Re1=%0.2E
4、\n\n",Re1);
Re2=(665-765*log10(E))/E;
printf(" 第二邊界雷諾數(shù)Re2=%0.2E\n\n",Re2);
/*******************************************
***判斷流態(tài),選用對(duì)應(yīng)摩阻計(jì)算公式;
********************************************/
/************如果流態(tài)在層流區(qū)**************/
if(Re<2000)
{ printf(" /***************************
5、********/\n");
printf(" Re<2000 層流區(qū) \n");
printf(" 層流區(qū)水力摩阻系數(shù)lamda=64/Re;\n\n");
lamda=64/Re;
printf(" 水力摩阻系數(shù) lamda=%0.4f\n\n",lamda);
printf(" 選用達(dá)西公式計(jì)算沿程阻力損失hl(m)\n");
hl=(lamda*(L*1000)*(V*V))/(d*2*9.81);
printf(" 沿程阻力損失hl hl=%0.2E\n\n",hl
6、);
printf(" 選用列賓宗公式計(jì)算沿程阻力損失hl(m)\n");
hl=4.15*Qs*v*(L*1000)/pow(d,4);
printf(" 沿程阻力損失hl hl=%0.2E\n\n",hl);
ai=4.15*Qs*v/pow(d,4);
printf(" 水力坡降ai=%0.5f\n\n",ai);
}
/************如果流態(tài)在水力光滑區(qū)**************/
if(3000
7、********************/\n");
printf(" 3000
8、");
hl=(lamda*(L*1000)*(V*V))/(d*2*9.81);
printf(" 沿程阻力損失hl hl=%0.2E\n\n",hl);
printf(" 選用列賓宗公式計(jì)算沿程阻力損失hl(m)\n");
hl=(0.0246*pow(Qs,1.75)*pow(v,0.25)*(L*1000))/pow(d,4.75);
printf(" 沿程阻力損失hl hl=%0.2E\n\n",hl);
ai=0.0246*pow(Qs,1.75)*pow(v,0.25)/pow(d,4.75);
9、 printf(" 水力坡降ai=%f\n\n",ai);
}
else
{lamda=(1/(1.81*log10(Re)-1.53))*(1/(1.81*log10(Re)-1.53));
printf(" 水力摩阻系數(shù) lamda=%0.4f\n\n",lamda);
printf(" 選用達(dá)西公式計(jì)算沿程阻力損失hl(m)\n");
hl=(lamda*(L*1000)*(V*V))/(d*2*9.81);
printf(" 沿程阻力損失hl hl=%0.2E\n\n",hl);
10、printf(" 選用列賓宗公式計(jì)算沿程阻力損失hl(m)\n");
hl=(0.0246*pow(Qs,1.75)*pow(v,0.25)*(L*1000))/pow(d,4.75);
printf(" 沿程阻力損失hl hl=%0.2E\n\n",hl);
ai=0.0246*pow(Qs,1.75)*pow(v,0.25)/pow(d,4.75);
printf(" 水力坡降ai=%f\n\n",ai);
}
}//if(3000
11、擦區(qū)**************/
if(Re1
12、f\n\n",lamda);
printf(" 選用達(dá)西公式計(jì)算沿程阻力損失hl(m)\n");
hl=(lamda*(L*1000)*(V*V))/(d*2*9.81);
printf(" 沿程阻力損失hl hl=%0.2E\n\n",hl);
printf(" 選用列賓宗公式計(jì)算沿程阻力損失hl(m)\n");
A=pow(10,(0.127*log10(E/(d*1000))-0.627));
hl=(0.0802*A*pow(Qs,1.877)*pow(v,0.123)*(L*1000))/pow(d,4.877);
13、
printf(" 沿程阻力損失hl hl=%0.2E\n\n",hl);
ai=0.0802*A*pow(Qs,1.877)*pow(v,0.123)/pow(d,4.877);;
printf(" 水力坡降ai=%f\n\n",ai);
}//if(Re1Re2)
{ printf(" /***********************************/\n");
printf(" Re
14、>Re2 粗糙區(qū) \n");
printf(" 水力摩阻選用lamda=1/pow((1.74-2*log10(E)),2);\n\n");
lamda=1/pow((1.74-2*log10(E)),2);
printf(" 水力摩阻系數(shù) lamda=%0.4f\n\n",lamda);
printf(" 選用達(dá)西公式計(jì)算沿程阻力損失hl(m)\n");
hl=(lamda*(L*1000)*(V*V))/(d*2*9.81);
printf(" 沿程阻力損失hl hl=%0.2E\n\n",h
15、l);
printf(" 選用列賓宗公式計(jì)算沿程阻力損失hl(m)\n");
N=0.11*pow(E/(d*1000),0.25);
hl=(0.0826*N*(Qs*Qs)*(L*1000))/pow(d,5);
printf(" 沿程阻力損失hl hl=%0.2E\n\n",hl);
ai=0.0826*N*Q*Q/pow(d,5);
printf(" 水力坡降ai=%f\n\n",ai);
}
/************管線全線所消耗的壓力能頭**************/
printf(" /**
16、******************************/\n");
printf(" 管線全線所消耗的壓力能頭\n");
printf(" /********************************/\n\n");
H=hl+(Zz-ZQ)+Hsz;
printf(" 末站剩余壓頭Hsz=%0.2f(m)\n\n",Hsz);
printf(" 管線全線所消耗的壓力能頭H=%0.2f(m)\n\n",H);
/***********************************************
***泵站數(shù)量計(jì)算
*
17、***********************************************/
{
printf(" /********************************/\n");
printf(" 所需泵站數(shù)量\n");
printf(" /********************************/\n\n");
Hc=2*(386.43-0.000176*pow(Q,1.75));
printf(" 泵站的揚(yáng)程Hc(m) Hc=%0.2f\n\n",Hc);
H=ai*L*1000+(Zz-ZQ)+Hsz;
18、 printf(" 全線所需壓頭H(m)H=%0.2f\n\n",H);
N=H/(Hc-hm);
printf(" 全線布站個(gè)數(shù)N N=%0.1f\n\n",N);
N=ceil(H/(Hc-hm));
printf(" 向上取整站數(shù)N N=%0.0f\n\n",ceil(H/(Hc-hm)));
}
/***********************************************
***工藝方案經(jīng)濟(jì)計(jì)算,確定最優(yōu)方案
*******************************************
19、*****/
{
double Yguan, Yzhan, Yyun, YY, P;
printf(" /********************************/\n");
printf(" 工藝方案經(jīng)濟(jì)計(jì)算,確定最優(yōu)方案\n");
printf(" /********************************/\n\n");
Yguan=2.4*(7.85*3.14*(D*D-d*d)*L*1000/4)*5603;
printf(" 管線投資費(fèi)用 Yguan=%0.1f(元)\n\n",Yguan);
printf
20、(" 管線投資費(fèi)用 Yguan=%0.3f(億元)\n\n",Yguan/1e8);
Yzhan=1.8*(N*3000e4);
printf(" 站場(chǎng)投資費(fèi)用 Yzhan=%0.1f(元)\n\n",Yzhan);
printf(" 站場(chǎng)投資費(fèi)用 Yzhan=%0.3f(億元)\n\n",Yzhan/1e8);
/****************計(jì)算輸油泵功率*****************/
P=1.1*rowt*Qs*Hc/(102*0.807);
printf(" 輸油泵站功率 P=%0.2E(Kw)\n\n",P);
Yyun=1.0*0.55*N*P*15*350*24;
printf(" 運(yùn)營(yíng)費(fèi)用 Yyun=%0.1f(元)\n\n",Yyun);
printf(" 運(yùn)營(yíng)費(fèi)用 Yyun=%0.3f(億元)\n\n",Yyun/1e8);
YY=Yguan+Yzhan+Yyun;
printf(" 方案總的經(jīng)濟(jì)費(fèi)用YY=%0.1f(元)\n\n",YY);
printf(" 方案總的經(jīng)濟(jì)費(fèi)用YY=%0.3f(億元)\n\n",YY/1e8);
}
}//main()