diff options
Diffstat (limited to 'Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch10.ipynb')
-rw-r--r-- | Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch10.ipynb | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch10.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch10.ipynb index 0a0c51e7..d814a959 100644 --- a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch10.ipynb +++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch10.ipynb @@ -36,36 +36,25 @@ "\n", "import math \n", "\n", - "# Variables\n", "P = 100. #[psia] Bubble point pressure\n", "x_ethane = 0.10 # Mole fraction of ethane in liquid phase\n", "x_hepmath_tane = (1-x_ethane)\n", "\n", - "# a) From figure 10.7( page 260 ) given in the book\n", - "# We read the chart to get the bubble-point temperature\n", - "# The dew point curve for 100 psia crosses the 10 mol% ethane line at about temperature \n", "T1 = 165. #[C]\n", - "# Now, we horizontally from that intersection point to the dew-point curve, finding the vapor phase composition of ethane \n", "y1_e = 0.92\n", "y1_h = (1- y1_e)\n", "\n", - "# b) By Raoult's law, we use a trial and error procedureon the temperature\n", - "# Antoine equation consmath.tants for ethanol are given \n", "A_e = 6.80267\n", "B_e = 656.4028\n", "C_e = 255.99\n", "\n", - "# and that for n-hepmath_tane are\n", "A_h = 6.9024\n", "B_h = 1268.115\n", "C_h = 216.9\n", "\n", - "# Antoine equation is given by\n", - "# (math.log10p) = (A - B/(T+C))\n", "T = 50. #[C]\n", "err = 1.\n", " \n", - "# Calculations\n", "while err > 10**(-4):\n", " p1_e = (10**(A_e - B_e/(C_e + T)))*(14.7/760)\n", " p1_h = (10**(A_h - B_h/(C_h + T)))*(14.7/760)\n", @@ -74,18 +63,11 @@ " err = abs((y2_e + y2_h) - 1)\n", " T = T + 0.0001\n", "\n", - "# Changing the temperature in deg F \n", "T2 = T*9./5 + 32 #[F] Bubble-point temperature\n", "\n", - "# c) In this method, we use L-R rule, instead of simple Raoult's law\n", - "# So,\n", - "# y_i = (x_i*p_i)/(v_i*P)\n", - "# Where calculated values of v_i from EOS are given in the table 10.A and are \n", "v_e = 0.950 # For ethane\n", "v_h = 0.459 # For n-hepmath_tane\n", "\n", - "# We again use trial and error on the temperature\n", - "# Let us assume the initial temperature \n", "Ti = 50. #[C]\n", "err = 1\n", " \n", @@ -97,10 +79,8 @@ " err = abs((y3_e + y3_h) - 1)\n", " Ti = Ti + 0.0001\n", "\n", - "# Changing the temperature in deg F \n", "T3 = Ti*9./5 + 32 #[F] Bubble-point temperature\n", "\n", - "# Results\n", "print \" The results are summarized in the following table:\"\n", "print \" Variable \\t Values calculated from\\t Values calculated from \\t Values calculated \"\n", "print \" \\t from figure 10.7 \\t Raoult''s law \\t\\t\\t from L-R rule\"\n", @@ -150,39 +130,25 @@ "\n", "import math \n", "\n", - "# Variables\n", "P = 800. #[psia] Bubble point pressure\n", "x_ethane = 0.60 # Mole fraction of ethane in liquid phase\n", "x_hepmath_tane = (1-x_ethane)\n", "\n", - "# a) From figure 10.7( page 260 ) given in the book\n", - "# We read the chart to get the bubble-point temperature\n", - "# The dew point curve for 800 psia crosses the 60 mol% ethane line at about temperature \n", - "# T1 = 165\n", - "# Now, we horizontally from that intersection point to the dew-point curve, finding the vapor phase composition of ethane \n", - "# y1_e = 0.95\n", - "# But, by linear interpolation in the experimental data on which Figure 10.7 is based we make a slightly more reliable estimate and get \n", "T1 = 209. #[F]\n", "y1_e = 0.945\n", "y1_h = (1- y1_e)\n", "\n", - "# b) By Raoult's law, we use a trial and error procedureon the temperature\n", - "# Antoine equation consmath.tants for ethanol are given \n", "A_e = 6.80267\n", "B_e = 656.4028\n", "C_e = 255.99\n", "\n", - "# and that for n-hepmath_tane are\n", "A_h = 6.9024\n", "B_h = 1268.115\n", "C_h = 216.9\n", "\n", - "# Antoine equation is given by\n", - "# (math.log10p) = (A - B/(T+C))\n", "T = 50. #[C]\n", "err = 1.\n", " \n", - "# Calculations\n", "while err > 10**(-4):\n", " p1_e = (10**(A_e - B_e/(C_e + T)))*(14.7/760)\n", " p1_h = (10**(A_h - B_h/(C_h + T)))*(14.7/760)\n", @@ -191,18 +157,11 @@ " err = abs((y2_e + y2_h) - 1)\n", " T = T + 0.0001\n", "\n", - "# Changing the temperature in deg F \n", "T2 = T*9./5 + 32 #[F] Bubble-point temperature\n", "\n", - "# c) In this method, we use L-R rule, instead of simple Raoult's law\n", - "# So,\n", - "# y_i = (x_i*p_i)/(v_i*P)\n", - "# Where calculated values of v_i from EOS are given \n", "v_e = 0.6290642 # For ethane\n", "v_h = 0.0010113 # For n-hepmath_tane\n", "\n", - "# We again use trial and error on the temperature\n", - "# Let us assume the initial temperature \n", "Ti = 10. #[C]\n", "err = 1.\n", " \n", @@ -214,10 +173,8 @@ " err = abs((y3_e + y3_h) - 1)\n", " Ti = Ti + 0.0001\n", "\n", - "# Changing the temperature in deg F \n", "T3 = Ti*9./5 + 32 #[F] Bubble-point temperature\n", "\n", - "# Results\n", "print \" The results are summarized in the following table:\"\n", "print \" \\t Variable \\t\\t Values calculated from\\t Values calculated from Values calculated\"\n", "print \" \\t\\t\\t\\t from figure 10.7 \\t Raoult''s law \\t\\t from L-R rule\"\n", @@ -269,46 +226,29 @@ "from scipy.optimize import fsolve \n", "import math \n", "\n", - "# Variables\n", - "# The initial data for this example is same as that of example 10.2, i.e.\n", "P = 800. #[psia] Bubble point pressure\n", "x_e = 0.60 # Mole fraction of ethane in liquid phase\n", "x_h = (1-x_e) # Mole fraction of n-hepmath.tane in the liquid phase\n", "R = 0.08314 #( L*bar/(mol*K)) Universal gas consmath.tant \n", "\n", - "# Changing the pressure in bar\n", "Pb = (800/14.7)*(1.01325) #[bar]\n", "\n", - "# In this problem we will denote ethane by 'e' and that to n-hepmath.tane by 'h'\n", - "# From table A.1 ( page 417 ) given in the book, critical temperatures of ethane and hepmath.tane are \n", "T_c_e = 305.3 #[K]\n", "T_c_h = 540.2 #[K]\n", "\n", - "# and critical pressures are\n", "P_c_e = 48.72 #[bar]\n", "P_c_h = 27.40 #[bar]\n", "\n", - "# also the accentric facors are \n", "w_e = 0.1\n", "w_h = 0.35\n", "\n", - "# Thus we have\n", "P_r_e = Pb/P_c_e\n", "P_r_h = Pb/P_c_h\n", "\n", - "# Now from equations (F.13) and (F.14) ( page 459 ) given in the book we have\n", - "# A_e = 0.42747 + ( 1 + (0.480 + 1.574*w_e - 0.17*w_e**(2))*( 1 - T_r_e**(0.5)))**(2)*(P_r_e/T_r_e**(2))\n", - "# A_h = 0.42747 + ( 1 + (0.480 + 1.574*w_h - 0.17*w_h**(2))*( 1 - T_r_h**(0.5)))**(2)*(P_r_h/T_r_h**(2))\n", - "# and\n", - "# B_e = 0.08664*(P_r_e/T_r_e)\n", - "# B_h = 0.08664*(P_r_h/T_r_h)\n", "\n", - "# We will take the help trial and error method both on Temperature and the vapor phase composition of ethane\n", - "# Let us assume the starting temperature 200 deg F. Changing this temperature in K\n", "T = (200-32)*5./9 + 273.15 #[K]\n", "err = 1\n", "\n", - "# Calculations\n", "while err > 10**(-4):\n", " T_r_e = T/T_c_e\n", " T_r_h = T/T_c_h\n", @@ -353,15 +293,12 @@ " T = T + 0.1\n", "\n", "\n", - "# Changing the temperature in deg F, we have \n", "Tf = ( T - 273.15)*9./5 + 32 #[F]\n", "\n", - "# Results\n", "print \" Bubble point of the given ethanol and n-hepmath.tane mixture at 800 psia is %f deg F\"%(Tf)\n", "print \" Amount of ethanol in the vapour phase of the mixture at the given condition is %f \"%(y_e1)\n", "print \" Amount of n-heptane in the vapour phase of the mixture at the given condition is %f \"%(y_h1)\n", "\n", - "# Answers may vary because of rounding error." ], "language": "python", "metadata": {}, |