Professional Documents
Culture Documents
CPP
Page 1
#include<iostream.h>
#include<conio.h>
#include<math.h>
#include<stdlib.h>
#include<fstream.h>
#define PI 3.14159265358979
float
float
float
float
float
float
float
float
float
float
float
void main()
{
float v_speed,He,em,ab,T_amb,T_max,lat,dia,pf,uf,kf,kangle,qr,qcn,phi;
float qc,sol_hr,N_day,T_flim,qc_f,I_pc,I_rem,I_rate,T_acsr,dia_acsr;
float qs,T_high,T_low,R_max,I_max,R_low,R_high,R_low_acsr,R_high_acsr;
int count;
cout<<"Enter wind speed (m/s)"<<endl;
cin>>v_speed;
cout<<"Enter Elevation (m)"<<endl;
cin>>He;
cout<<"Enter emissivity"<<endl;
cin>>em;
cout<<"Enter absorptivity"<<endl;
cin>>ab;
cout<<"Enter ambient temperature (Celsius)"<<endl;
cin>>T_amb;
cout<<"Enter latitude"<<endl;
cin>>lat;
cout<<"Enter conductor diameter (mm)"<<endl;
cin>>dia;
cout<<"Enter the angle between the wind direction and the conductor axis"<<endl;
cin>>phi;
cout<<"Enter the day number"<<endl;
cin>>N_day;
cout<<"Enter the solar hour (24hr format)"<<endl;
cin>>sol_hr;
cout<<"Enter the low temperature"<<endl;
cin>>T_low;
cout<<"Enter the high temperature"<<endl;
cin>>T_high;
cout<<"Enter the resistance at low temp (ohm/mile)"<<endl;
cin>>R_low;
cout<<"Enter the resistance at high temp (ohm/mile)"<<endl;
cin>>R_high;
cout<<"Enter the resistance at low temp (ohm/mile) for equivalent ACSR"<<endl;
cin>>R_low_acsr;
cout<<"Enter the resistance at high temp (ohm/mile) for equivalent ACSR"<<endl;
cin>>R_high_acsr;
cout<<"Enter the diameter of equivalent ACSR"<<endl;
cin>>dia_acsr;
cout<<"Enter ACSR thermal rating"<<endl;
cin>>T_acsr;
ofstream out("accclap1");
if(!out)
{
cout<<"Cannot open file"<<endl;
}
T_max = T_acsr;
count = 0;
TEMPVSCU.CPP
do
{
T_flim = (T_max+T_amb)/2;
pf = air_density(T_amb,T_max,He);
uf = dynamic_viscosity(T_flim);
kf = thermal_cond(T_flim);
kangle = wind_direction(phi);
if(count == 0)
{
qcn = natural_convection(T_amb,T_max,pf,dia_acsr);
qc_f = forced_convc(dia_acsr,pf,v_speed,uf,kf,kangle,T_max,T_amb);
qr = rad_heat(dia_acsr,em,T_max,T_amb);
qs = sol_heat_gain(dia_acsr,N_day,sol_hr,lat,He,ab);
R_max = cond_resist(R_high_acsr,R_low_acsr,T_high,T_low,T_max);
}
else
{
qcn = natural_convection(T_amb,T_max,pf,dia);
qc_f = forced_convc(dia,pf,v_speed,uf,kf,kangle,T_max,T_amb);
qr = rad_heat(dia,em,T_max,T_amb);
qs = sol_heat_gain(dia,N_day,sol_hr,lat,He,ab);
R_max = cond_resist(R_high,R_low,T_high,T_low,T_max);
}
qc = select_lfc(qc_f,qcn);
I_max = steady_current(qc,qr,qs,R_max);
if(count == 0)
{
I_rem = I_max-10;
while (I_rem>10)
I_rem = I_rem-10;
I_rate = 10-I_rem+I_max;
cout<<"The current rating of ACSR under given conditions "<<I_rate<<" A"<<endl;
cout<<"Press any key to continue"<<endl;
out<<"Base current is "<<I_rate<<" (rating of ACSR)"<<endl;
out<<"Current (%)
Temperature (C)"<<endl;
T_max = T_amb;
I_pc = 0;
}
else
{
I_pc = (I_max/I_rate)*100;
out<<I_pc<<"
"<<T_max<<endl;
T_max+=0.1;
}
count = 1;
}while (T_max>=T_amb && I_pc<=300);
out.close();
getch();
}
Page 2
TEMPVSCU.CPP
Page 3
TEMPVSCU.CPP
Page 4