求大神看下,为什么输入任何数都输出通一个数?
#include<stdio.h>#include<math.h>
void main()
{
double hf,$f,s,Re,Pr,x,aD,CF,CI,Pv,P,pf,Cpf,m,ti0,
gf,gl,uf,CF0,Pvf,tf,Pf,Cmf,gc,Cmi,of,f0,vf,Ref,
dep,f,Ti,tm,tw,pl,Vl,M0,M,g,e,r,$l,ti,gl0,V,w;
g=9.8;e=2.71828182846,s=0.0026,$f=0.0319,pf=0.95,Cpf=1.068,uf=3,ti0=50,tf=100,gc=0.0006,vf=0.000000208,tw=50,Pr=0.7,w=1;
printf("输入Re,x,CF0,gl0=:");
scanf("%f,%f,%f,%f",&Re,&x,&CF0,&gl0);
ti=tw+0.4;
gl=0;
tm=(tw+ti0)/2;
$l=0.0011*tm+0.593;
r=-2430*ti0+2504200;
pl=0.5*tm+1013.1;
Vl=-0.0000000078*tm+0.000000946;
hf=((((pow(((s/x)*Pr*Re),1.14))*0.0156)/((pow(((s/x)*Re),0.64)*pow(Pr,0.47))*0.058+1))+3.78)*$f/s;
Pvf=758.5*tf-25590;
Pf=pf*313*(273+tf);
Cmf=Pvf/Pf;
Pv=758.5*ti0-25590;
P=3500000;
CI=Pv/P;
Cmi=CI;
V=((pf*Cpf)/hf)*log((1-Cmi)/(1-Cmf));
dep=2*(s-2*gl0);
Ref=(uf*dep)/vf;
f0=0.046*(pow(Ref,-0.2));
of=(2*V)/(f0*uf);
f=((of*(pow(e,of)))/((pow(e,of))-1))*f0 ;
Ti=f*pf*uf*uf/2;
M0=((2*Ti/(s-2*gl0)-pl*g)*gl0*gl0*gl0)/(3*Vl)+(Ti*gl0*gl0)/(2*Vl);
x=x+0.001;
tm=(tw+ti)/2;
$f=0.0011*tm+0.593;
r=-2430*ti+2504200;
pl=0.5*tm+1013.1;
Vl=-0.0000000078*tm+0.000000946;
hf=((((pow(((s/x)*Pr*Re),1.14))*0.0156)/((pow(((s/x)*Re),0.64)*pow(Pr,0.47))*0.058+1))+3.78)*$f/s;
aD=hf/(pf*Cpf);
Pv=758.5*ti-25590;
P=350000;
CI=Pv/P;
gf=$f/hf;
do
{
gl=gl+0.0000001;
CF=(((s/2-gl-gf)*uf)*CF0+aD*CI)/(((s/2-gl-gf)*uf)+aD);
m=aD*(CF-CI);
Pvf=758.5*tf-25590;
Pf=pf*313*(273+tf);
Cmf=Pvf/Pf;
Cmi=CI;
V=((pf*Cpf)/hf)*log((1-Cmi)/(1-Cmf));
dep=2*(s-2*gl);
Ref=(uf*dep)/vf;
f0=0.046*(pow(Ref,-0.2)) ;
of=(2*V)/(f0*uf);
f=((of*(pow(e,of)))/((pow(e,of))-1))*f0 ;
Ti=f*pf*uf*uf/2;
M=((2*Ti/(s-2*gl)-pl*g)*gl*gl*gl)/(3*Vl)+(Ti*gl*gl)/(2*Vl);
w=M-m-M0;
}while(w>=0.00001);
printf("gl=%.8f\n",gl);
}