public class packed_bed
{
moist_air ma;
yashava yh;
Gas1 a;
steam s;
double[][] xArr;
double[][] yArr;
double[][] TArr;

  //options for string s: "tdb_twb"  kuru termometre - yaş termometre sıcaklığı
  //                      "tdb_rh"   kuru termometre sıcaklığı - bağıl nem
  //                      "tdb_w"    kuru termometre sıcaklığı - özgül nem
  //                      "tdb_tdew" kuru termometre sıcaklığı - çiğ noktası sıcaklığı
  //                      "tdb_pv"   kuru termometre sıcaklığı - su buharı basıncı
  //                      "tdb_dos"  kuru termometre sıcaklığı - degree of saturation
  //                      "tdb_h"    kuru termometre sıcaklığı - entalpi
  //                      "tdb_s"    kuru termometre sıcaklığı - entropi
  //                      "w_rh"     özgül nem    - bağıl humifdity
  //                      "w_h"      özgül nem    -  entalpi
  /*
  aa[0]=P;
  aa[1]=t;
  aa[2]=ap[2];
  aa[3]=pv;
  aa[4]=Pa;
  aa[5]=w;
  aa[6]=rh;
  aa[7]=dos;
  aa[8]=h;
  aa[9]=s;
  aa[10]=tdp;
  aa[11]=ha;
  aa[12]=hv;
  aa[13]=w*hv;
  */
double P;
double Mx,My;//mesh size  
public packed_bed(double Pi)
{
P=Pi;
yh=new yashava();
s=new steam();
ma=new moist_air();
a=new Gas1("air");
Mx=0.015;
}
public static double F(double width,double Do,double Ul,double k,double delta)
{//6.5.12
//F=fin efficiency factor
//Do=tube outer diameter	
//W=distance between tubes	
//Ul=heat loss coeff
//k=heat conduction 
//delta=sheet thickness	
double m=Math.sqrt(Ul/(k*delta));
double F1=Math.tanh(m*(width-Do)/2)/(m*(width-Do)/2);	
return F1;		
}
public static double Fdot(double h,double Ul, double Tave,double sigma, double eps1,double eps2)
{
//collector efficiency factor
double hr=(4.0*sigma*Math.pow(Tave,3.0))/((1.0/eps1)+(1.0/eps2)-1.0);
double AA=h+(1.0/((1.0/h)+(1.0/hr)));
double fdot1=1.0+(Ul/AA);
return 1.0/fdot1;
}
public static double FR(double h,double Ul, double Tave,double sigma, double eps1,double eps2,double Cp,double Ac,double k,double delta)
{
// FR heat removal factor	
// m=mass flow rate of refrigerant;
// heat removal factor=FR	
// Ac=area of collector
//double m=Math.sqrt(Ul/(k*delta));
//rho=density of refrigerant;
//v=velocity of refrigerant;
//double rho=1.2;//kg/s
moist_air ma=new moist_air();
double ttt=80.0;//C
double www=6.885E-3;//kg su buharı/kg kuru hava
double rho=ma.ro_moistw(ttt,www);// in kg/m3
Cp=ma.Cp_moistw(ttt,www);//Kj/kg*K
double v=0.2;//m/s
double m=rho*Ac*v;//kg/s
//double m=0.056;//kg/s
double Fd=Fdot(h,Ul,Tave,sigma, eps1,eps2);
double AA=(m*Cp)/(Ac*Ul)*Fd;
double BB=AA*(1-Math.exp(-1.0/AA));
return BB*Fd;	
}
public static double Qu(double I, double Ul,double toalfa, double Tamb, double Ti, double Ac,double Cp, double T0,double k,double delta,double eps1,double eps2,double h,double sigma,double Tave)
{
moist_air ma=new moist_air();
double ttt=80.0;//C
double www=6.885E-3;//kg su buharı/kg kuru hava
double rho=ma.ro_moistw(ttt,www);// in kg/m3
Cp=ma.Cp_moistw(ttt,www);//Kj/kg*K
double fr=FR(h,Ul,Tave, sigma, eps1,eps2, Cp, Ac, k,delta);
double m=Ac*(I*fr*(toalfa)-(fr*Ul*(Ti-Tamb)))/(Cp*(T0-Ti));//kg/s
return Ac*(I*fr*(toalfa)-(fr*Ul*(Ti-Tamb)));
}
public double temperature_distribution(double h,double Tbm, double Vb, double Ul,double Tave,double sigma,double eps1, double eps2,double k, double delta,double I,double toalfa,double Ti, double T0,double Tamb,double tai,double tbi, double Cp,double deltax,double N,double A,double deltaA, double L, double deltat,double ros,double eps,double Cps,double U,double Ac,double De,boolean plot)
{
//tbi air temperature at inlet to bed(C)
//tai mean temperature of bed (C) 
double P;
P=1.0;//atm
double p00,p10,p20,p01;
moist_air ma=new moist_air();
double ttt=80.0;//C
double www=6.885E-3;//kg su buharı/kg kuru hava
double rho=ma.ro_moistw(ttt,www);// in kg/m3
Cp=ma.Cp_moistw(ttt,www);//Kj/kg*K
double v=0.2;// m/s
double fr=FR(h,Ul,Tave, sigma, eps1,eps2, Cp, Ac, k,delta);
double m=Ac*(I*fr*(toalfa)-(fr*Ul*(Ti-Tamb)))/(Cp*(T0-Ti));//kg/s
double G=rho*v;
double hvs=650.0*Math.pow((G/De),0.7); // W/m^3K
double NTU=(hvs*A*L)/(N*m*Cp);
double fi1=Math.exp(-NTU);
double fi2=(m*Cp*N)/(ros*A*L*(1-eps)*Cps);
double fi3=((U*deltaA)/(m*Cp))*fi2;
double Tavg=0;
double Ta[][]=new double[24][24];
double Tb[][]=new double[24][24];
double Tb_t[][]=new double[24][24];
double [] propd=yh.property("tdb_rh",tai,1.0,P);
double rh=propd[6];
int k1,m1,n,klast;
klast=0; 
for(n=0;n<23;n++)
{Ta[0][n]=tbi;}
//face at top
for(m1=0;m1<23;m1++)
{Tb[m1][0]=tai;Tb_t[m1][0]=tbi;}
//System.out.println("tb="+tbi);
// face at top
for(m1=1;m1<23;m1++)
{Ta[m1][0]=Tb[m1-1][0]+fi1*(Ta[m1-1][0]-Tb[m1-1][0]);
System.out.println("Ta["+m1+"][0] ="+Ta[m1][0]);
}	
for(n=1;n<23;n++)
{
double[]prop=yh.property("tdb_rh",Tb[0][n],rh,P);			
//initial guess
p00 = Tb[0][n-1]+(fi2*(Ta[0][n-1]-Ta[0][n])-fi3*(Tb[0][n-1]-Tamb))*deltat;
//first guess
p10 = Tb[0][n-1]+(fi2*(Ta[0][n-1]-Ta[0][n])-fi3*(Tb[0][n-1]-Tamb))*deltat;
//aitken interpolation correection step
p20= Tb[0][n-1]+(fi2*(Ta[0][n-1]-Ta[0][n])-fi3*(Tb[0][n-1]-Tamb))*deltat;
p01 = p00 -(p10 - p00)*(p10 - p00)/( p20 - 2* p10 + p00);
Tb[0][n]=Tb[0][n-1]+(fi2*(Ta[0][n-1]-Ta[0][n])-fi3*(Tb[0][n-1]-Tamb))*deltat;
System.out.println("Tb[0]["+n+"] ="+Tb[0][n]);
}
for(k1=1;k1<23;k1++)
{	
for(m1=1;m1<=k1;m1++)
{
Ta[m1][k1]=Tb[m1-1][k1]+fi1*(Ta[m1-1][k1]-Tb[m1-1][k1]);
Tb[m1][k1]=Tb[m1][k1]+(fi2*(Ta[m1][k1-1]-Ta[m1][k1])-fi3*(Tb[m1][k1-1]-Tamb))*deltat;
p00=Tb[m1][k1-1]+(fi2*(Ta[m1][k1-1]-Ta[m1][k1])-fi3*(Tb[m1][k1-1]-Tamb))*deltat;
Ta[m1][k1]=Tb[m1-1][k1]+fi1*(Ta[m1-1][k1]-Tb[m1-1][k1]);
p10=Tb[m1][k1]+(fi2*(Ta[m1][k1-1]-Ta[m1][k1])-fi3*(Tb[m1][k1-1]-Tamb))*deltat;
Ta[m1][k1]=Tb[m1-1][k1]+fi1*(Ta[m1-1][k1]-Tb[m1-1][k1]);
p20=Tb[m1][k1-1]+(fi2*(Ta[m1][k1-1]-Ta[m1][k1])-fi3*(Tb[m1][k1-1]-Tamb))*deltat;	
p01 = p00-((p10 - p00)*(p10 - p00))/( p20 - 2* p10 + p00);	
Ta[m1][k1]=Tb[m1-1][k1]+fi1*(Ta[m1-1][k1]-Tb[m1-1][k1]);
Tb[m1][k1]=Tb[m1][k1-1]+(fi2*(Ta[m1][k1-1]-Ta[m1][k1])-fi3*(Tb[m1][k1-1]-Tamb))*deltat;
System.out.println("m1="+m1+"k1="+k1+"Tb["+m1+"]["+k1+"] ="+Tb[m1][k1]);
}	
for(n=1;n<=k1;n++)
{
Ta[k1][n]=Tb[k1-1][n]+fi1*(Ta[k1-1][n]-Tb[k1-1][n]);
p00=Tb[k1][n-1]+(fi2*(Ta[k1][n-1]-Ta[k1][n])-fi3*(Tb[k1][n-1]-Tamb))*deltat;	
Ta[k1][n]=Tb[k1][n-1]+fi1*(Ta[k1][n-1]-Tb[k1][n-1]);
p10=Tb[k1][n]+(fi2*(Ta[k1][n-1]-Ta[k1][n])-fi3*(Tb[k1][n-1]-Tamb))*deltat;	
Ta[k1][n+1]=Tb[k1][n]+fi1*(Ta[k1][n]-Tb[k1][n]);
p20=Tb[k1][n-1]+(fi2*(Ta[k1][n-1]-Ta[k1][n])-fi3*(Tb[k1][n-1]-Tamb))*deltat;	
p01 = p00-((p10 - p00)*(p10 - p00))/( p20 - 2* p10 + p00);	
Ta[k1][n]=Tb[k1][n-1]+fi1*(Ta[k1][n-1]-Tb[k1][n-1]);
Tb[k1][n]=Tb[k1][n-1]+(fi2*(Ta[k1][n-1]-Ta[k1][n])-fi3*(Tb[k1][n-1]-Tamb))*deltat;
System.out.println("k1="+k1+"n="+n+"Tb["+k1+"]["+n+"] ="+Tb[k1][n]);
}
Tavg=0;
for(int a=0;a<=k1;a++)
{Tavg+=Tb[a][k1];}
Tavg/=(k1+1);
System.out.println("k1="+k1+"Tavg="+Tavg);
if(Tavg<=T0) {klast=k1;break;}
}
System.out.println("Tavg = "+Tavg);
double T[][]=new double[klast][klast];
for(int i=0;i<klast;i++)
{for(int j=0;j<klast;j++)
{T[klast-1-i][klast-1-j]=Tb[j][i];
System.out.print(Tb[j][i]+" ");
}
System.out.println("");
}
double Q_thermal_energy=0;
for (int b=0;b<23;b++)
{Q_thermal_energy+=ros*Cps*(1.0-eps)*(A*L/N)*(Tb[0][b]-tbi)/1000.0;
/*double toplam=0;
toplam=toplam+Tb[0][b];
Q_thermal_energy+=ros*Cps*(1.0-eps)*(A*L/N)*(toplam-(N*tbi))/1000.0;*/
System.out.println("b="+b+"Tb[0][b]="+Tb[0][b]+"tbi="+tbi+ "Q_thermal_energy="+Q_thermal_energy+" kj ");
}
double Q_available_energy=0;
double carpım=1.0;
for(int i=0;i<23;i++)
{carpım=carpım*Tb[i][0];
Q_available_energy+=ros*Cps*(1.0-eps)*Vb*((Tbm-tbi)-(tbi/N)*Math.log(carpım/Math.pow(tbi,N)))/1000.0;
System.out.println("i="+i+"Tb[i][0]="+Tb[i][0]+"Q_available_energy="+Q_available_energy+" kj ");
}
return Q_thermal_energy;
}
public static double m_element_Tai(double tai,double tbi,double Ti,double h,double Tave,double sigma,double eps1,double eps2,double k,double delta,double I,double Tamb,double T0, double toalfa, double Ul,double hv, double Cp,double deltax,double N,double A,double deltaA, double L, double deltat,double ros,double eps,double Cps,double U,double Ac)
{
moist_air ma=new moist_air();
double ttt=80.0;//C
double www=6.885E-3;//kg su buharı/kg kuru hava
double rho=ma.ro_moistw(ttt,www);// in kg/m3
Cp=ma.Cp_moistw(ttt,www);//Kj/kg*K
double fr=FR(h,Ul,Tave, sigma, eps1,eps2, Cp, Ac, k,delta);
double m=Ac*(I*fr*(toalfa)-(fr*Ul*(Ti-Tamb)))/(Cp*(T0-Ti));
double NTU=(hv*A*L)/(N*m*Cp);
double fi1=Math.exp(-NTU);
double fi2=(m*Cp*N)/(ros*A*L*(1-eps)*Cps);
double fi3=((U*deltaA)/(m*Cp))*fi2;
double Tavg=0;
double Tai_1=0;
double Tbi_t=0;
Tai_1+=tbi+fi1*(tai-tbi);
return Tai_1;
}
public static double m_element_Tbi(double Tamb,double tai,double I,double tbi,double h,double Ti, double Tave,double sigma,double eps1,double eps2,double k,double delta,double Ul,double toalfa,double T0,double hv, double Cp,double deltax,double N,double A,double deltaA, double L, double deltat,double ros,double eps,double Cps,double U,double Ac)
{
moist_air ma=new moist_air();
double ttt=80.0;//C
double www=6.885E-3;//kg su buharı/kg kuru hava
double rho=ma.ro_moistw(ttt,www);// in kg/m3
Cp=ma.Cp_moistw(ttt,www);//Kj/kg*K
double fr=FR(h,Ul,Tave, sigma, eps1,eps2, Cp, Ac, k,delta);
double m=Ac*(I*fr*(toalfa)-(fr*Ul*(Ti-Tamb)))/(Cp*(T0-Ti));
double fi2=(m*Cp*N)/(ros*A*L*(1-eps)*Cps);
double fi3=((U*deltaA)/(m*Cp))*fi2;
double Tavg=0;
double Tbi_t=0;
double Tai=m_element_Tai(tai,tbi,Ti,h,Tave,sigma,eps1,eps2,k,delta,I,Tamb,T0,toalfa,Ul,hv,Cp,deltax,N,A,deltaA,L,deltat,ros,eps,Cps,U,Ac);
Tbi_t+=tbi+deltat*(fi2*(tai-Tai)-fi3*(tbi-Tamb));
return Tbi_t;
}
public static double Q (double h,double Ul,double Tave,double sigma,double eps1,double eps2,double k,double delta,double I,double Ti,double T0,double Tamb,double toalfa, double Cps,double Cp, double eps, double A,double Ac, double L, double Vb, double Tbm,double Tbi,double ros)
{
double Q_1=0;
moist_air ma=new moist_air();
double ttt=80.0;//C
double www=6.885E-3;//kg su buharı/kg kuru hava
double rho=ma.ro_moistw(ttt,www);// in kg/m3
Cp=ma.Cp_moistw(ttt,www);//Kj/kg*K
double fr=FR(h,Ul,Tave, sigma, eps1,eps2, Cp, Ac, k,delta);
double m=Ac*(I*fr*(toalfa)-(fr*Ul*(Ti-Tamb)))/(Cp*(T0-Ti));
/*int N=12;
double Tnm[]=new double[N];
for(int n=0;n<N-1;n++)
{Q_1+=ros*Cps*(1.0-eps)*(A*L/N)*(Tnm[n]-N*Tbi)/1000;}*/
Q_1+=ros*Cps*(1.0-eps)*Vb*(Tbm-Tbi)/1000;
return Q_1;
}
public static double Qa(double h, double Ul, double Tave,double sigma,double eps1,double eps2,double k,double delta,double I,double toalfa,double Ti,double T0,double Tamb, double Cps,double Cp, double eps, double A,double Ac, double L, double Vb, double Tbm,double Tbi,double ros)
{
double Qa_1=0;
moist_air ma=new moist_air();
double ttt=80.0;//C
double www=6.885E-3;//kg su buharı/kg kuru hava
double rho=ma.ro_moistw(ttt,www);// in kg/m3
Cp=ma.Cp_moistw(ttt,www);//Kj/kg*K
double fr=FR(h,Ul,Tave, sigma, eps1,eps2, Cp, Ac, k,delta);
double m=Ac*(I*fr*(toalfa)-(fr*Ul*(Ti-Tamb)))/(Cp*(T0-Ti));
/*int N=12;
double carpım=1.0;
double Tmm[]=new double[N];
for(int i=0;i<N;i++)
{carpım=carpım*Tmm[i];
Qa_1+=ros*Cps*(1.0-eps)*(A*L/N)*((Tmm[i]-N*Tbi)-Tbi*Math.log(carpım/Math.pow(Tbi,N)))/1000;}*/
Qa_1+=ros*Cps*(1.0-eps)*Vb*(Tbm-Tbi)/1000;
return Qa_1;
}
public static double pressure_drop(double h,double Ul,double Tave,double sigma,double eps1,double eps2,double k,double delta,double I,double toalfa,double Ti,double T0,double Tamb, double mu,double sp,double eps,double De,double Ac,double Cp)
{
moist_air ma=new moist_air();
double ttt=80.0;//C
double www=6.885E-3;//kg su buharı/kg kuru hava
double v=0.2; // m/s
double rho=ma.ro_moistw(ttt,www);// in kg/m3
Cp=ma.Cp_moistw(ttt,www);//Kj/kg*K
double fr=FR(h,Ul,Tave, sigma, eps1,eps2, Cp, Ac, k,delta);
double m=Ac*(I*fr*(toalfa)-(fr*Ul*(Ti-Tamb)))/(Cp*(T0-Ti));//kg/s
double G=v*rho;	
double Re=G*De/mu;
double Nu=0.437*Math.pow(Re,0.75)*Math.pow(sp,3.35)*Math.pow(eps,-1.62)*Math.exp(29.03*(Math.log(sp)*Math.log(sp)));
double hv=Nu*k/(De*De);
double f=0;
f+=4.466*(Math.pow(Re,-0.2))*(Math.pow(sp,0.696))*(Math.pow(eps,-2.945))*Math.exp(11.85*(Math.log(sp)*Math.log(sp)));
double deltaP=f*G*G/rho*De;
return deltaP;
}
public static double fan_power(double h,double Ul,double Tave,double sigma,double eps1,double eps2,double k,double delta,double I,double toalfa,double Ti,double T0,double Tamb, double Ac,double Cp,double tch,double mu,double sp,double eps,double De)
{
moist_air ma=new moist_air();
double ttt=80.0;//C
double www=6.885E-3;//kg su buharı/kg kuru hava
double v=0.2; // m/s
double rho=ma.ro_moistw(ttt,www);// in kg/m3
Cp=ma.Cp_moistw(ttt,www);//Kj/kg*K
double fr=FR(h,Ul,Tave, sigma, eps1,eps2, Cp, Ac, k,delta);
double m=Ac*(I*fr*(toalfa)-(fr*Ul*(Ti-Tamb)))/(Cp*(T0-Ti));//kg/s
double P_delta=pressure_drop(h,Ul,Tave,sigma,eps1,eps2,k,delta,I,toalfa,Ti,T0,Tamb,mu,sp,eps,De,Ac,Cp);
double w=m*P_delta*tch/rho;
return w;
}
public static double efficiency(double I, double Ul,double toalfa, double Tamb, double Ti, double Ac,double Cp, double T0,double k,double delta,double eps1,double eps2,double h,double sigma,double Tave)
{
double Qu1=Qu(I,Ul,toalfa,Tamb,Ti,Ac,Cp,T0,k,delta,eps1,eps2,h,sigma,Tave);
double eff=(Qu1/(Ac*I))*100;
return eff;
}
static void properties_moist_air(double ttt,double www)
{
moist_air ma=new moist_air();	

double hhh=ma.enthalpy_moistw(ttt,www); //in kj/kg
double cpp=ma.Cp_moistw(ttt,www);//in j/kg
double rho=ma.ro_moistw(ttt,www);// in kg/m3
double kkk=ma.k_moistw(ttt,www);//in W/m*K
double mu1[]=ma.vis_moistw(ttt,www);//in kg/s*m
System.out.println("******************************************************************");  
System.out.println(ttt+" C ve "+www+" kg nemli hava/kg havada "+"nemli hava entalpisi = "+hhh+" kj/kg");
System.out.println(ttt+" C ve "+www+" kg nemli hava/kg havada "+"nemli hava özgül ısı = "+cpp+" j/kgK");
System.out.println(ttt+" C ve "+www+" kg nemli hava/kg havada "+"nemli havanın yoğunluğu = "+rho+" kg/m3");
System.out.println(ttt+" C ve "+www+" kg nemli hava/kg havada "+"nemli hava ısı iletim katsayısı = "+kkk+" W/m*K");
}
public static void main(String args[])
       {    
	       moist_air ma =new moist_air();
	       double enlem=40; // in degree
	       boolean b1=false;
	       boolean b2=false;
	       double absorbptance_of_plate=0.82;//absorblama katsayısı
	       double incline_angle=0;//in degree
	       double surf_azimuth=45;//in degree
	       boolean b11=false;
	       boolean b12=false;
	       double diff_reflect=0.6;
	       double saatfarkı=0.5;
           double width=1.0;//m
           double L=2.0;//m
           double Do=0.020;//m
           double De=0.080;//m
           double Ul=4.2;//W/m2K
           double Cb=35.0;//W/mK
           double ks=1.73;//W/mK
           double Cps=835.0;//j/kgK
           double ros=1920.0;//kg/m^3
           double eps=0.45;
           double sp=0.55;
           double toalfa=0.82;
           double mu=2.0729E-5;//kg/s*m
           double deltat=900.0;//second
           double deltax=0.168;//m
           double Tamb=25.0;//C
           double tbi=25.0;//C
           double tai=40.0;//C
           double N=12.0;
           double Vb=2.0;//m^3	      
	       double hfi=300;//W/m2K
	       double eps1=0.95;
	       double eps2=0.95;
	       double hv=1284.99;//W/m^3K
	       double Ti=25.0;//C
	       double T0=80.0;//C
	       double A=2.0;//m^2
	       double U=20.767;//W/m^2K
	       double deltaA=0.168;//m^2
	       double Tbm=45.0;//C
	       double Tbi=25.0;//C
	       double Tave=40+273.15;//K
	       double sigma=5.67E-08;
	       double h=59.9;//W/m2K
	       double Tfi=70+273.15;//K
	       double ttt=80.0;//C
	       double www=6.885E-3;//kg su buharı/kg kuru hava
	       double Cp=ma.Cp_moistw(ttt,www);
	       double k=ma.Cp_moistw(ttt,www);
           double delta=0.5e-3;
           double A1=0.01;//m2 Air Channel Depth*wide
           double tch=28800.0;//second
           double Ac=4.0;//m2
           double Ta=20+273.15;//K
	       double I=500.0;//W/m2
           double qu=Qu(I,Ul,toalfa,Tamb,Ti,Ac,Cp,T0,k,delta,eps1,eps2,h,sigma,Tave);
	       double Tai_m=m_element_Tai(tai,tbi,Ti,h,Tave,sigma,eps1,eps2,k,delta,I,Tamb,T0,toalfa,Ul,hv,Cp,deltax,N,A,deltaA,L,deltat,ros,eps,Cps,U,Ac);
           double Tbi_m=m_element_Tbi(Tamb,tai,I,tbi,h,Ti,Tave,sigma,eps1,eps2,k,delta,Ul,toalfa,T0,hv,Cp,deltax,N,A,deltaA,L,deltat,ros,eps,Cps,U,Ac);  
	       double q= Q(h,Ul,Tave,sigma,eps1,eps2,k,delta,I,Ti,T0,Tamb,toalfa,Cps,Cp,eps,A,Ac,L,Vb,Tbm,Tbi,ros);
	       double qa=Qa(h,Ul,Tave,sigma,eps1,eps2,k,delta,I,toalfa,Ti,T0,Tamb,Cps,Cp,eps,A,Ac,L,Vb,Tbm,Tbi,ros);
	       double P_delta=pressure_drop(h,Ul,Tave,sigma,eps1,eps2,k,delta,I,toalfa,Ti,T0,Tamb,mu,sp,eps,De,Ac,Cp);
	       double w1=fan_power(h,Ul,Tave,sigma,eps1,eps2,k,delta,I,toalfa,Ti,T0,Tamb,Ac,Cp,tch,mu,sp,eps,De);
	       double eff=efficiency(I,Ul,toalfa,Tamb,Ti,Ac,Cp,T0,k,delta,eps1,eps2,h,sigma,Tave);
	       System.out.println("qu = "+qu+ " Watt ");
	       System.out.println("Tai_m ="+Tai_m+ " C ");
	       System.out.println("Tbi_m ="+Tbi_m+ " C ");   
	       System.out.println("q="+q+" kj ");  
	       System.out.println("qa="+qa+" kj "); 
	       System.out.println("P_delta="+P_delta+ "N/m^2");
	       System.out.println("w1="+w1+ " Watt ");
	       System.out.println("eff="+eff);
	       properties_moist_air(ttt,www);
}
}