📄 dam.cpp.bak
字号:
#include<iostream.h>
#include<math.h>
#define PI 3.1415926
double get_h(double shehong,double jiaohong,double v,double vmax, double d)
{
double bagao1,bagao2,hi1,hi2,bagao;//bagao是坝顶高程
double hl1,h01,hl2,h02,ll1,ll2;//v是相应洪水期多年平均最大风速,d是库面的波浪吹程,vmax是最大风速
hl1=0.0166*pow(vmax,1.25)*pow(d,1.0/3);
ll1=10.4*pow(hl1,0.8);
h01=PI*hl1*hl1/ll1;
hl2=0.0166*pow(v,1.25)*pow(d,1.0/3);
ll2=10.4*pow(hl2,0.8);
h02=PI*hl2*hl2/ll2;
hi1=hl1+h01+0.7;
hi2=hl2+h02+0.5;
bagao1=shehong+hi1;
bagao2=jiaohong+hi2;
bagao=bagao1;
if(bagao1<bagao2)
{bagao=bagao2;}
return(bagao);
}
double get_p(double h1,double h2)//水平推力
{
double p_water,p_sad=0;
p_water=(h1+h2)*(h1-h2)*9.8/2;//水的推力
p_sad=30*30*0.86*pow(tan((45-13/2)*PI/180),2)*9.8/2;//沙的推力
return p_water+p_sad;
}
double get_g(double h,double d,double m,double n,double x,double h1,double h2)//垂直压力
{
double g_self,g_water,g_sad=0;
g_self=(h*h*m+d*d/m+x*x*n)*12;//坝身自重
g_water=(h2*h2*m/2+(h-x+h)*n*x/2)*9.8;//水的压力
if(x>=30)//沙的压力
{
g_sad=30*30*n*0.86*9.8/2;
}
else
{
g_sad=(30-x+30)*(x*n)*0.86*9.8/2;
}
return g_self+g_water+g_sad;
}
double get_u(double h,double h1,double h2,double m,double n,double x,double y1,double y2,double a1,double a2)//扬压力
{
return ((m*h+n*x)*h2*9.8+(h1-h2)*(1+a1)*y1*9.8/2+(a1+a2)*(h1-h2)*(y2-y1)*9.8/2+a2*(h1-h2)*(m*h+n*x-y2)*9.8/2);
}
void main()
{
double m,n;
double h1,h2;
double x,y1,y2;
double a1,a2;
double H,P,U,G;
char next='y';
while(next=='y')
{
cout<<"请输入\n坝前水深h1:";
cin>>h1;
cout<<"坝后水深h2:";
cin>>h2;
H=get_h(82.4,84.5,9,20.8,7.2);
P=get_p(h1,h2);
cout<<"上游坡度n:";
cin>>n;
cout<<"下游坡度m:";
cin>>m;
cout<<"上游坡的位置x:";
cin>>x;
cout<<"帷幕排水位置y1:";
cin>>y1;
cout<<"帷幕排水位置y2:";
cin>>y2;
cout<<"扬压力折减系数a1:";
cin>>a1;
cout<<"扬压力折减系数a2:";
cin>>a2;
G=get_g(H,H*0.09,m,n,x,h1,h2);
U=get_u(H,h1,h2,m,n,x,y1,y2,a1,a2);
cout<<"==================================================="<<endl;
cout<<"水平推力 P:"<<P<<endl;
cout<<"垂向压力 W:"<<G<<endl;
cout<<"扬压力 U:"<<U<<endl;
cout<<"坝底面积 A:"<<n*x+m*H<<endl;
cout<<"抗剪稳定系数:"<<0.64*(G-U)/P<<endl;
cout<<"抗剪断稳定系数:"<<(1.10*(G-U)+9.8*8*10*(x*n+m*H))/P<<endl;
cout<<"是否继续?(y/n):";
cin>>next;
}
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -