import javax.swing.*;
public class wetairtest6
{ // cooling-demoisturizing and adiabatic mixing process
public static void main(String arg[])
{
wetair wa=new wetair();
double m1=1.0;//  kg/s
double m2=0.5;//  kg/s
double m3=m1+m2; //kg/s
double p=1.01325;//  bar
double t1=35.0;//  degree C
double rh1=0.5;
double t3=10.0;//  degree C
double rh3=1.0;
double a[]=wa.property("tdb_rh",t1,rh1,p);
double h1=a[8];
double w1=a[5];
double twb1=a[14];
//point 2
double w2=w1;
double rh2=1.0;
a=wa.property("w_rh",w2,rh2,p);
double t2=a[1];
double h2=a[8];
double twb2=a[14];
//point 4
a=wa.property("tdb_rh",t3,rh3,p);
double h3=a[8];
double w3=a[5];
double twb3=a[14];

double w4=(m1*w1+m2*w3)/m3;
double h4=(m1*h1+m2*h3)/m3;
a=wa.property("w_h",w4,h4,p);
double t4=a[1];
double rh4=a[6];
double twb4=a[14];
double Qcooling=m1*(h1-h3);
String s="m1="+m1+" kg/s\n";
s+="m2="+m2+" kg/s\n";
s+="m3="+m3+" kg/s\n";
s+="T1="+t1+" degree C h1="+h1+" kJ/kg  "+'\u00D8'+"1 ="+rh1*100+" % w1 = "+w1+" twb1 = "+twb1+" degree C\n";
s+="T2="+t2+" degree C h2="+h2+" kJ/kg  "+'\u00D8'+"2 ="+rh2*100+" % w2 = "+w2+" twb2 = "+twb2+" degree C\n";
s+="T3="+t3+" degree C h3="+h3+" kJ/kg  "+'\u00D8'+"3 ="+rh3*100+" % w3 = "+w3+" twb3 = "+twb3+" degree C\n";
s+="T4="+t4+" degree C h4="+h4+" kJ/kg  "+'\u00D8'+"4 ="+rh4*100+" % w4 = "+w4+" twb3 = "+twb4+" degree C\n";
s+="Qcooling = "+Qcooling+" kW\n";
JOptionPane.showMessageDialog(null,s);
}
}