diff options
author | Thomas Stephen Lee | 2015-09-04 22:04:10 +0530 |
---|---|---|
committer | Thomas Stephen Lee | 2015-09-04 22:04:10 +0530 |
commit | 41f1f72e9502f5c3de6ca16b303803dfcf1df594 (patch) | |
tree | f4bf726a3e3ce5d7d9ee3781cbacfe3116115a2c /Chemical_Engineering_Thermodynamics_by_P_Ahuja/ch8_2.ipynb | |
parent | 9c9779ba21b9bedde88e1e8216f9e3b4f8650b0e (diff) | |
download | Python-Textbook-Companions-41f1f72e9502f5c3de6ca16b303803dfcf1df594.tar.gz Python-Textbook-Companions-41f1f72e9502f5c3de6ca16b303803dfcf1df594.tar.bz2 Python-Textbook-Companions-41f1f72e9502f5c3de6ca16b303803dfcf1df594.zip |
add/remove/update books
Diffstat (limited to 'Chemical_Engineering_Thermodynamics_by_P_Ahuja/ch8_2.ipynb')
-rwxr-xr-x | Chemical_Engineering_Thermodynamics_by_P_Ahuja/ch8_2.ipynb | 752 |
1 files changed, 752 insertions, 0 deletions
diff --git a/Chemical_Engineering_Thermodynamics_by_P_Ahuja/ch8_2.ipynb b/Chemical_Engineering_Thermodynamics_by_P_Ahuja/ch8_2.ipynb new file mode 100755 index 00000000..6b83d68c --- /dev/null +++ b/Chemical_Engineering_Thermodynamics_by_P_Ahuja/ch8_2.ipynb @@ -0,0 +1,752 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:8df6804e24ffba947b26128cacd98ede56f82be4a3089c7567d672249f51ebda" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "\n", + "Chapter 8 : Thermodynamic Cycles" + ] + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 8.1 Page Number : 287" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " \n", + "import math\n", + "\n", + "# Variables\n", + "P_1 = 30;\t\t\t#[bar]\n", + "P_2 = 0.04;\t\t\t#[bar]\n", + "\n", + "\t\t\t#(1).Carnot cycle\n", + "\t\t\t#It has been reported in the book that at 30 bar pressure (saturated) :\n", + "H_liq_1 = 1008.42;\t\t\t#[kJ/kg]\n", + "H_vap_1 = 2804.2;\t\t\t#[kJ/kg]\n", + "S_liq_1 = 2.6457;\t\t\t#[kJ/kg-K]\n", + "S_vap_1 = 6.1869;\t\t\t#[kJ/kh-K]\n", + "\t\t\t#Therefore, H_1 = H_liq_1, H_2 = H_vap_1, S_1 = S_liq_1 and S_2 = S_vap_1\n", + "H_1 = H_liq_1;\n", + "H_2 = H_vap_1;\n", + "S_1 = S_liq_1;\n", + "S_2 = S_vap_1;\n", + "\n", + "#At 0.04 bar pressure (saturated) :\n", + "H_liq_2 = 121.46;\t\t\t#[kJ/kg]\n", + "H_vap_2 = 2554.4;\t\t\t#[kJ/kg]\n", + "S_liq_2 = 0.4226;\t\t\t#[kJ/kg-K]\n", + "S_vap_2 = 8.4746;\t\t\t#[kJ/kh-K]\n", + "\n", + "# Calculations and Results\n", + "\t\t\t#Dryness fraction at state 3 can be found the fact that S_3 = S_2 \n", + "x_3 = (S_2 - S_liq_2)/(S_vap_2 - S_liq_2);\n", + "H_3 = H_liq_2*(1 - x_3) + x_3*H_vap_2;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Dryness fraction at state 4 can be found the fact that S_4 = S_1\n", + "x_4 = (S_1 - S_liq_2)/(S_vap_2 - S_liq_2);\n", + "H_4 = H_liq_2*(1 - x_4) + x_4*H_vap_2;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Work done by turbine W_tur = -delta_H = -(H_3 - H_2)\n", + "W_tur = H_2 - H_3;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Work supplied by boiler,\n", + "q_H = H_2 - H_1;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Work transfer in compressor is given by\n", + "W_com = -(H_1 - H_4);\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Efficiency can now be calculated as\n", + "\t\t\t#n = (Net work done/Work supplied by boiler)\n", + "n_carnot = (W_tur + W_com)/q_H;\n", + "\n", + "\t\t\t#Efficiency of the Carnot cycle can also be determined from the formula\n", + "\t\t\t# n = 1 - (T_L/T_H), Where T_L is saturated temperature at 0.04 bar and T_H is saturated temperature at 30 bar\n", + "\n", + "print \"1.Carnot cycle\";\n", + "print \"The work done by the turbine is %f kJ/kg\"%(W_tur);\n", + "print \"The heat transfer in the boiler is %f kJ/kg\"%(q_H);\n", + "print \"The cycle efficiency is %f\"%(n_carnot);\n", + "\n", + "\t\t\t#(2).Rankine cycle\n", + "\t\t\t#The enthalpies at state 2 and 3 remain as in the Carnot cycle\n", + "\t\t\t#Saturated liquid enthalpy at 0.04 bar is \n", + "H_4_prime = H_liq_2;\n", + "\n", + "\t\t\t#Saturated liquid volume at 0.04 bar as reported in the book is\n", + "V_liq = 0.001004;\t\t\t#[m**(3)/kg]\n", + "\t\t\t#Work transfer in pump can be calculated as\n", + "W_pump = -V_liq*(P_1 - P_2)*100;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Work transfer around pump gives, W_pump = -delta_H = -(H_1_prime - H_4_prime);\n", + "H_1_prime = H_4_prime - W_pump;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Heat supplied to boiler is\n", + "q_H_prime = H_2 - H_1_prime;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Work done by turbine is\n", + "W_tur_prime = H_2 - H_3;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Efficiency can now be calculated as\n", + "\t\t\t#n = (Net work done/Heat input)\n", + "n_rankine = (W_tur_prime + W_pump)/q_H_prime;\t\t\t#\n", + "\n", + "print \"2.Rankine cycle\";\n", + "print \"The work done by the turbine is %f kJ/kg\"%(W_tur_prime);\n", + "print \"The heat transfer in the boiler is %f kJ/kg\"%(q_H_prime);\n", + "print \"The cycle efficiency is %f\"%(n_rankine);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "1.Carnot cycle\n", + "The work done by the turbine is 941.036567 kJ/kg\n", + "The heat transfer in the boiler is 1795.780000 kJ/kg\n", + "The cycle efficiency is 0.404166\n", + "2.Rankine cycle\n", + "The work done by the turbine is 941.036567 kJ/kg\n", + "The heat transfer in the boiler is 2679.732016 kJ/kg\n", + "The cycle efficiency is 0.350046\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 8.2 Page Number : 288" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " \n", + "T_max = 700+273.15;\t\t\t#[K] - Maximum temperature.\n", + "P_boiler = 10*10**(6);\t\t\t#[Pa] - Constant pressure in the boiler\n", + "P_condenser = 10*10**(3);\t\t\t#[Pa] - Constant pressure in the condenser\n", + "\n", + "\t\t\t#At state 2 i.e, at 700 C and 10 MPa,it has been reported in the book that from steam table\n", + "S_2 = 7.1687;\t\t\t#[kJ/kg-K] - Entropy\n", + "H_2 = 3870.5;\t\t\t#[kJ/kg] - Enthalpy\n", + "\n", + "\t\t\t#At state 3 i.e, at 700 C and 10 KPa,\n", + "S_3 = S_2;\t\t\t#[kJ/kg-K]- Entropy \n", + "\n", + "\t\t\t#For sturated steam at 10 kPa, it has been reported in the book that from steam table\n", + "S_liq = 0.6493;\t\t\t#[kJ/kg-K]- Entropy of saturated liquid\n", + "S_vap = 8.1502;\t\t\t#[kJ/kg-K] - Enthalpy of saturated liquid\n", + "\t\t\t#Therefore steam is saturated and its dryness factor can be calculated as\n", + "x = (S_2 - S_liq)/(S_vap - S_liq);\n", + "\n", + "# Calculations and Results\n", + "\t\t\t#The enthalpy at state 3 is now calculated. For steam at 10 kPa,it has been reported in the book that from steam table\n", + "H_liq = 191.83;\t\t\t#[kJ/kg]\n", + "H_vap = 2584.7;\t\t\t#[kJ/kg]\n", + "\t\t\t#Therefore enthalpy at state 3 is\n", + "H_3 = H_liq*(1-x) + H_vap*x;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Work done by the turbine \n", + "W_tur = -(H_3 - H_2);\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Now we have to calculate work input to the pump\n", + "\t\t\t#State 4:Saturated liquid at 10 kPa\n", + "\t\t\t#State 4:Compressed liquid at 10 MPa\n", + "\t\t\t#Since volume of liquid does not get affected by pressure we take volume of saturated liquid at 10 kPa,\n", + "V_liq = 0.001010;\t\t\t#[m**(3)/kg]\n", + "\n", + "\t\t\t#Work transfer in the pump is\n", + "W_pump = -V_liq*(P_boiler - P_condenser)*10**(-3);\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Energy balance around pump gives, W_pump = -delta_H = -(H_1 - H_4)\n", + "H_4 = H_liq;\t\t\t# Enthalpy at state 4 (saturated liquid at 10 kPa)\n", + "H_1 = H_4 - W_pump;\t\t\t#[kJ/kg]\n", + " \n", + "\t\t\t#Heat supplied to boiler is\n", + "q_H = H_2 - H_1;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Efficiency can now be calculated as\n", + "\t\t\t#n = (Net work done/Heat input)\n", + "n_rankine = (W_tur + W_pump)/q_H;\n", + "\n", + "print \"The efficiency of the Rankine cycle is found to be %f\"%(n_rankine);\n", + "\n", + "\t\t\t#Now let us determine the efficiency of Carnot cycle. The maximun temperature is 700 C and minimum temperature is that of saturated steam at 10 kPa,\n", + "T_min = 45.81 + 273.15;\t\t\t#[K] - From steam table as reported in the book\n", + "n_carnot = 1-(T_min/T_max);\n", + "\t\t\t#Note that the efficiency of Rankine cycle is less than that of carnot cycle" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The efficiency of the Rankine cycle is found to be 0.433088\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 8.3 Page Number : 291" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " \n", + "W = 1.1;\t\t\t#[kW] - Work done per ton of refrigeration \n", + "\t\t\t#1 ton refrigeration = 3.517 kW, therefore\n", + "H = 3.517;\t\t\t#[kW] - Heat absorbed\n", + "T_low = -30 + 273.15;\t\t\t#[K] - Low temperature maintained\n", + "\n", + "# Calculations\n", + "\t\t\t#COP can be calculated as\n", + "\t\t\t#COP = (Heat absorbed/Work done)\n", + "COP = H/W;\n", + "\n", + "\t\t\t#For reversed carnot cycle, COP = T_low/(T_high - T_low). Solving this we get\n", + "T_high = (T_low/COP) + T_low;\t\t\t#[K] - Higher temperature\n", + "\n", + "\t\t\t#Heat rejected is\n", + "H_rej = W + H;\t\t\t#[kW];\n", + "\n", + "# Results\n", + "print \"The COP is %f\"%(COP);\n", + "print \"The higher temperature of the cycle is %f K\"%(T_high);\n", + "print \"The heat rejected per ton of refrigeration is %f kW\"%(H_rej);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The COP is 3.197273\n", + "The higher temperature of the cycle is 319.199190 K\n", + "The heat rejected per ton of refrigeration is 4.617000 kW\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 8.4 Page Number : 292" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " \n", + "T_high = 20 + 273.15;\t\t\t#[K] - High temperature\n", + "T_low = 0 + 273.15;\t\t\t#[K] - Low temperature\n", + "Q_H = 10;\t\t\t#[kW] - Heat supplied\n", + "\n", + "# Calculations\n", + "\t\t\t#If 'Q_H' is the rate at which heat is taken from surrounding and 'W' is the rate at which work is done,then\n", + "\t\t\t# Q_H = W + Q_L\n", + "\t\t\t#(Q_H/Q_L) = (T_high/T_low)\n", + "\t\t\t#Also for a reversible cycle, (Q_H/Q_L) = 1 + (W/Q_L). Solving we get,\n", + "Q_L = (T_low/T_high)*Q_H;\t\t\t#[kW]\n", + "W = (Q_H - Q_L) ;\t\t\t#[kW]\n", + " \n", + "# Results\n", + "print \"The minimum power required is %f kW\"%(W);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The minimum power required is 0.682245 kW\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 8.5 Page Number : 292" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " \n", + "T_high = 40 + 273.15;\t\t\t#[K] - High temperature\n", + "T_low = -20 + 273.15;\t\t\t#[K] - Low temperature\n", + "C = 10;\t\t\t#[tons of refrigeration] - Capacity\n", + "\t\t\t#1 ton refrigeration = 3.517 kW, therefore\n", + "H = C*3.517;\t\t\t#[kW] - Heat absorbed\n", + "\n", + "# Calculations\n", + "\t\t\t#For reversed carnot cycle, COP = T_low/(T_high - T_low)\n", + "COP = T_low/(T_high - T_low);\n", + "\n", + "\t\t\t# COP = (Refrigerating effect)/(Work input), therefore power required is given by\n", + "P = (H/COP);\t\t\t#[kW]\n", + "\n", + "# Results\n", + "print \"The COP is %f\"%(COP);\n", + "print \"The power required is %f kW\"%(P);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The COP is 4.219167\n", + "The power required is 8.335769 kW\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 8.6 Page Number : 292" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " \n", + "COP = 4;\t\t\t#Coefficient of performance\n", + "P = 10;\t\t\t#[kW] - Work done on the cycle\n", + "\n", + "# Calculations\n", + "\t\t\t#For reversed carnot cycle, COP = T_low/(T_high - T_low)\n", + "\t\t\t#ratio = (T_high/T_low),therefore\n", + "ratio = -1/(COP + 1);\n", + "\n", + "\t\t\t# Refrigerating effect = (COP)*Work input, therefore refrigeration is given by\n", + "H = COP*P;\t\t\t#[kW]\n", + "\n", + "\t\t\t#Maximum refrigearation in tons is given by\n", + "H_max = (H/3.517);\n", + "\n", + "# Results\n", + "print \"The maximum refrigeration value is %f ton\"%(H_max);\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The maximum refrigeration value is 11.373330 ton\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 8.7 Page Number : 292" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " \n", + "m = 0.6;\t\t\t#[kg/s] - mass flow rate\n", + "T_low = -20+273.15;\t\t\t#[K] - Temperature at which vapour enters the compressor\n", + "T_high = 30+273.15;\t\t\t#[K] - Temperature at which vapour leaves the condenser\n", + "\n", + "\t\t\t#From saturated refrigeration-12 tables we get,at -20 C\n", + "H_1 = 178.74;\t\t\t#[kJ/kg] - (H_1 = H_vap)\n", + "P_1 = 0.15093;\t\t\t#[MPa] - (P_1 = P_sat)\n", + "P_4 = P_1;\n", + "S_1 = 0.7087;\t\t\t#[kJ/kg-K] - (S_1 = S_vap)\n", + "S_2 = S_1;\n", + "\n", + "\t\t\t#At 30 C\n", + "P_2 = 0.7449;\t\t\t#[MPa] - (P_2 = P_sat)\n", + "P_3 = P_2;\n", + "H_3 = 64.59;\t\t\t#[kJ/kg] - (H_3 = H_liq)\n", + "H_4 = H_3;\n", + "S_3 = 0.24;\t\t\t#[kJ/kg-K] - (S_3 = S_liq)\n", + "\n", + "# Calculations and Results\n", + "\t\t\t#It is assumed that presssure drop in the evaporator and condenser are negligible. The heat transfer rate in the evaporator is\n", + "Q_L = m*(H_1 - H_4);\n", + "\n", + "print \"The heat transfer rate in the evaporator is %f kW\"%(Q_L);\n", + "\n", + "\t\t\t#At state 2 (P = 0.7449 MPa and S = 0.7087 kJ/kg-K) and looking in the superheated tables we have to calculate the enthalpy at state 2\n", + "\n", + "\t\t\t#At P = 0.7 MPa and S = 0.6917 kJ/kg-K,\n", + "H_11 = 200.46;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#At P = 0.7 MPa and S = 0.7153 kJ/kg-K,\n", + "H_12 = 207.73;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Thus at P = 0.7 MPa and S = 0.7087 kJ/kg-K, enthalpy is given by\n", + "H_13 = ((S_2 -0.6917)/(0.7153 - 0.6917))*(H_12 - H_11) + H_11;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#At P = 0.8 MPa and S = 0.7021 kJ/kg-K,\n", + "H_21 = 206.07;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#At P = 0.8 MPa and S = 0.7253 kJ/kg-K,\n", + "H_22 = 213.45;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Thus at P = 0.8 MPa and S = 0.7087 kJ/kg-K, enthalpy is given by\n", + "H_23 = ((S_2 -0.7021)/(0.7253 - 0.7021))*(H_22 - H_21) + H_21;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#At P = 0.7449 MPa, S = 0.7087 kJ/kg-K, the enthalpy is\n", + "H_2 = ((0.7449 - 0.7)/(0.8 - 0.7))*(H_23 - H_13) + H_13;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#Power consumed by the compressor is\n", + "W_comp = m*(H_2 - H_1);\t\t\t#[kW]\n", + "\n", + "print \"The power consumed by the compressor is %f kW\"%(W_comp);\n", + "\n", + "\t\t\t#Heat removed in evaporator/work done on compressor\n", + "COP_R = Q_L/W_comp;\n", + "\n", + "print \"The COP the refrigerator is %f kW\"%(COP_R);\n", + "\n", + "\n", + "\t\t\t#At -20 C,saturated conditions \n", + "H_liq = 17.82;\t\t\t#[kJ/kg]\n", + "H_vap = 178.74;\t\t\t#[kJ/kg]\n", + "x_4 = (H_4 - H_liq)/(H_vap - H_liq);\n", + "\n", + "print \"The dryness factor of refrigerant after the expansion valve is %f\"%(x_4);\n", + "\n", + "\t\t\t#The heat transfer rate in the condenser is\n", + "Q_H = m*(H_3 - H_2);\t\t\t#[kW]\n", + "\n", + "print \"The heat transfer rate in the condenser is %f kW\"%(Q_H);\n", + "\n", + "\t\t\t#If the cycle would have worked as a pump then,\n", + "\t\t\t#COP_HP = (Heat supplied from condenser/Work done on compressor)\n", + "COP_HP = (-Q_H)/W_comp;\n", + "\n", + "print \"The COP if cycle would work as a heat pump is %f kW\"%(COP_HP);\n", + "\n", + "\t\t\t#If the cycle would have been a reversed Carnot cycle then\n", + "COP_C = T_low/(T_high - T_low);\n", + "\n", + "print \"The COP if cycle would run as reversed Carnot cycle is %f kW\"%(COP_C);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The heat transfer rate in the evaporator is 68.490000 kW\n", + "The power consumed by the compressor is 16.840242 kW\n", + "The COP the refrigerator is 4.067044 kW\n", + "The dryness factor of refrigerant after the expansion valve is 0.290641\n", + "The heat transfer rate in the condenser is -85.330242 kW\n", + "The COP if cycle would work as a heat pump is 5.067044 kW\n", + "The COP if cycle would run as reversed Carnot cycle is 5.063000 kW\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 8.8 Page Number : 300" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " \n", + "from scipy.optimize import fsolve \n", + "import math \n", + "\t\t\n", + "\n", + "# Variables\n", + "H_1 = 310.38;\t\t\t#[kJ/kg]\n", + "H_2 = 277.7;\t\t\t#[kJ/kg]\n", + "H_5 = -122.6;\t\t\t#[kJ/kg]\n", + "H_6 = 77.8;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#The enthalpy at point 3 is same at point 4 as the expansion is isenthalpic\n", + "\n", + "# Calculations and Results\n", + "\t\t\t#The mass condensed is 1 kg and therefore m_1 = m+6 + 1\n", + "\n", + "\t\t\t#Enthalpy balance around heat exchanger\n", + "\t\t\t#m_2*H_2 + m_2*H_6 = m_3*H_3 + m_7*H_7\n", + "\n", + "\t\t\t#Enthalpy balance around separator\n", + "\t\t\t#m_4*H_4 = m_5*H_5 + m_6*H_6\n", + "\t\t\t#It can be seen that m_1 = m_2 = m_3 = m_4\n", + "\t\t\t#and m_6 = m_7 = m_1 - 1\n", + "\n", + "\t\t\t#Substituting the values for enthalpy balance around heat exchanger we get,\n", + "\t\t\t#m_1*H_2 + (m_1 - 1)*(H_6) = m_1*H_3 + (m_1 - 1)*H_1\n", + "\t\t\t#and substituting the values for enthalpy balance around seperator we get\n", + "\t\t\t#m_1*H_3 = (1)*(-122.6) + (m_1 - 1)*77.8\n", + "\t\t\t#H_3 = ((1)*(-122.6) + (m_1 - 1)*77.8)/m_1\n", + "\t\t\t#Substituting the expression for 'H_3' in the above equation and then solving for m_1, we get\n", + "def f(m_1): \n", + "\t return m_1*H_2+(m_1-1)*(H_6)-m_1*(((1)*(-122.6) + (m_1 - 1)*77.8)/m_1)-(m_1-1)*H_1\n", + "m_1 = fsolve(f,4)\n", + "\t\t\t#Thus to liquify 1 kg of air compression of m_1 kg of air is carried out.\n", + "\n", + "\t\t\t#Now substituting this value of m_1 to get the value of H_3,\n", + "H_3 = ((1)*(-122.6) + (m_1 - 1)*77.8)/m_1;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#From given compressed air table we see at 200 bar and 160 K,\n", + "H_3_1 = 40.2;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#At 200 bar and 180 K,\n", + "H_3_2 = 79.8;\t\t\t#[kJ/kg]\n", + "\t\t\t#By interpolation we get,\n", + "T_3 = ((H_3 - H_3_1)*(180 - 160))/(H_3_2 - H_3_1) + 160;\t\t\t#[K]\n", + "\n", + "print \"Temperature before throttling is %f K\"%(T_3);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature before throttling is 171.350719 K\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 8.9 Page Number : 304" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " \n", + "# Variables\n", + "\t\t\t#At 1 bar, 310 K \n", + "H_1 = 310.38;\t\t\t#[kJ/kg]\n", + "\t\t\t#At 200 bar, 310 K\n", + "H_2 = 277.7;\t\t\t#[kJ/kg]\n", + "\t\t\t#At 1 bar, Saturated liquid\n", + "H_7 = -122.6;\t\t\t#[kJ/kg]\n", + "\t\t\t#At 1 bar, Saturated vapour\n", + "H_8 = 77.8;\t\t\t#[kJ/kg]\n", + "\t\t\t#At 200 bar, 200 K\n", + "H_3 = 117.6;\t\t\t#[kJ/kg]\n", + "\t\t\t#At 1 bar, 100 K\n", + "H_11 = 98.3;\t\t\t#[kJ/kg]\n", + "\n", + "# Calculations and Results\n", + "\t\t\t#For 1 kg of liquid air obtained,the overall enthalpy balance is\n", + "\t\t\t#m_2*H_2 = W - 122.6 + (m_2 - 1)*H_1\n", + "\t\t\t#W = - 0.8*m_2*(H_11 - H_3)\n", + "\t\t\t#Overall enthalpy balance equation becomes\n", + "\t\t\t#H_2*m_2 = 15.44*m_2 - H_7 + (m_2 - 1)*H_1, solving\n", + "m_2_prime = (H_7 - H_1)/(H_2 - 15.44 - H_1);\n", + "\n", + "print \"The number of kimath.lograms of air compressed per kg of liquid air produced is %f kg\"%(m_2_prime);\n", + "\n", + "\t\t\t#(2)\n", + "\t\t\t#Enthalpy balance around separator is \n", + "\t\t\t#0.2*m_2*H_5 = -H_7 + (0.2*m_2 - 1)*H_8, solving\n", + "m_2 = m_2_prime;\n", + "H_5_prime = ((0.2*m_2-1)*H_8 - H_7)/(0.2*m_2);\n", + "\n", + "\t\t\t#At point 5, P = 200 bar and enthalpy is\n", + "H_5_1 = -33.53;\t\t\t#[kJ/kg]\n", + "\t\t\t#From compressed air tables at 200 bar and 140 K,\n", + "H_5_2 = 0.2;\t\t\t#[kJ/kg]\n", + "\t\t\t#At 200 bar and 120 K,\n", + "H_5_3 = -38.0;\t\t\t#[kJ/kg]\n", + "\t\t\t#Solving by interpolation we get\n", + "T_5 = ((H_5_1 - H_5_3)*(140 - 120))/(H_5_2 - H_5_3) + 120;\t\t\t#[K]\n", + "\n", + "print \"The temperature of air before throttling is %f K\"%(T_5);\n", + "\n", + "\t\t\t#(3)\n", + "\t\t\t#During mixing of streams 8 and 11 to produce stream 9, the enthalpy balance is\n", + "\t\t\t# (0.2*m_2 - 1)*H_8 + 0.8*m_2*H_11 = (m_2 - 1)*H_9,Solving for H_9\n", + "\n", + "H_9_prime = ((0.2*m_2-1)*H_8+0.8*m_2*H_11)/(m_2 - 1);\n", + "\n", + "\t\t\t#From given compressed air tables at 1 bar and 100 K,\n", + "H_9_1 = H_11;\n", + "\t\t\t#At 1 bar and 90 K \n", + "H_9_2 = 87.9;\t\t\t#[kJ/kg]\n", + "\t\t\t#Solving by interpolation we get\n", + "T_9 = ((H_9_prime - H_9_2)*(100 - 90))/(H_9_1 - H_9_2) + 90;\t\t\t#[K]\n", + "\n", + "print \"The temperature of stream entering second heat exchanger is %f K\"%(T_9);\n", + "\n", + "\t\t\t#(4)\n", + "\t\t\t#Enthalpy balance around first heat exchanger is\n", + "\t\t\t#H_2*m_2 + (m_2 - 1)*H_10 = H_3*m-2 + (m-2 - 1)*H_1, solving for H_10\n", + "\n", + "H_10_prime = ((m_2 - 1)*H_1 + H_3*m_2 - H_2*m_2)/(m_2 - 1);\n", + "\n", + "\t\t\t#From given compressed air tables at 1 bar and 140 K,\n", + "H_10_1 = 139.1;\t\t\t#[kJ/kg]\n", + "\t\t\t#At 1 bar and 120 K \n", + "H_10_2 = 118.8;\t\t\t#[kJ/kg]\n", + "\t\t\t#Solving by interpolation we get\n", + "T_10 = ((H_10_prime - H_10_2)*(140 - 120))/(H_10_1 - H_10_2) + 120;\t\t\t#[K]\n", + "\n", + "print \"The temperature of stream exiting second heat exchanger is %f K\"%(T_10);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The number of kimath.lograms of air compressed per kg of liquid air produced is 8.997922 kg\n", + "The temperature of air before throttling is 122.340314 K\n", + "The temperature of stream entering second heat exchanger is 98.029358 K\n", + "The temperature of stream exiting second heat exchanger is 131.292906 K\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 8.10 Page Number : 307" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " \n", + "P_high = 40;\t\t\t#[bar]\n", + "P_low = 5;\t\t\t#[bar]\n", + "m_1 = 0.5;\t\t\t#[kg/s] - Rate of mass moving through the expander\n", + "m_2 = 0.1;\t\t\t#[kg/s] - Rate of mass of vapour mixing with air\n", + "e = 0.7;\t\t\t#Efficiency\n", + "\n", + "\t\t\t#At state 3,(40 bar and 200 K),enthalpy and entropy is given by\n", + "H_3 = 179.7;\t\t\t#[kJ/kg]\n", + "S_3 = 5.330;\t\t\t#[kJ/kg-K]\n", + "\n", + "\t\t\t#If isentropic conditions exits in the turbine then state 11 is at 5 bar\n", + "S_11 = 5.330;\t\t\t#[kJ/kg-K]\n", + "\t\t\t#From given compressed air tables at 5 bar and 120 K,\n", + "H_11_1 = 113.6;\t\t\t#[kJ/kg]\n", + "S_11_1 = 5.455;\t\t\t#[kJ/kg-K]\n", + "\t\t\t#At 5 bar and 100 K \n", + "H_11_2 = 90.6;\t\t\t#[kJ/kg]\n", + "S_11_2 = 5.246;\t\t\t#[kJ/kg-K]\n", + "\t\t\t#The enthalpy has to be determined when S = S_3\n", + "\n", + "# Calculations and Results\n", + "\t\t\t#Solving by interpolation we get\n", + "H_11_s = ((H_11_1 - H_11_2)*(S_3 - S_11_2))/(S_11_1 - S_11_2) + H_11_2;\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#The adiabatic efficiency of tyrbine is given by\n", + "\t\t\t#(H_3 - H_11_a)/(H_3 - H_11_s) = e\n", + "H_11_a = H_3 - e*(H_3 - H_11_s);\t\t\t#[kJ/kg] - Actual enthalpy\n", + "\n", + " \t\t\t#At 5 bar,the saturated enthalpy is given to be\n", + "H_8 = 88.7;\t\t\t#[kJ/kg]\n", + "\t\t\t#From enthalpy balance during mixing we get,\n", + "\t\t\t#0.1*H_8 + 0.5*H_11_a = 0.6*H_9\n", + "H_9 = (m_2*H_8 + m_1*H_11_a)/(m_1 + m_2);\t\t\t#[kJ/kg]\n", + "\n", + "\t\t\t#From given compressed air tables at 5 bar and 140 K,\n", + "H_9_1 = 135.3;\t\t\t#[kJ/kg]\n", + "\t\t\t#At 5 bar and 120 K \n", + "H_9_2 = 113.6;\t\t\t#[kJ/kg]\n", + "\t\t\t#By interpolation we get\n", + "T_9 = ((H_9 - H_11_1)*(140 - 120))/(H_9_1 - H_11_1) + 120;\t\t\t#[K]\n", + "\n", + "print \" The temperature of air entering the second heat exchanger is %f K\"%(T_9);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The temperature of air entering the second heat exchanger is 124.009841 K\n" + ] + } + ], + "prompt_number": 10 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |