diff options
Diffstat (limited to 'Chemical_Engineering_Thermodynamics/ch11_1.ipynb')
-rw-r--r-- | Chemical_Engineering_Thermodynamics/ch11_1.ipynb | 335 |
1 files changed, 335 insertions, 0 deletions
diff --git a/Chemical_Engineering_Thermodynamics/ch11_1.ipynb b/Chemical_Engineering_Thermodynamics/ch11_1.ipynb new file mode 100644 index 00000000..fdf3f695 --- /dev/null +++ b/Chemical_Engineering_Thermodynamics/ch11_1.ipynb @@ -0,0 +1,335 @@ +{ + "metadata": { + "name": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11 : Properties of a Component in a Mixture" + ] + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 11.1 Page Number : 385" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Determination of volumes of ethanol and water\n", + "\n", + "import math\n", + "\n", + "# Variables\n", + "Vol_total = 3;\t\t\t#[m**(3)] - Total volume of solution\n", + "x_ethanol = 0.6;\t\t\t#Mole fraction of ethanol\n", + "x_water = 0.4;\t\t\t#Mole fraction of water\n", + "\n", + "# Calculations\n", + "#The partial molar volumes of the components in the mixture are\n", + "V_ethanol_bar = 57.5*10**(-6);\t\t\t#[m**(3)/mol]\n", + "V_water_bar = 16*10**(-6);\t\t\t#[m**(3)/mol]\n", + "\n", + "#The molar volumes of the pure components are\n", + "V_ethanol = 57.9*10**(-6);\t\t\t#[m**(3)/mol]\n", + "V_water = 18*10**(-6);\t\t\t#[m**(3)/mol]\n", + "\n", + "#The molar volume of the solution is\n", + "V_sol = x_ethanol*V_ethanol_bar + x_water*V_water_bar;\t\t\t#[m**(3)/mol]\n", + "#Total number of moles can be calculated as \n", + "n_total = Vol_total/V_sol;\t\t\t#[mol]\n", + "\n", + "#Moles of the components are\n", + "n_ethanol = n_total*x_ethanol;\t\t\t#[mol]\n", + "n_water = n_total*x_water;\t\t\t#[mol]\n", + "\n", + "#Finally the volume of the pure components required can be calculated as\n", + "Vol_ethanol = V_ethanol*n_ethanol;\n", + "Vol_water = V_water*n_water;\n", + "\n", + "# Results\n", + "print \"Required volume of ethanol is %f cubic metre\"%(Vol_ethanol);\n", + "print \"Required volume of water is %f cubic metre\"%(Vol_water);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Required volume of ethanol is 2.548166 cubic metre\n", + "Required volume of water is 0.528117 cubic metre\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 11.2 Page Number : 385" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Developing an expression\n", + "\n", + "# Variables\n", + "T = 25+273.15;\t\t\t#[K] - Temperature\n", + "P = 1;\t\t\t#[atm]\n", + "#Component 1 = water\n", + "#component 2 = methanol\n", + "a = -3.2;\t\t\t#[cm**(3)/mol] - A constant\n", + "V2 = 40.7;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 2 (methanol)\n", + "#V1_bar = 18.1 + a*x_2**(2)\n", + "\n", + "# Calculations and Results\n", + "#From Gibbs-Duhem equation at constant temperature and pressure we have\n", + "#x_1*dV1_bar + x_2*dV2_bar = 0\n", + "#dV2_bar = -(x_1/x_2)*dV1_bar = -(x_1/x_2)*a*2*x_2*dx_2 = -2*a*x_1*dx_2 = 2*a*x_1*dx_1\n", + "\n", + "#At x_1 = 0: x_2 = 1 and thus V2_bar = V2\n", + "#Integrating the above equation from x_1 = 0 to x_1 in the RHS, and from V2_bar = V2 to V2 in the LHS, we get\n", + "#V2_bar = V2 + a*x_1**(2) - Molar volume of component 2(methanol) in the mixture \n", + "\n", + "print \"The expression for the partial molar volume of methanol2 isV2_bar = V2 + a*x_1**2 [cm**3/mol]\";\n", + "\n", + "#At infinite dilution, x_2 approach 0 and thus x_1 approach 1, therefore\n", + "x_1 = 1;\t\t\t# Mole fraction of component 1(water) at infinite dilution\n", + "V2_bar_infinite = V2 + a*(x_1**(2));\t\t\t#[cm**(3)/mol]\n", + "\n", + "print \"The partial molar volume of methanol at infinite dilution is %f cm**3/mol\"%(V2_bar_infinite);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The expression for the partial molar volume of methanol2 isV2_bar = V2 + a*x_1**2 [cm**3/mol]\n", + "The partial molar volume of methanol at infinite dilution is 37.500000 cm**3/mol\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 11.4 Page Number : 387" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Calculation of enthalpies\n", + "\n", + "# Variables\n", + "#H = a*x_1 + b*x_2 +c*x_1*x_2\n", + "\n", + "#The values of the constants are\n", + "a = 15000;\t\t\t#[J/mol]\n", + "b = 20000;\t\t\t#[J/mol]\n", + "c = -2000;\t\t\t#[J/mol]\n", + "\n", + "# Calculations and Results\n", + "#(1)\n", + "#Enthalpy of pure component 1 = H1 is obtained at x_2 = 0, thus \n", + "x_2 = 0;\n", + "x_1 = 1;\n", + "H1 = a*x_1 + b*x_2 +c*x_1*x_2;\t\t\t#[J/mol]\n", + "print \"a).The enthalpy of pure component 1 is %f J/mol\"%(H1);\n", + "\n", + "#Similarly for component 2,\n", + "#Enthalpy of pure component 2 = H2 is obtained at x_1 = 0, thus \n", + "x_1_prime = 0;\n", + "x_2_prime = 1;\n", + "H2 = a*x_1_prime + b*x_2_prime +c*x_1_prime*x_2_prime;\t\t\t#[J/mol]\n", + "print \" The enthalpy of pure component 2 is %f J/mol\"%(H2);\n", + "\n", + "#(b)\n", + "#This part involves proving a relation in which no mathematics and no calculations are involved.\n", + "#For prove refer to this example 11.4 on page number 387 of the book.\n", + "\n", + "#(c)\n", + "#From part (b), we have the relation\n", + "#H1_bar = a + c*(x_2**(2))\n", + "#H2_bar = b + c*(x_1**(2))\n", + "\n", + "#For enthalpy of component 1 at infinite dilution, x_1 approach 0 and thus x_2 approach 1, therefore\n", + "x_1_c = 0;\n", + "x_2_c = 1;\n", + "H1_infinite = a + c*(x_2_c**(2));\t\t\t#[cm**(3)/mol]\n", + "print \"C).The enthalpy of componenet 1 at infinite dilution at x_1 = 0) is %f J/mol\"%(H1_infinite);\n", + "\n", + "#At x_1 = 0.2\n", + "x_1_c1 = 0.2;\n", + "x_2_c1 = 0.8;\n", + "H1_bar_c1 = a + c*(x_2_c1**(2));\t\t\t#[J/mol]\n", + "print \" The enthalpy of componenet 1 at at x_1 = 0.2) is %f J/mol\"%(H1_bar_c1);\n", + "\n", + "#At x_1 = 0.8\n", + "x_1_c2 = 0.8;\n", + "x_2_c2 = 0.2;\n", + "H1_bar_c2 = a + c*(x_2_c2**(2));\t\t\t#[J/mol]\n", + "print \" The enthalpy of componenet 1 at at x_1 = 0.8) is %f J/mol\"%(H1_bar_c2);\n", + "\n", + "#As x_1 increases, 'H1_bar' approaches the value of 'H1' \n", + "\n", + "#(d)\n", + "#This part involves proving a relation in which no mathematics and no calculations are involved.\n", + "#For prove refer to this example 11.4 on page number 387 of the book.\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "a).The enthalpy of pure component 1 is 15000.000000 J/mol\n", + " The enthalpy of pure component 2 is 20000.000000 J/mol\n", + "C).The enthalpy of componenet 1 at infinite dilution at x_1 = 0) is 13000.000000 J/mol\n", + " The enthalpy of componenet 1 at at x_1 = 0.2) is 13720.000000 J/mol\n", + " The enthalpy of componenet 1 at at x_1 = 0.8) is 14920.000000 J/mol\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 11.9 Page Number : 395" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Calculation of minimum work required\n", + "\n", + "# Variables\n", + "n = 1*10**(3);\t\t\t#[mol] - No of moles\n", + "P = 0.1;\t\t\t#[MPa] - Pressure of the surrounding\n", + "T = 300;\t\t\t#[K] - Temperature of the surrounding\n", + "x_1 = 0.79;\t\t\t#Mole fraction of N2 in the air\n", + "x_2 = 0.21;\t\t\t#Mole fraction of O2 in the air\n", + "R=8.314;\t\t\t#[J/mol*K]\n", + "\n", + "# Calculations\n", + "#Change in availability when x_1 moles of component 1 goes from pure state to that in the mixture is\n", + "#x_1*(si_1 - si_2) = x_1*[H1 - H1_bar - T_0*(S1 - S1_bar)]\n", + "#Similarly change in availability of x_2 moles of component 2 is\n", + "#x_2*(si_1 - si_2) = x_2*[H2 - H2_bar - T_0*(S2 - S2_bar)]\n", + "\n", + "#and thus total availability change when 1 mol of mixture is formed from x_1 mol of component 1 and x_2 mol of component 2 is equal to reversible work\n", + "#W_rev = x_1*[H1 - H1_bar - T_0*(S1 - S1_bar)] + x_2*[H2 - H2_bar - T_0*(S2 - S2_bar)]\n", + "#W_rev = -[x_1*(H1_bar - H1) + x_2*(H2_bar - H2)] + T_0*[x_1*(S1_bar - S1) + x_2*(S2_bar - S2)]\n", + "#W_rev = -[delta_H_mix] +T_0*[delta_S_mix]\n", + "\n", + "#If T = T_0 that is,temperature of mixing is same as that of surroundings, W_rev = -delta_G_mix.\n", + "#W_rev = -delta_G_mix = R*T*(x_1*math.log(x_1) + x_2*math.log(x_2))\n", + "W_rev = R*T*(x_1*math.log(x_1) + x_2*math.log(x_2));\t\t\t#[J/mol]\n", + "\n", + "#Therefore total work transfer is given by\n", + "W_min = (n*W_rev)/1000;\t\t\t#[kJ]\n", + "\n", + "# Results\n", + "print \"The minimum work required is %f kJ\"%(W_min);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The minimum work required is -1281.910728 kJ\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 11.10 Page Number : 400" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Calculation of fugacity 0f the mixture\n", + "\n", + "# Variables\n", + "x_A = 0.20;\t\t\t# Mole fraction of A\n", + "x_B = 0.35;\t\t\t# Mole fraction of B\n", + "x_C = 0.45;\t\t\t# Mole fraction of C\n", + "\n", + "phi_A = 0.7;\t\t\t# Fugacity coefficient of A\n", + "phi_B = 0.6;\t\t\t# Fugacity coefficient of B\n", + "phi_C = 0.9;\t\t\t# Fugacity coefficient of C\n", + "\n", + "P = 6.08;\t\t\t#[MPa] - Pressure\n", + "T = 384;\t\t\t#[K] - Temperature\n", + "\n", + "# Calculations\n", + "#We know that\n", + "#math.log(phi) = x_1*math.log(phi_) + x_2*math.log(phi_2) + x_3*math.log(phi_3)\n", + "math.log_phi = x_A*math.log(phi_A) + x_B*math.log(phi_B) + x_C*math.log(phi_C);\t\t\t# Fugacity coefficient\n", + "phi = math.exp(math.log_phi);\n", + "\n", + "#Thus fugacity is given by,\n", + "f_mixture = phi*P;\t\t\t#[MPa]\n", + "\n", + "# Results\n", + "print \"The fugacity of the mixture is %f MPa\"%(f_mixture);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The fugacity of the mixture is 4.515286 MPa\n" + ] + } + ], + "prompt_number": 5 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |