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
|
#include <iostream>
#include <cmath>
using namespace std;
float vel (float d,float ss1, float ss2, float w)
{float ac,v,n=0.018,r,dl=8,wpr,b=1.5,bs;
if(d<=4.0)
{ac=w*d;
wpr=(w+(2*d));
}
else if (d<=8.0)
{ac=((w+bs*d)*d);
wpr= (w+ (2*d*sqrt(pow(ss1,2.0/3.0)+1)));
}
else
{ac=(w+ss1*dl)*dl+(w+2*ss1*dl+2*b+ss2*(d-dl))*(d-dl);
wpr=(w+(2*dl*sqrt(1+pow(ss1,2.0))+(2*b)+(2*(d-dl)*sqrt(1+pow(ss2,2.0)))));
}
r=ac/wpr;
v=(1/n)*sqrt(bs)*pow(r,2.0/3.0);
return v;
}
int main ()
{float p,hg,h,d,w,qc,qr,bs,ac,v,wpr,s,r,ss1,ss2,dl,b=1.5,n,x,y,z;
cout<<"Enter Power Potential in MW = ";
cin>>p;
cout <<"Enter Gross Head in meters = ";
cin>>hg;
h=0.9*hg;
qr=(p*1000)/(9.81*0.80*h);
qc=0.0;
d=0.0;
while(qc<qr)
{
d=d+0.005;
w=d;
if (d<=4.0)
{ ac=w*d;
}
else if (d<=8.0)
{ ac=w*(w+ss1*d);
}
else
{ac=(w+ss1*dl)*dl+(w+2*ss1*dl+2*b+ss2*(d-dl)*(d-dl));
}
v=vel(d,ss1,ss2,w);
qc=ac*v;
}
cout<<"depth of the channel is "<<d<<endl;
cout<<"width of the channel is "<<w<<endl;
cout<<"disc harge value is"<<qc<<endl;
}
|