summaryrefslogtreecommitdiff
path: root/Introduction_To_Chemical_Engineering/ch6.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Introduction_To_Chemical_Engineering/ch6.ipynb')
-rw-r--r--Introduction_To_Chemical_Engineering/ch6.ipynb65
1 files changed, 0 insertions, 65 deletions
diff --git a/Introduction_To_Chemical_Engineering/ch6.ipynb b/Introduction_To_Chemical_Engineering/ch6.ipynb
index dc10eb48..1a7b64a4 100644
--- a/Introduction_To_Chemical_Engineering/ch6.ipynb
+++ b/Introduction_To_Chemical_Engineering/ch6.ipynb
@@ -27,10 +27,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the flux and pressure difference\n",
"\n",
"import math \n",
- "# Variables\n",
"D_AB=6.75*10**-5 #in m2/s\n",
"Z=0.03 #in m\n",
"R=8314\n",
@@ -38,11 +36,9 @@
"p_A2=1.5*10**4 #in Pa\n",
"T=298 #in K\n",
"\n",
- "# Calculations and Results\n",
"N_A=D_AB*(p_A1-p_A2)/(R*T*Z);\n",
"print \"flux = %f kmol/sq m s\"%(N_A)\n",
"\n",
- "#for partial pressure\n",
"Z=0.02; #in m\n",
"p_A2=p_A1-((N_A*R*T*Z)/D_AB);\n",
"print \"pressure = %f Pa\"%(p_A2)\n",
@@ -74,17 +70,14 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the flux of NH3 and equimolar counter diffusion flux\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"Z=0.15 #in m\n",
"P=1.013*10**5 #in Pa\n",
"p_A1=1.5*10**4 #in Pa\n",
"p_A2=5*10**3 #in Pa\n",
"\n",
- "# Calculations and Results\n",
"p_B1=P-p_A1;\n",
"p_B2=P-p_A2;\n",
"\n",
@@ -92,13 +85,11 @@
"R=8314.\n",
"T=298. #in K\n",
"\n",
- "#for non diffusing N2\n",
"p_BM=(p_B2-p_B1)/math.log (p_B2/p_B1);\n",
"print p_B1, p_B2\n",
"N_A=D_AB*(p_A1-p_A2)*P/(R*T*Z*p_BM);\n",
"print \"flux = %.4e kmol/sq m s\"%(N_A)\n",
"\n",
- "#for diffusing N2\n",
"N_A=D_AB*(p_A1-p_A2)/(R*T*Z);\n",
"print \"flux = %.4e kmol/sq m s\"%(N_A)\n"
],
@@ -130,13 +121,11 @@
"collapsed": false,
"input": [
"import math \n",
- "# Variables\n",
"M_A=36.5 #molar mass of HCl\n",
"M_B=18. #molar masss of water\n",
"w_A1=12.; #weight % of HCL\n",
"w_A2=4. #weight % of HCL\n",
"\n",
- "# Calculations and Results\n",
"x_A1=(w_A1/M_A)/((w_A1/M_A)+((100-w_A1)/M_B));\n",
"print 'x_A1 =%f'%(x_A1)\n",
"\n",
@@ -144,7 +133,6 @@
"M1=100./((w_A1/M_A)+((100-w_A1)/M_B));\n",
"print \"molar mass at point 1 = %f kg/kmol\"%(M1)\n",
"\n",
- "#at point 2\n",
"x_A2=(w_A2/M_A)/((w_A2/M_A)+((100-w_A2)/M_B));\n",
"x_B2=1-x_A2;\n",
"M2=100/((w_A2/M_A)+((100-w_A2)/M_B)); #avg molecular weight at point 2\n",
@@ -190,10 +178,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the mean driving force and mass transfer area\n",
"\n",
"import math \n",
- "# Variables\n",
"Gs=700/22.4 #in kmol of dry air/hr\n",
"Ls=1500./18 #in kmol of dry air/hr\n",
"y1=0.05\n",
@@ -203,14 +189,11 @@
"X1=(Gs/Ls)*(Y1-Y2);\n",
"m=Gs*(Y1-Y2);\n",
"\n",
- "# Calculations and Results\n",
- "#driving force\n",
"delta_Y1=Y1-1.68*X1;\n",
"delta_Y2=Y2-1.68*X2;\n",
"delta_Y=(delta_Y1-delta_Y2)/(math.log (delta_Y1/delta_Y2));\n",
"print \"driving force = %f kmol acetone/kmol dry air\"%(delta_Y)\n",
"\n",
- "#mass transfer area\n",
"K_G=0.4 #in kmol acetone/kmol dry air\n",
"A=m/(K_G*delta_Y);\n",
"print \"area = %f sq m\"%(A)\n"
@@ -241,17 +224,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to calculate minimum oil circulation rate\n",
"\n",
"import math \n",
- "# Variables\n",
"G1=(855/22.4)*(106.6/101.3)*(273/299.7);\n",
"y1=0.02;\n",
"Y1=y1/(1-y1);\n",
"Gs=G1*(1-y1);\n",
"\n",
- "# Calculations\n",
- "#for 95% removal\n",
"Y2=0.05*Y1;\n",
"x2=0.005;\n",
"X2=x2/(1-x2);\n",
@@ -261,7 +240,6 @@
"Ls_molar=(Gs*(Y1-Y2))/(X1-X2);\n",
"Ls=Ls_molar*260;\n",
"\n",
- "# Results\n",
"print \"minimum oil circulation rate = %f kg/hr\"%(Ls)\n"
],
"language": "python",
@@ -289,15 +267,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# to find the equilibrium composition\n",
"\n",
"import math \n",
- "# Variables\n",
"P_M = 53.32 #kPa\n",
"P_W = 12.33 #in kpA\n",
"P = 40 #IN K pA\n",
"\n",
- "# Calculations and Results\n",
"x = (P - P_W)/(P_M-P_W);\n",
"\n",
"print \"liquid phase composition = %f\"%(x)\n",
@@ -331,7 +306,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the top and bottom composition\n",
"\n",
"import math \n",
"from matplotlib.pyplot import *\n",
@@ -339,13 +313,9 @@
"\n",
"%pylab inline\n",
"\n",
- "# Variables\n",
"x = [1,0.69,0.40,0.192,0.045,0];\n",
"y = [1,0.932,0.78,0.538,0.1775,0];\n",
"plot(x,y)\n",
- "#xlabel(\"x\")\n",
- "#ylabel(\"y\")\n",
- "#title(\"distillation curve\")\n",
"x = linspace(0,1,10)\n",
"y = linspace(0,1,10)\n",
"plot(x,y)\n",
@@ -362,7 +332,6 @@
"\n",
"show()\n",
"\n",
- "# Results\n",
"print \"composition of top product = %f mole percent of hexane\"%(y_D*100)\n",
"print \"composition of bottom product = %f mole percent of hexane\"%(x_W*100)\n"
],
@@ -415,19 +384,16 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the composite distillate and residue\n",
"\n",
"%pylab inline\n",
"import math \n",
"from numpy import *\n",
"from matplotlib.pyplot import *\n",
- "# Variables\n",
"F = 100. #moles\n",
"xf = 0.4;\n",
"D = 60. #moles\n",
"W = 40. #moles\n",
"\n",
- "# Calculations\n",
"x = linspace(0.2,0.45,6)\n",
"y = zeros(6)\n",
"z = zeros(6)\n",
@@ -443,7 +409,6 @@
"yd = (F*xf-W*xw)/D;\n",
"show()\n",
"\n",
- "# Results\n",
"print \"composition of distillate = %f\"%(yd)\n",
"print \"composition of residue = %f\"%(xw)\n"
],
@@ -488,22 +453,17 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the top and bottom product composition\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
- "#part 1\n",
"x=0.4;\n",
"y=0.8;\n",
"x_D=y;\n",
"x_W=0.135; #bottom concentration\n",
"\n",
- "# Calculations and Results\n",
"D=(100*x-100*x_W)/(y-x_W); #distillate amount\n",
"print \"amount of distillate =%f moles/h\"%(D)\n",
"\n",
- "#part 2\n",
"alpha=6; #relative volatility\n",
"x_R=y/(y+(alpha*(1-y))); #liquid leaving partial condensor\n",
"print \"liquid leaving partial condenser = %f\"%(x_R)\n",
@@ -543,15 +503,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the percentage extraction of nicotine\n",
"\n",
"import math \n",
- "# Variables\n",
"x=0.01; #% of nicotine\n",
"X0 = x/(1-x);\n",
"w=150. #weight of nicotine water solution\n",
"\n",
- "# Calculations and Results\n",
"A0=w*(1-X0);\n",
"B0=250.; #kg keroscene\n",
"X1 = A0*X0/(A0+B0*0.798);\n",
@@ -590,15 +547,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the number of stages\n",
"\n",
"import math \n",
- "# Variables\n",
"x=0.01 #mole fraction of nicotine\n",
"yN = 0.0006; #mole fraction in solvent\n",
"xN = 0.001; #final mole fraction in water\n",
"\n",
- "# Calculations and Results\n",
"X0=x/(1.-x); #in kg nicotine/kg water\n",
"YN =yN/(1.-yN); #in kg nicotine/kg keroscene\n",
"XN = xN/(1.-xN);\n",
@@ -608,7 +562,6 @@
"Y1=((A0*(X0-XN))/B0)+YN; #in kg nicotine/kg kerosene\n",
"print \"Y1 = %f kg nicotine/kg kerosene\"%(Y1)\n",
"\n",
- "#for graph refer to the book\n",
"number_of_stages = 8.4;\n",
"print \"numnber of stages = %f\"%(number_of_stages)\n"
],
@@ -638,16 +591,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to calculate the humidity\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"P = 101.3 #in kPa\n",
"pA = 3.74 #in kPa\n",
"p_AS = 7.415 #in kPa\n",
"\n",
- "# Calculations and Results\n",
"H = (18.02/28.97)*(pA/(P-pA));\n",
"print \"humidity = %f kg H2O/kg air\"%(H)\n",
"\n",
@@ -688,12 +638,10 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the air flow rate and outlet humidity\n",
"\n",
"import math \n",
"from numpy import *\n",
"\n",
- "# Variables\n",
"S=425.6 #in kg/h\n",
"X1 = 0.035 #in kgwater/kg dry solid\n",
"t_s1=25. #in degree C\n",
@@ -705,7 +653,6 @@
"C_pS = 1.465 #in kJ/kg dry solid\n",
"C_pA = 4.187 #in kg/ kg H2O K\n",
"\n",
- "# Calculations and Results\n",
"H_G2=(1.005+1.88*H2)*(t_G2-0)+H2*2501;\n",
"H_S1 = C_pS*(t_s1-0)+X1*C_pA*(t_s1-0); #in kJ/kg\n",
"H_S2 = C_pS*(t_s2-0)+X2*C_pA*(t_s2-0); #in kJ/kg\n",
@@ -715,8 +662,6 @@
"print \"Enthalpy of entering solid HS1 = %f kJ/kg dryair\"%(H_S1)\n",
"print \"Enthalpy of exit solid HS2 = %f kJ/kg dryair\"%(H_S2)\n",
"\n",
- "#applying GHg2 + SHs1 = GHg1 +SHs2 +Q, we get two linear equations\n",
- "#0.0175G+14.17248 = GH1 and 98.194G-29745.398 = 2562.664GH1\n",
"A = array([[0.0175, -1],[98.194, -2562.664]]);\n",
"b = array([[-14.17248],[29745.398]]);\n",
"x = linalg.solve(A,b)\n",
@@ -754,22 +699,16 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the crystal yield\n",
"\n",
"import math \n",
"from numpy import *\n",
- "# Variables\n",
"M_Na2CO3 = 106\n",
"M_10H2O = 180.2\n",
"M_Na2CO3_10H2O = 286.2;\n",
"w_Na2CO3 = 5000. #in kg\n",
"water = 0.05 #% of water evaporated\n",
"\n",
- "# Calculations\n",
"W = water*w_Na2CO3;\n",
- "#solving material balance, we have two equations\n",
- "#equation 1 -> 0.8230L +0.6296C = 3500\n",
- "#equation 2 -> 0.1769L + 0.3703C = 1250\n",
"\n",
"A = array([[0.8230, 0.6296],[0.1769, 0.3703]])\n",
"b = array([[3500],[1250]])\n",
@@ -777,7 +716,6 @@
"L = x[0]\n",
"C = x[1];\n",
"\n",
- "# Results\n",
"print \"L = %f kg solution\"%(L)\n",
"print \"C = %f kg of Na2CO3.10H2O crystals\"%(C)\n"
],
@@ -807,15 +745,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the crystal yield\n",
"\n",
"import math \n",
"from numpy import *\n",
- "# Variables\n",
"A = array([[0.7380, 0.5117],[0.2619, 0.4882]])\n",
"b = array([[1400],[600]])\n",
"\n",
- "# Calculations and Results\n",
"x = linalg.solve(A,b)\n",
"L = x[0]\n",
"C = x[1];\n",