{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 5 : Second law of thermodynamics and its applications" ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.2 Page No : 161" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "# Variables\n", "Q = 1000.;\t\t \t #amount of energy absorbed by the heat engine in kJ/s\n", "W = 650.;\t\t\t #work delivered by the heat engine in kW\n", "T_source = 500. \t\t #temperature of the source in degree celsius\n", "T_sink = 25.\t\t\t #temperature of the sink in degree celsius\n", "\n", "# Calculations\n", "n_claimed = W/Q\n", "T1 = T_source+273.15\n", "T2 = T_sink+273.15\n", "n_carnot = 1-(T2/T1)\n", "\n", "# Results\n", "print \" The efficiency of the Carnot engine = %0.3f \"%(n_carnot);\n", "print \" The efficiency of the engine claimed by the inventor = %0.2f \"%(n_claimed);\n", "if n_claimed<n_carnot:\n", " print \" The claimed heat engine is theoretically feasible as the efficiency of the engine is lesser than that of a Carnot engine\";\n", "else:\n", " print \" The claimed heat engine is not theoretically feasible as the efficiency of the engine is greater than that of a Carnot engine\";\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The efficiency of the Carnot engine = 0.614 \n", " The efficiency of the engine claimed by the inventor = 0.65 \n", " The claimed heat engine is not theoretically feasible as the efficiency of the engine is greater than that of a Carnot engine\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.3 Page No : 165" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "T_source_summer = 42; #temperature in the summer months in degree celsius\n", "T_sink_winter = 0;\t #temperature in the winter months in degree celius\n", "T_amb = 25;\t\t\t #temperature at which the house is to be maintained during both the months in degree celsius\n", "energy_loss = 0.5;\n", "\n", "# Calculations\n", "T_H_summer = T_source_summer+273.15\n", "T_L_summer = T_amb+273.15\n", "T_H_winter = T_amb+273.15\n", "T_L_winter = T_sink_winter+273.15\n", "W_summer = (energy_loss*((T_H_summer-T_L_summer)**2))/(T_L_summer)\n", "W_winter = (energy_loss*((T_H_winter-T_L_winter)**2))/(T_H_winter)\n", "\n", "# Results\n", "print \" The minimum power required to operate the device in summer = %.4f kW \"%(W_summer);\n", "print \" The minimum power required to operate the device in winter = %f kW \"%(W_winter);\n", "\n", "# Note: Answer in book is wrong. Please calculated manually." ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The minimum power required to operate the device in summer = 0.4847 kW \n", " The minimum power required to operate the device in winter = 1.048130 kW \n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.4 Page No : 166" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "T_L = 4.25 \t\t\t #normal boiling point of helium in K\n", "Q_L = 0.083\t\t\t #latent heat of vaporization of helium in kJ/mol\n", "n = 1. \t\t\t #amount of liquid helium to be produced in kmol\n", "T_amb = 42.\t\t\t #ambient temperature in summer in degree celsius\n", "\n", "# Calculations\n", "T_H = T_amb+273.15\n", "COP = (T_L)/(T_H-T_L)\n", "W = (Q_L)/COP;\t\t\n", "\n", "# Results\n", "print \" The maximum possible COP of the unit = %0.4f \"%(COP);\n", "print \" The minimum amount of work to be done on the refrigerating unit = %f kJ \"%(W);\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The maximum possible COP of the unit = 0.0137 \n", " The minimum amount of work to be done on the refrigerating unit = 6.071694 kJ \n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.5 Page No : 166" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "T_ice = 0.;\t\t \t #temperature of the ice to be produced in degree celsius\n", "m = 5000.;\t\t\t #rate at which ice is to be produced in kg/hour\n", "T_water = 0.;\t \t\t #temperature of water used to produce ice in degree celsius\n", "T_amb = 40.;\t\t \t #ambient temperature in degree celsius\n", "T_source = 100.;\t\t\t #temperature of the source for operating heat engine in degree celsius\n", "lambda_fusion = 6.002;\t\t\t #latent heat of fusion of water in kJ/mol at 0 degree celsius\n", "molar_mass = 18*10**-3;\t\t\t #molar mass of water in kg/mol\n", "\n", "# Calculations\n", "T_L = T_water+273.15\n", "T_H = T_amb+273.15\n", "COP = (T_L)/(T_H-T_L)\n", "Q_L = ((m/3600)/molar_mass)*(lambda_fusion)\n", "W = (Q_L)/(COP);\t\t\t \n", "T1 = T_source+273.15;\t\t\n", "T2 = T_amb+273.15\n", "n_heatengine = (T1-T2)/T1\n", "Q1 = W/n_heatengine;\t\n", "energy_ratio = (Q1+Q_L)/Q_L;\n", "\n", "# Results\n", "print \" The minimum power required to operate the refrigerator = %0.2f kW\"%(W);\n", "print \" The maximum possible efficiency of the heat engine = %0.4f \"%(n_heatengine);\n", "print \" Ratio of the energy rejected to the ambient atmosphere to the\\\n", " energy absorbed from the water = %0.4f \"%(energy_ratio);\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The minimum power required to operate the refrigerator = 67.82 kW\n", " The maximum possible efficiency of the heat engine = 0.1608 \n", " Ratio of the energy rejected to the ambient atmosphere to the energy absorbed from the water = 1.9107 \n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.6 Page No : 169" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "T1 = 800.\t\t\t #temperature of reservoir 1 in K\n", "T2 = 400.\t\t\t #temperature of reservoir 2 in K\n", "Q1 = 1000.\t\t\t #energy absorbed from reservoir maintained at T1 in kJ\n", "Q2 = 400.\t\t\t #energy absorbed from reservoir maintained at T2 in kJ\n", "W = 1000.\t\t\t #work delivered by the heat engine in kJ\n", "T3 = 300.\t\t\t #temperature of the sink in K\n", "\n", "# Calculations\n", "Q3 = (Q1+Q2)-W\n", "clausius_inequality = (Q1/T1)+(Q2/T2)-(Q3/T3)\n", "\n", "# Results\n", "print \" The LHS of the Clausius inequality = %0.4f \"%(clausius_inequality);\n", "if clausius_inequality<0 or clausius_inequality == 0:\n", " print \" The given process does not violate the second law of thermodynamics, therefore the claim is correct\"\n", "else:\n", " print \" This is a violation of the second law of thermodynamics, and hence the claim cannot be justified\"\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The LHS of the Clausius inequality = 0.9167 \n", " This is a violation of the second law of thermodynamics, and hence the claim cannot be justified\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.7 Page No : 172" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "T_system = 200.;\t\t\t #temperature of the contents of reactor in degree celsius\n", "t = 15. \t\t\t #operation time of agitator in minutes\n", "P = 750. \t \t\t #power of the operating motor in W\n", "\n", "# Calculations\n", "dQ = P*t*60*10**-3\n", "T = T_system+273.15\n", "del_S = dQ/T;\t\t\n", "\n", "# Results\n", "print \" The change in the entropy of the reactor contents = %0.4f kJ/K \"%(del_S);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The change in the entropy of the reactor contents = 1.4266 kJ/K \n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.8 Page No : 172" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "\n", "# Variables\n", "P = 0.101325;\t\t\t #pressure in the piston cylinder assembly in MPa\n", "T1 = 300.;\t\t\t #temperature of the piston cylinder assembly in K\n", "T2 = 400;\t\t\t #final temperature of the piston cylinder assembly in K\n", "a = 45.369;\t\t\t #coefficients to compute isobaric molar heat capacity of CO2(g) in J/molK\n", "b = 8.688*10**-3;\t\t\t #coefficients to compute isobaric molar heat capacity of CO2(g) in J/molK\n", "e = 9.619*10**5;\t\t\t #coefficients to compute isobaric molar heat capacity of CO2(g) in J/molK\n", "\n", "# Calculations\n", "del_S = (a*math.log(T2/T1))+(b*(T2-T1))+((e)*((1./T2**2)-(1./T1**2)))\n", "\n", "# Results\n", "print \" The change in entropy of CO2 = %.4f J/molK\"%(del_S);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The change in entropy of CO2 = 9.2447 J/molK\n" ] } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.9 Page No : 173" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "m = 1. \t\t\t #amount of saturated liquid water in kg\n", "T_initial = 100.\t\t #initial temperature of water in degree celsius\n", "T_body = 500.\t\t\t #temperature of body which is brought into contact with the cylinder in degree celsius\n", "hfg = 2256.94\t\t\t #enthalpy of vaporization taken from steam tables corresponding to T1 in kJ/kg\n", "\n", "# Calculations\n", "T = T_initial+273.15\n", "del_S = hfg/T;\t\t\n", "\n", "# Results\n", "print \" The change in entropy of water = %0.4f kJ/kgK\"%(del_S);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The change in entropy of water = 6.0483 kJ/kgK\n" ] } ], "prompt_number": 9 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.10 Page No : 173" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "m_steel = 10. \t\t\t #mass of steel casting in kg\n", "T_steel = 800.\t \t\t #temperature of steel casting in degree celsius\n", "m_water = 100.\t\t \t #mass of water used for quenching in kg\n", "T_water = 30.\t\t\t #temperature of water used for quenching in degree celsius\n", "Cp_steel = 0.461;\t\t\t #heat capacity of steel in kJ/kgK\n", "Cp_water = 4.23;\t\t\t #heat capacity of water in kJ/kgK\n", "\n", "# Calculations\n", "Ti_steel = T_steel+273.15\n", "Ti_water = T_water+273.15\n", "T_final = ((m_steel*Cp_steel*Ti_steel)+(m_water*Cp_water*Ti_water))/((m_steel*Cp_steel)+(m_water*Cp_water));\n", "del_S_steel = m_steel*Cp_steel*math.log(T_final/Ti_steel)\n", "del_S_water = m_water*Cp_water*math.log(T_final/Ti_water)\n", "\n", "# Results\n", "print \" The change in entropy of steel = %0.4f kJ/K\"%(del_S_steel);\n", "print \" The change in entropy of water = %f kJ/K\"%(del_S_water);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The change in entropy of steel = -5.7031 kJ/K\n", " The change in entropy of water = 11.427392 kJ/K\n" ] } ], "prompt_number": 10 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.11 Page No : 175" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "V = 2.\t \t\t #volume of insulated tank in m**3\n", "Ta = 400.\t\t\t #temperature of gas in compartment (a) in K\n", "Pa = 3.\t\t \t #pressure of gas in compartment (a) in MPa\n", "Tb = 600.\t\t\t #temperature of gas in compartment (b) in K\n", "Pb = 1.\t\t\t #pressure of gas in compartment (b) in MPa\n", "R = 8.314;\t\t\t #universal gas constant in J/molK\n", "\n", "# Calculations\n", "Va = V/2\n", "Vb = V/2\n", "Na = (Pa*10**6*Va)/(R*Ta)\n", "Nb = (Pb*10**6*Vb)/(R*Tb)\n", "T = ((Na*Ta)+(Nb*Tb))/(Na+Nb)\n", "N = Na+Nb;\t\t\t \n", "P = ((N*R*T)/V)*10**-6\n", "Cp = (5./2)*R;\t\t\t\n", "del_S = ((Na*((Cp*math.log(T/Ta))-(R*math.log(P/Pa))))+(Nb*((Cp*math.log(T/Tb))-(R*math.log(P/Pb)))))*10**-3; # Calculations of the change in entropy using Eq.(5.43) in kJ/K\n", "\n", "# Results\n", "print \" Entropy change of the gas = %0.2f kJ/K\"%(del_S);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Entropy change of the gas = 2.19 kJ/K\n" ] } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.12 Page No : 177" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "# Variables\n", "N = 1.\t \t\t #amount of air to be separated into its components in kmol\n", "P = 0.1\t\t \t #pressure of air in MPa\n", "T = 300.\t\t\t #temperature of air in K\n", "per_oxygen = 21.\t\t\t #percentage of oxygen in air\n", "per_nitrogen = 79.\t\t\t #percentage of nitrogen in air\n", "R = 8.314;\t\t\t #universal gas constant in J/molK\n", "\n", "# Calculations\n", "\n", "x1 = per_nitrogen/100\n", "x2 = per_oxygen/100;\n", "W = (T*N*10**3*R*((x1*math.log (x1))+(x2*math.log (x2))))*10**-3\n", "\n", "# Results\n", "print \" Minimum work to be done to separate 1kmol of air at 0.1MPa and 300K into pure oxygen\\\n", " and nitrogen at the same temperature and pressure = %0.2f kJ\"%(abs(W));" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Minimum work to be done to separate 1kmol of air at 0.1MPa and 300K into pure oxygen and nitrogen at the same temperature and pressure = 1281.91 kJ\n" ] } ], "prompt_number": 15 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.13 Page No : 179" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "# Variables\n", "m_ice = 10.\t \t\t #mass of the block of ice in kg\n", "T_ice = 0.\t\t \t #temperature of the ice in degree celsius\n", "m_water = 100.\t\t\t #mass of watre in the tank in kg\n", "T_water = 30.\t\t\t #temperature of the water in the tank in degree celsius\n", "Cp = 4.23;\t\t\t #heat capacity of water in kJ/kgK\n", "lambda_melting = 333.44\t\t\t #latent heat of melting of ice in kJ/kg\n", "\n", "# Calculations\n", "Ti_ice = T_ice+273.15\n", "Ti_water = T_water+273.15\n", "T_final = ((m_water*Cp*Ti_water)+(m_ice*Cp*Ti_ice)-(m_ice*lambda_melting))/((m_ice*Cp)+(m_water*Cp))\n", "del_S_ice = ((m_ice*lambda_melting)/(Ti_ice))+(m_ice*Cp*math.log (T_final/Ti_ice));\t\t\t \n", "del_S_water = m_water*Cp*math.log (T_final/Ti_water)\n", "del_S_G = del_S_ice+del_S_water;\t\t\t \n", "\n", "# Results\n", "print \" The change in entropy of ice = %f kJ/K\"%(del_S_ice);\n", "print \" The change in entropy of water = %f kJ/K\"%(del_S_water);\n", "print \" The entropy generated = %f kJ/K\"%(del_S_G);\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The change in entropy of ice = 15.211650 kJ/K\n", " The change in entropy of water = -14.035033 kJ/K\n", " The entropy generated = 1.176617 kJ/K\n" ] } ], "prompt_number": 16 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.14 Page No : 182" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "P = 3.\t\t\t #pressure of superheated steam in MPa\n", "T_enter = 300.\t\t\t #entrance temperature of superheated steam in degree celsius\n", "T_exit = 45.\t\t\t #final temperature at which the steam leaves in degree celsisus\n", "m = 1. \t\t\t #mass flow rate of steam in kg/s\n", "\n", "# Calculations\n", "\n", "si = 6.5422\n", "hi = 2995.1\n", "sf = 0.6383\n", "hf = 188.35\n", "sg = 8.1661;\t\t\t #entropy of saturated vapour in kJ/kgK\n", "hg = 2583.3;\t\t\t #entahlpy of saturayed vapour in kJ/kg\n", "\n", "Xe = (si-sf)/(sg-sf)\n", "he = ((1-Xe)*hf)+(Xe*hg)\n", "Ws = -m*(he-hi);\t\t\n", "\n", "# Results\n", "print \" The power Results from the turbine = %0.1f kW\"%(Ws);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The power Results from the turbine = 928.4 kW\n" ] } ], "prompt_number": 17 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.15 Page No : 183" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "# Variables\n", "Pi = 3.\t\t\t #pressure of dry saturated steam when it enters the nozzle in bar\n", "Pe = 2.\t\t\t #pressure of dry saturated steam at the exit in bar\n", "\n", "# Calculations\n", "#From steam tables corresponding to Pi\n", "si = 6.9909;\t\t\t #entropy of steam at the entrance in kJ/kgK\n", "hi = 2724.7;\t\t\t #entahlpy of steam at the entrance in kJ/kg\n", "\n", "#From steam tables corresponding to Pe\n", "sf = 1.5301;\t\t\t #entropy of saturated liquid in kJ/kgK\n", "hf = 504.70;\t\t\t #enthalpy of saturated liquid in kJ/kg\n", "sg = 7.1268;\t\t\t #entropy of saturated vapour in kJ/kgK\n", "hg = 2706.3;\t\t\t #entahlpy of saturayed vapour in kJ/kg\n", "\n", "se = 6.9909\n", "Xe = (se-sf)/(sg-sf)\n", "he = ((1-Xe)*hf)+(Xe*hg)\n", "Ve = math.sqrt (2*(hi-he)*10**3)\n", "\n", "# Results\n", "print \" The exit velocity of steam = %f m/s\"%(Ve);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The exit velocity of steam = 379.103198 m/s\n" ] } ], "prompt_number": 18 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.16 Page No : 183" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "# Variables\n", "N_glycerol = 100.\t\t\t #molar flow rate of glycerol in mol/s\n", "Ti_gly = 227.\t\t\t #inlet temperature of glycerol in degree celsius\n", "Te_gly = 40.\t\t\t #outlet temperature of glycerol in degree celsius\n", "Ti_water = 25.\t\t\t #inlet temperature of cooling water in degree celsius\n", "Te_water = 50.\t\t\t #outlet temperature of cooling water in degree celsius\n", "Cp_gly = 280.\t\t\t #heat capacity of glycerol in J/molK\n", "Cp_water = 77.\t\t\t #heat capacity of water in J/molK\n", "\n", "# Calculations\n", "Ti_gly = Ti_gly+273.15\n", "Te_gly = Te_gly+273.15\n", "Ti_water = Ti_water+273.15\n", "Te_water = Te_water+273.15\n", "\n", "N_water = -(N_glycerol*Cp_gly*(Te_gly-Ti_gly))/(Cp_water*(Te_water-Ti_water));\n", "del_S_gly = N_glycerol*Cp_gly*math.log (Te_gly/Ti_gly)*10**-3\n", "del_S_water = N_water*Cp_water*math.log (Te_water/Ti_water)*10**-3\n", "S_G = del_S_gly+del_S_water\n", "\n", "# Results\n", "print \" The rate at which entropy is generated in the heat exchanger = %0.3f kJ/K s\"%(S_G);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The rate at which entropy is generated in the heat exchanger = 3.754 kJ/K s\n" ] } ], "prompt_number": 19 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.17 Page No : 183" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "T_i = 150.\t\t\t #temperature of saturated steam taken up by the device in degree celsius\n", "T_e = 200.\t\t\t #temperature of superheated steam delivered by the device in degree celsius\n", "P_e = 0.2\t\t\t #pressure of superheated steam delivered by the device in MPa\n", "me2 = 0.949\t\t\t #mass of superheated steam leaving the device in kg\n", "me1 = 0.051\t\t\t #mass of saturated liquid leaving the device in kg\n", "T_liq = 100.\t\t #temperature of saturated liquid leaving the device in degree celsius\n", "mi = 1. \t\t #mass of saturated steam fed to the device in kg\n", "\n", "# Calculations\n", "#From steam tables corresponding to T_i\n", "hi = 2745.4 \t\t\t #enthalpy of saturated vapour in kJ/kg\n", "si = 6.8358;\t\t\t #entropy of saturated vapour in kJ/kgK\n", "\n", "#For saturated liquid at T_liq\n", "he1 = 419.06;\t\t\t #enthalpy of saturated liquid in kJ/kg\n", "se1 = 1.3069;\t\t\t #entropy of saturated vapour in kJ/kgK\n", "\n", "#For superheated steam at P_e and T_e\n", "he2 = 2870.5;\t\t\t #enthalpy of superheated steam in kJ/kg\n", "se2 = 7.5072;\t\t\t #entropy of superheated steam in kJ/kgK\n", "\n", "LHS = mi*hi;\n", "RHS = (me1*he1)+(me2*he2);\n", "\n", "S_G = (me1*se1)+(me2*se2)-(mi*si);\n", "\n", "# Results\n", "print \" The LHS of the equation applied to the flow device to check if the first law of thermodynamics is satisfied = %0.1f kJ\"%(LHS);\n", "print \" The RHS of the equation applied to the flow device to check if the first law of thermodynamics is satisfied = %0.1f kJ\"%(RHS);\n", "print \" The entropy generated by applying the second law of thermodynamics to the flow device = %0.4f kJ/kgK\"%(S_G);\n", "if int(LHS) == int(RHS) and S_G>0 or S_G == 0 :\n", " print \" As the first and second law of thermodynamics are satisfied, the device is theoretically feasible \"\n", "else:\n", " print \" As both the first and second law or either the first or second law of thermodynamics \\\n", " are not satisfied, the device is not feasible \"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The LHS of the equation applied to the flow device to check if the first law of thermodynamics is satisfied = 2745.4 kJ\n", " The RHS of the equation applied to the flow device to check if the first law of thermodynamics is satisfied = 2745.5 kJ\n", " The entropy generated by applying the second law of thermodynamics to the flow device = 0.3552 kJ/kgK\n", " As the first and second law of thermodynamics are satisfied, the device is theoretically feasible \n" ] } ], "prompt_number": 21 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.18 Page No : 185" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "Pi = 30.\t\t\t #pressure of superheated steam entering the turbine in bar\n", "Ti = 300.\t\t\t #temperature of superheated steam entering the turbine in degree celsius\n", "Pe = 0.1\t\t\t #pressure at which steam exits the turbine in bar\n", "Xe = 0.9\t\t\t #quality of steam at the exit (no unit)(for the actual turbine)\n", "\n", "# Calculations\n", "#For superheated steam at Pi and Ti\n", "hi = 2995.1;\t\t\t #enthalpy of superheated steam at the entrance in kJ/kg\n", "si = 6.5422;\t\t\t #entropy of superheated steam at the entrance in kJ/kgK\n", "\n", "#For steam at Pe\n", "hf = 191.83;\t\t\t #enthalpy of saturated liquid in kJ/kg\n", "hg = 2584.8;\t\t\t #enthalpy of saturated vapour in kJ/kg\n", "sf = 0.6493;\t\t\t #entropy of saturated liquid in kJ/kgK\n", "sg = 8.1511;\t\t\t #entropy of saturated vapour in kJ/kgK\n", "\n", "X2 = (si-sf)/(sg-sf)\n", "h2 = (hf*(1-X2))+(X2*hg)\n", "he = (hf*(1-Xe))+(Xe*hg)\n", "n_T = (hi-he)/(hi-h2)\n", "\n", "# Results\n", "print \" The isentropic efficiency of the turbine = %f \"%(n_T);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The isentropic efficiency of the turbine = 0.703395 \n" ] } ], "prompt_number": 22 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.19 Page No : 186" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "Ti = 25.\t\t\t #temperature of air taken in by the adiabatic air compressor in degree celsius\n", "Pi = 0.1\t\t\t #pressure of air taken in by the adiabatic air compressor in MPa\n", "Pe = 1.\t \t\t #discharge pressure of air in MPa\n", "n_c = 0.8\t\t\t #isentropic efficiency of the compressor (no unit)\n", "gaamma = 1.4\t\t #ratio of molar specific heat capacities (no unit)\n", "R = 8.314\t\t\t #universal gas constant in J/molK\n", "\n", "# Calculations\n", "Ti = Ti+273.15\n", "Te = Ti*(((Pe*10**6)/(Pi*10**6))**((gaamma-1)/gaamma))\n", "W_s = (((R*gaamma)/(gaamma-1))*(Te-Ti))*10**-3;\t\t\t\n", "Ws = W_s/n_c\n", "Te_actual = ((Ws*10**3*(gaamma-1))/(R*gaamma))+Ti\n", "\n", "# Results\n", "print \" The exit temperature of air = %0.2f K\"%(Te_actual);\n", "print \" The power consumed by the compressor = %f kW/mol\"%(Ws);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The exit temperature of air = 645.01 K\n", " The power consumed by the compressor = 10.093262 kW/mol\n" ] } ], "prompt_number": 23 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.20 Page No : 187" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "Ti = 30.\t\t\t #temperature of saturated liquid water in degree celsius\n", "m = 500.\t\t\t #mass flow rate of water being pumped in kg/s\n", "P2 = 3. \t\t\t #preesure maintained in the boiler in MPa\n", "n_p = 0.75;\t\t\t #isentropic efficiency of the pump (no unit)\n", "\n", "# Calculations\n", "#For saturated liquid water at Ti\n", "vf = 0.0010043\n", "P1 = 4.241;\t\t\n", "\n", "Ws_m = (vf*((P2*10**6)-(P1*10**3)))*10**-3\n", "Ws_act_m = Ws_m/n_p;\t\t\t \n", "P = ((Ws_act_m*10**3)*m)*10**-6;\n", "\n", "# Results\n", "print \" The power consumed by the pump = %d MW\"%(P);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The power consumed by the pump = 2 MW\n" ] } ], "prompt_number": 24 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.21 Page No : 188" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variables\n", "Pi = 3.\t\t\t #pressure of dry saturated steam entering the nozzle in bar\n", "Xe = 0.98\t\t #quality of steam exiting the nozzle (no unit)\n", "Pe = 2.\t\t\t #pressure of steam exiting the nozzle in bar\n", "\n", "# Calculations\n", "#For steam at Pi\n", "hi = 2724.7\n", "he = 2652.8\n", "V2_2_s = hi-he\n", "\n", "#For steam at Pe\n", "hf = 504.70\n", "hg = 2706.3\n", "he_act = ((1-Xe)*hf)+(Xe*hg)\n", "V2_2 = hi-he_act;\t\t\t\n", "n_N = (V2_2)/(V2_2_s)\t\t\n", "\n", "# Results\n", "print \" The isentropic efficiency of the nozzle = %0.3f \"%(n_N);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The isentropic efficiency of the nozzle = 0.868 \n" ] } ], "prompt_number": 25 } ], "metadata": {} } ] }