import javax.swing.*;
public class wetairtest8
{ // adiabatic cooling process
public static void main(String arg[])
{
wetair wa=new wetair();
steam st=new steam();
//1 hot water inlet
double m1=1.0;//  kg/s
double p=1.01325;//  bar
double T1=38.0;// degree C
double a1[]=st.property("tp",T1,p);
double h1=a1[3];
//2 cold water outlet
double T2=30.0;// degree C
double m2=m1;
a1=st.property("tp",T2,p);
double h2=a1[3];
// atmospheric air inlet
double T3=24.0;//  degree C
double rh3=0.4;
double a[]=wa.property("tdb_rh",T3,rh3,p);
double h3=a[8];
double w3=a[5];
// cooling tower air exit
double T4=35.0;//  degree C
double rh4=0.9;
a=wa.property("tdb_rh",T4,rh4,p);
double h4=a[8];
double w4=a[5];
// feed water 
double T5=20.0;// degree C
a1=st.property("tp",T5,p);
double h5=a1[3];
//air mass flow rate
double ma=(m1*h1-m2*h2)/(h4-h3-(w4-w3)*h5);
double m5=ma*(w4-w3);
double Qwater=m1*h1-m2*h2; //kW
double Qair=ma*(h4-h3); //kW
String s="Wet Cooling Tower\n";
s+="Warm water inlet\n";
s+="m1="+m1+" kg/s\n";
s+="T1="+T1+" degree C\n";
s+="h1="+h1+" kJ/kg\n";
s+="Cold water outlet\n";
s+="m2="+m2+" kg/s\n";
s+="T2="+T2+" degree C\n";
s+="h2="+h2+" kJ/kg\n";
s+="Feed water inlet\n";
s+="m5="+m5+" kg/s\n";
s+="T5="+T5+" degree C\n";
s+="h5="+h5+" kJ/kg\n";
s+="Atmospheric air inlet\n";
s+="ma="+ma+" kg/s\n";
s+="T3="+T3+" degree C\n";
s+="h3="+h3+" kJ/kg\n";
s+="w3="+w3+" kJ/kg\n";
s+=""+'\u00D8'+"3="+rh3+" \n";
s+=" air outlet\n";
s+="ma="+ma+" kg/s\n";
s+="T4="+T4+" degree C\n";
s+="h4="+h4+" kJ/kg\n";
s+="w4="+w4+" kJ/kg\n";
s+=""+'\u00D8'+"4="+rh4+" \n";
s+="Qwater = "+Qwater+" kW\n";
s+="Qair = "+Qair+" kW\n";
System.out.println(s);
}
}