diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /167/CH13 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '167/CH13')
-rwxr-xr-x | 167/CH13/EX13.1/ex1.sce | 23 | ||||
-rwxr-xr-x | 167/CH13/EX13.2/ex2.sce | 48 | ||||
-rwxr-xr-x | 167/CH13/EX13.3/ex3.sce | 25 | ||||
-rwxr-xr-x | 167/CH13/EX13.4/ex4.sce | 15 | ||||
-rwxr-xr-x | 167/CH13/EX13.5/ex5.sce | 43 | ||||
-rwxr-xr-x | 167/CH13/EX13.6/ex6.sce | 24 |
6 files changed, 178 insertions, 0 deletions
diff --git a/167/CH13/EX13.1/ex1.sce b/167/CH13/EX13.1/ex1.sce new file mode 100755 index 000000000..dfd953c31 --- /dev/null +++ b/167/CH13/EX13.1/ex1.sce @@ -0,0 +1,23 @@ +//example 1
+//Mass and Mole Fractions of a Gas Mixture
+clear
+clc
+m=20 //total mass of the mixture in kg
+mfO2=3/m //mass fraction of oxygen
+mfN2=5/m //mass fraction of nitrogen
+mfCH4=12/m //mass fraction of methane
+NO2=3/32 //no.of kilo moles of oxygen
+NN2=5/28 // no.of kilo moles of nitrogen
+NCH4=12/16 //no.of kilo moles of methane
+N=NO2+NN2+NCH4//total no. of moles
+yO2=NO2/N //mole fraction of O2
+yN2=NN2/N //mole fraction of N2
+yCH4=NCH4/N // mole fraction of CH4
+Mm=m/N //average molar mass of gas in kg/kmol
+printf("\n Mass fraction of oxygen is = %.2f. \n",mfO2);
+printf("\n Mass fraction of Nitrogen is = %.2f. \n",mfN2);
+printf("\n Mass fraction of Methane is = %.2f. \n",mfCH4);
+printf("\n Mole fraction of Nitrogen is = %.3f. \n",yN2);
+printf("\n Mole fraction of Oxygen is = %.3f. \n",yO2);
+printf("\n Mole fraction of Methane is = %.3f. \n",yCH4);
+printf("\n Average Molar mass of gas is = %.1f kg/mol. \n",Mm);
\ No newline at end of file diff --git a/167/CH13/EX13.2/ex2.sce b/167/CH13/EX13.2/ex2.sce new file mode 100755 index 000000000..97d7be16c --- /dev/null +++ b/167/CH13/EX13.2/ex2.sce @@ -0,0 +1,48 @@ +//example 2
+//P-v-T Behavior of Nonideal Gas Mixtures
+clear
+clc
+NN2=2 //No.of kmol of N2
+NCO2=6 //No. of kmol of CO2
+Nm=8 // total no. of kmol of mixture
+Ru=8.314 //Universal gas constant in kPa-m^3/kmol-K
+Tm=300//Temp. of mixture in K
+Pm=15000 //Pressure of mixture in kPa
+Vm=Nm*Ru*Tm/Pm //volume of tank on the basis of ideal gas equation in m^3
+printf("\n Hence, the volume of the mixture on the basis of ideal gas equation of state is = %.3f m^3. \n",Vm);
+disp('Now,estimating volume of tank on the basis of Kays rule')
+yN2=NN2/Nm//mole fraction of nitrogen
+yCO2=NCO2/Nm //mole fraction of CO2
+TcrN2=126.2 // critical temop. of N2 in Kelvins
+TcrCO2=304.2 //critical temp. of CO2 in kelvins
+Tcrm=yN2*TcrN2+yCO2*TcrCO2 //pseudo critical temp. of mixture in Kelvins
+PcrN2=3.39 //critical pressure of N2 in MPa
+PcrCO2=7.39 //critical pressure in MPa
+Pcrm=yN2*PcrN2+yCO2*PcrCO2 //pseodo critical pressure of mixture in MPa
+Tm=300 //actual critical temp. of mixture in kelvins
+Pm=15 //actual critical pressure of mixture in MPa
+Tr=Tm/Tcrm //Reduced Temp. of mixture
+Pr=Pm/Pcrm //Reduced pressure of mixture
+Zm1=Tr/Pr //compressibility of the mixture
+Vm1=Zm1*Vm//volume of tank on the basis of Kays rule in m^3
+printf("\n Hence, the volume of the mixture on the basis of Kays rule is = %.3f m^3. \n",Vm1);
+disp('Now, estimating volume of tank on the basis of compressibility factors and Amagats law')
+TrN2=Tm/TcrN2 //Reduced Temp. of N2
+PrN2=Pm/PcrN2 //Reduced Pressure of N2
+ZN2=1.02 //compressibility factor of N2
+TrCO2=Tm/TcrCO2 //Reduced Temperature of CO2
+PrCO2=Pm/PcrCO2 //Reduced pressure of CO2
+ZCO2=0.30 //compressibility factor of CO2
+Zm2=ZN2*yN2+ZCO2*yCO2 //compressibility factor of the mixture
+Vm2=Zm2*Vm //volume of the mixture in m^3
+printf("\n Hence, the volume of the mixture on the basis of compressibility factors and Amagats law is = %.3f m^3. \n",Vm2);
+disp('Now, estimating volume of tank on the basis of compressibility factors and daltons law')
+VrN2=(Vm/NN2)/(Ru*TcrN2/(PcrN2*1000))
+VrCO2=(Vm/NCO2)/(Ru*TcrCO2/(PcrCO2*1000))
+ZN2=0.99 //compressibility factor of N2
+ZCO2=0.56 //compressibility factor of CO2
+Zm3=yN2*ZN2+yCO2*ZCO2 //compressibility factor of the mixture
+Vm3=Zm3*Vm //volume of the mixture in m^3
+disp('This is 33 percent lower than the assumed value. Therefore, we should repeat the calculations, using the new value of Vm. When the calculations are repeated we obtain 0.738 m^3 after the second iteration, 0.678 m^3 after the third iteration, and 0.648 m^3 after the fourth iteration. This value does not change with more iterations. Therefore')
+Vm=0.648 //volume of the mixture in m^3
+printf("\n Hence, the volume of the mixture on the basis of compressibility factors and Daltons law is = %.3f m^3. \n",Vm);
\ No newline at end of file diff --git a/167/CH13/EX13.3/ex3.sce b/167/CH13/EX13.3/ex3.sce new file mode 100755 index 000000000..d9d6abe77 --- /dev/null +++ b/167/CH13/EX13.3/ex3.sce @@ -0,0 +1,25 @@ +//example 3
+//Mixing Two Ideal Gases in a Tank
+clear
+clc
+disp('We assume both gases to be ideal gases, and their mixtureto be an ideal-gas mixture. This assumption is reasonable since both the oxygen and nitrogen are well above their critical temperatures and well below their critical pressures.')
+CvN2=0.743 //Constant-Volume Specific heat of N2 in kJ/kg-K
+CvO2=0.658 //Constant-Volume Specific heat of O2 in kJ/kg-K
+disp('This is a closed system since no mass crosses the boundary during the process. We note that the volume of a rigid tank is constant and thus,there is no boundary work done. ')
+T1N2=20 // Temperature of N2 in celsius
+T1O2=40 // Temperature of O2 in celsius
+mN2=4 //mass of N2 in kg
+mO2=7 //mass of O2 in kg
+Tm=(mN2*CvN2*T1N2+mO2*CvO2*T1O2)/(mN2*CvN2+mO2*CvO2) //Temp. of mixture in Celsius
+printf("\n Hence, the temp. of the mixture is = %.1f C. \n",Tm)
+NO2=mO2/32 //No. of kmol of O2
+NN2=mN2/28 //No. of kmol of N2
+Nm=NO2+NN2 //Total No. of kmol of mixture
+Ru=8.314 //Universal Gas Constant in kPa-m^3/kmol-K
+P1O2=100 //Initial Pressure of O2 in kPa
+P1N2=150 //Initial Pressure of N2 in kPa
+VO2=NO2*Ru*(T1O2+273)/P1O2//Initial volume of O2 in m^3
+VN2=NN2*Ru*(273+T1N2)/P1N2 //Initial volume of N2 in m^3
+Vm=VO2+VN2 //total volume of mixture in m^3
+Pm=Nm*Ru*(Tm+273)/Vm //Mixture Pressure after equilbrium in kPa
+printf("\n Hence, the mixture pressure after equilbrium is = %.1f kPa. \n",Pm)
\ No newline at end of file diff --git a/167/CH13/EX13.4/ex4.sce b/167/CH13/EX13.4/ex4.sce new file mode 100755 index 000000000..ffe28ed41 --- /dev/null +++ b/167/CH13/EX13.4/ex4.sce @@ -0,0 +1,15 @@ +//example 4
+//Exergy Destruction during Mixing of Ideal Gases
+clear
+clc
+disp('We take the entire contents of the tank as the system. This is a closed system since no mass crosses the boundary during the process. We note that the volume of a rigid tank is constant, and there is no energy transfer as heat or work.')
+NO2=3 //No.of kmol of O2
+NCO2=5 //No. of kmol of CO2
+Nm=NO2+NCO2 //total moles of the mixture
+yO2=NO2/Nm //mole fraction of O2
+yCO2=NCO2/Nm //mole fraction of CO2
+Ru=8.314 //Universal Gas Constant in kJ/kmol-K
+dSm=-Ru*(NO2*log(yO2)+NCO2*log(yCO2)) //Entropy change in kJ/K
+To=298 //Temp. of surroundings in kelvins
+X=To*dSm //energy destuction in the process in kJ
+printf("\n Hence, the exergy destruction in the process is = %.1f MJ. \n",X/10^3);
\ No newline at end of file diff --git a/167/CH13/EX13.5/ex5.sce b/167/CH13/EX13.5/ex5.sce new file mode 100755 index 000000000..0c6d8fc86 --- /dev/null +++ b/167/CH13/EX13.5/ex5.sce @@ -0,0 +1,43 @@ +//example 5
+//cooling of non ideal gas mixture
+clear
+clc
+disp('We take the cooling section as the system. This is a control volume since mass crosses the system boundary during the process.The critical properties ')
+TcrN2= 126.2 //Critical Pressure of N2in K
+PcrN2=3.39 //Critical Pressure of N2 in MPa
+TcrO2=154.8 //Critical Temp. of O2 in K
+PcrO2=5.08 //Critical Pressure of O2 in MPa
+yN2=0.79 //mole fraction of nitrogen
+yO2=0.21 //mole fraction of O2
+T1=220 //Initial Temp. of air in kelvins
+T2=160//Final Temp. of air in kelvins
+Pm=10 //PRessure in MPa
+Ru=8.314 //Universal Gas constant in kJ/kmol-K
+disp('calculating heat transfer per kmol of air using ideal gas approximation')
+h1N2=6391 //Enthalpy of N2 at T1 in kJ/kmol
+h1O2=6404 //Enthalpy of O2 at T1 in kJ/kmol
+h2O2=4657 //Enthalpy of O2 at T2 in kJ/kmol
+h2N2=4648 //Enthalpy of N2 at T2 in kJ/kmol
+qout=yN2*(h1N2-h2N2)+yO2*(h1O2-h2O2) //Heat Transfer in kJ/kmol
+printf("\n Hence, the heat transfer during the process using the ideal gas approximation is = %.0f kJ/kmol. \n",qout);
+disp('calculating heat transfer per kmol of air using Kays law')
+Tcrm2=yN2*TcrN2+yO2*TcrO2 //critical temp. of pseudopure substance
+Pcrm2=yN2*PcrN2+yO2*PcrO2 //critical pressure of pseudopure substance
+Tr1=T1/Tcrm2 //Reduced Temp. at T1
+Tr2=T2/Tcrm2 //Reduced Temp. at T2
+Zh1m=1.0 //Compresibility factor at T1
+Zh2m=2.6 //Compressibility Factor at T2
+Pr=Pm/Pcrm2 //Reduced Pressure
+h1m=yN2*h1N2+yO2*h1O2 //Enthalpy of the mixture at T1 in kJ/kmol
+h2m=yN2*h2N2+yO2*h2O2 //Enthalpy of the mixture at T2 in kJ/kmol
+qout=(h1m-h2m)-Ru*Tcrm2*(Zh1m-Zh2m)//Heat transfer during the process in kJ/kmol
+printf("\n Hence, the heat transfer during the process using Kays law is = %.0f kJ/kmol. \n",qout);
+disp('calculating heat transfer per kmol of air using Amagats law')
+Zh1N2=0.9 //Compressibility factor of N2 at T1
+Zh2N2=2.4 //Compressibility factor of N2 at T2
+Zh1O2=1.3 //Compressibility factor of O2 at T1
+Zh2O2=4.0 //Compressibility factor of O2 at T2
+dhN2=(h1N2-h2N2)-Ru*TcrN2*(Zh1N2-Zh2N2) //Enthalpy change for N2 in kJ/kmol
+dhO2=(h1O2-h2O2)-Ru*TcrO2*(Zh1O2-Zh2O2) //Enthaloy change for O2 in kJ/kmol
+qout=yN2*dhN2+yO2*dhO2 //kJ/mol //heat transfer during the process in kJ/kmol
+printf("\n Hence, the heat transfer during the process using Amagats law is = %.0f kJ/kmol. \n",qout);
\ No newline at end of file diff --git a/167/CH13/EX13.6/ex6.sce b/167/CH13/EX13.6/ex6.sce new file mode 100755 index 000000000..c7c137d03 --- /dev/null +++ b/167/CH13/EX13.6/ex6.sce @@ -0,0 +1,24 @@ +//example 6
+//obtaining fresh water from sea water
+clear
+clc
+Mw=18.0 //molar mass of water kg/kmol
+Ms=58.44 //molar mass of salt kg/kmol
+Rw=0.4615 //gas constant of pure water kJ/kg-K
+mfs=0.0348 //mass fraction of salt
+mfw=1-mfs //mass fraction of water
+Mm=1/((mfs/Ms)+(mfw/Mw)) //molar mass of mixture kg/kmol
+yw=mfw*Mm/Mw //mole fraction of water
+ys=1-yw //mole fraction of salt
+To=288.15 //Temp. of Seawater in kelvins
+Ru=8.314 //Universal Gas constant in kJ/kmol-K
+dm=1028 //density of seawater in kg/m^3
+wminin=-Ru*To*(yw*log(yw)+ys*log(ys)) //minimum work input required to separate 1 kg of seawater completely into pure water and pure salts kJ/kmol
+Wminin=wminin/Mm //minimum work input in kJ/kg seawater
+wminin2=Rw*To*log(1/yw) //minimum work input required to produce 1 kg of fresh water from seawater in kJ/kg fresh water
+Pm=dm*Rw*To*log(1/yw) //the minimum gauge pressure that the seawater must be raised if fresh water is to be obtained by reverse osmosis using semipermeable membranes in kPa
+printf("\n Hence, the mole fraction of water in the seawater is = %.4f. \n",yw);
+printf("\n Hence, the mole fraction of salt in the seawater is = %.2f percentage. \n",ys*100);
+printf("\n Hence, the minimum work input required to separate 1 kg of seawater completely into pure water and pure salts is = %.2f kJ/kg sea water. \n",Wminin);
+printf("\n Hence, the minimum work input required to produce 1 kg of fresh water from seawater kJ/kg fresh water is = %.2f kJ/kg fresh water. \n",wminin2);
+printf("\n Hence, the the minimum gauge pressure that the seawater must be raised if fresh water is to be obtained by reverse osmosis using semipermeable membranes is = %.0f kPa. \n",Pm);
\ No newline at end of file |