Friday, March 16, 2012

Program for Determination of Effective stress/ Pressure at given depth [CSVTU 8th sem Civil, unit-3 Geotech]

/*Determination of Effective stress/ Pressure at given depth */
#include
#include
#define size 30

float thik[size];//Thikness/ height of layers
float gama[size]; //Unit Weight
float dep, pizoHeigh=10, sur=20;//depth, pizometric height, surcharge
//totatl stress, effective stress, total height, total height2
float tot_stress=0, eff_stress, pore_prss, tot_height=0, tot_height2=0;
void main()
{
int num;
clrscr();
cout<<"Entre the Number of Layers:";
cin>>num;
cout<<"Entre the Depth at Which the effective pressure is to be found:";
cin>>dep;
//input lyer height n unit weight
for(int i=1; i<=num; i++)
{
cout<<"\nEntre the Height of Layer(m)"< cin>>thik[i];
cout<<"\nEntre unit weight(KN/m^3):";
cin>>gama[i];
}
//Calculate total Stress

if(dep {
tot_stress = sur + (dep)*gama[1];
}
else if(dep > thik[1])
{ int i=1;
label1:
tot_height2 = tot_height;
tot_height = tot_height + thik[i];

if(dep > tot_height )
{
i++;
goto label1;
}

for(int j=1; j {
tot_stress += (thik[j] * gama[j]);
}
tot_stress += (sur + (dep-tot_height2)* gama[i] ) ;
}

//calculation of effective pressure at given depth
eff_stress = tot_stress - (dep * 9.81);
cout<<"\n The Effective Pressure at Depth " <

getch();

}

No comments:

Post a Comment