public class MBWRData extends Object
{
//this class reads and store Modified benedict Webb Rubin  data
public String refrigerantName;
public String openName;
public double mf,mf1;
public double M,R,BP,Tc,Pc,dc,Vc;
public double B[];
public double acp[];
public double aVP[][];
public double adf[];
public double aa[];
public double Tr,hr,sr,hlgr,slgr;
public double G[]; // ideal gas heat capacitiy
public double E[][]; // saturated liquid density
public double F[][]; // saturated vapor density
public double vl[]; //saturated liquid viscosity
public double vv[]; //saturated vapor viscosity
public double kl[];//saturated liquid thermal conductivity
public double kv[]; //saturated vapor thermal conductivity
public double st[];//saturated liquid-vapor interphase surface tension
public double tl[];
public double th[];
public double vg[];
   public MBWRData(String refrigerantNamei,String openNamei,double mfi,double mf1i,
   double Mi,double Ri,double BPi,
   double Tci,double Pci, double dci,double vci,
   double b1,double b2, double b3, double b4, double b5, double b6, double b7, double b8, double b9, double b10,
   double b11,double b12, double b13, double b14, double b15, double b16, double b17, double b18, double b19, double b20,
   double b21,double b22, double b23, double b24, double b25, double b26, double b27, double b28, double b29, double b30,
   double b31,double b32,
   double cp1,double cp2,double cp3,double cp4,double cp5,
   double vg0,double vg1,double vg2, double vg3, double vg4, double vg5,
   double df1,double df2, double df3, double df4, double df5,
   double a0,double a1,double a2,double a3,double a4,double a5,double a6,double a7,double a8,
   double tri,double hri,double sri,double hlgi,double slgi)
   {
   refrigerantName=refrigerantNamei;
   openName=openNamei;
   Tr=tri;hr=hri;sr=sri;hlgr=hlgi;slgr=slgi;
   mf=mfi;
   mf1=mf1i;
   M=Mi;
   R=Ri;
   BP=BPi;
   Tc=Tci;Pc=Pci;dc=dci;Vc=vci;
   B=new double[32];
   acp=new double[5];
   aVP=new double[33][9];
   adf=new double[5];
   aa=new double[9];
   tl=new double[33];
   th=new double[33];
   vg=new double[6];
   G=new double[6];
   vl=new double[9];
   vv=new double[9];
   kl=new double[9];
   kv=new double[9];
   st=new double[9];
   B[0]=b1;B[1]=b2;B[2]=b3;B[3]=b4;B[4]=b5;B[5]=b6;B[6]= b7;B[7]= b8;B[8]=b9;B[9]=b10;
   B[10]=b11;B[11]=b12;B[12]=b13;B[13]=b14;B[14]=b15;B[15]=b16;B[16]= b17;B[17]= b18;B[18]=b19;B[19]=b20;
   B[20]=b21;B[21]=b22;B[22]=b23;B[23]=b24;B[24]=b25;B[25]=b26;B[26]= b27;B[27]= b28;B[28]=b29;B[29]=b30;
   B[30]=b31;B[31]=b32;
   acp[0]=cp1;acp[1]=cp2;acp[2]=cp3;acp[3]=cp4;acp[4]=cp5;
   adf[0]=df1;adf[1]=df2;adf[2]=df3;adf[3]=df4;adf[4]=df5;
   vg[0]=vg0;vg[1]=vg1;vg[2]=vg2;vg[3]=vg3;vg[4]=vg4;vg[5]=vg5;
   aa[0]=a0;aa[1]=a1;aa[2]=a2;aa[3]=a3;aa[4]=a4;aa[5]=a5;aa[6]=a6;aa[7]=a7;aa[8]=a8;
   }

   public void vapor_pressure_in(double ai[][])
   {
   int n=ai.length;
   int m=ai[0].length;
   int i,j;
   for(i=0;i<n;i++)
   {for(j=0;j<m;j++) {aVP[i][j]=ai[i][j];}
   } 	   
   }
   
   public void viscosity_liq_in(double avl1,double avl2,double avl3,double avl4, double avl5,double avl6,double avl7, double avl8,double avl9)
   {vl[0]=avl1;vl[1]=avl2;vl[2]=avl3;vl[3]=avl4;vl[4]=avl5;vl[5]=avl6;vl[6]=avl7;vl[7]=avl8;vl[8]=avl9;}
      
   public void viscosity_vap_in(double avv1,double avv2,double avv3,double avv4, double avv5,double avv6,double avv7, double avv8,double avv9)
   {vv[0]=avv1;vv[1]=avv2;vv[2]=avv3;vv[3]=avv4;vv[4]=avv5;vv[5]=avv6;vv[6]=avv7;vv[7]=avv8;vv[8]=avv9;}
   
   public void thermal_conductivity_liq_in(double akl1,double akl2,double akl3,double akl4, double akl5,double akl6,double akl7, double akl8,double akl9)
   {kl[0]=akl1;kl[1]=akl2;kl[2]=akl3;kl[3]=akl4;kl[4]=akl5;kl[5]=akl6;kl[6]=akl7;kl[7]=akl8;kl[8]=akl9;}
   
   public void thermal_conductivity_vap_in(double akv1,double akv2,double akv3,double akv4, double akv5,double akv6,double akv7, double akv8,double akv9)
   {kv[0]=akv1;kv[1]=akv2;kv[2]=akv3;kv[3]=akv4;kv[4]=akv5;kv[5]=akv6;kv[6]=akv7;kv[7]=akv8;kv[8]=akv9;}
   
   public void surface_tension_in(double ast1,double ast2,double ast3,double ast4, double ast5,double ast6,double ast7, double ast8,double ast9)
   {st[0]=ast1;st[1]=ast2;st[2]=ast3;st[3]=ast4;st[4]=ast5;st[5]=ast6;st[6]=ast7;st[7]=ast8;st[8]=ast9;}
   
   public void ideal_gas_heat_capacity_in(double G1,double G2,double G3,double G4, double G5, double G6)
   {G[0]=G1;G[1]=G2;G[2]=G3;G[3]=G4;G[4]=G5;G[5]=G6;}
         

   public void saturated_liq_density_in(double ai[][])
   {
   int n=ai.length;
   int m=ai[0].length;
   E=new double[n][m];
   int i,j;
   for(i=0;i<n;i++)
   {for(j=0;j<m;j++) {E[i][j]=ai[i][j];}
   } 	   
   }
     
   public void saturated_vapor_density_in(double ai[][])
   {
   int n=ai.length;
   int m=ai[0].length;
   F=new double[n][m];
   int i,j;
   for(i=0;i<n;i++)
   {for(j=0;j<m;j++) {F[i][j]=ai[i][j];}
   } 	   
   }
   
   public String toString()
   {
   int i;
   String s="";
   s+="RN = "+refrigerantName+"\n";
   s+="RN = "+openName+"\n";
   s+="MBWR HAL DENKLEMĘ\n";
   s+="M="+M+"\n";
   s+="R="+R+"\n";
   s+="BP="+BP+"\n";
   s+=" B \n";
   for(i=0;i<B.length;i++)
   {s+=(i+1)+" "+B[i]+"\n";}
   s+=" Cp \n";
   for(i=0;i<acp.length;i++)
   {s+=(i+1)+" "+acp[i]+"\n";}
   s+=" VP \n";
   for(int j=0;j<aVP.length;j++)
     for(i=0;i<aVP[0].length;i++)
        {s+=(j+1)+" "+ (i+1)+" "+aVP[j][i]+"\n";}
   s+=" df \n";
   for(i=0;i<adf.length;i++)
   {s+=(i+1)+" "+adf[i]+"\n";}
   s+=" vg \n";
   for(i=0;i<vg.length;i++)
   {s+=(i+1)+" "+vg[i]+"\n";}
   return s;
   }
}
