diff options
author | Prashant S | 2020-04-14 10:25:32 +0530 |
---|---|---|
committer | GitHub | 2020-04-14 10:25:32 +0530 |
commit | 06b09e7d29d252fb2f5a056eeb8bd1264ff6a333 (patch) | |
tree | 2b1df110e24ff0174830d7f825f43ff1c134d1af /Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/6-Using_entropy.ipynb | |
parent | abb52650288b08a680335531742a7126ad0fb846 (diff) | |
parent | 476705d693c7122d34f9b049fa79b935405c9b49 (diff) | |
download | all-scilab-tbc-books-ipynb-master.tar.gz all-scilab-tbc-books-ipynb-master.tar.bz2 all-scilab-tbc-books-ipynb-master.zip |
Initial commit
Diffstat (limited to 'Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/6-Using_entropy.ipynb')
-rw-r--r-- | Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/6-Using_entropy.ipynb | 695 |
1 files changed, 695 insertions, 0 deletions
diff --git a/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/6-Using_entropy.ipynb b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/6-Using_entropy.ipynb new file mode 100644 index 0000000..1612880 --- /dev/null +++ b/Fundamental_Of_Engineering_Thermodynamics_by_M_J_Moran/6-Using_entropy.ipynb @@ -0,0 +1,695 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: Using entropy" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.10: Example_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.10) A rigid, well-insulated tank is filled initially with 5 kg of air at a pressure of 5 bar and a temperature of 500 K. A leak develops, and air slowly escapes until the pressure of the air remaining in the tank is 1 bar. Employing the ideal gas model, determine the amount of mass remaining in the tank and its temperature.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"m1 = 5 //initial mass in kg\n", +"P1 = 5 //initial pressure in bar\n", +"T1 = 500 //initial temperature in kelvin\n", +"P2 = 1 //final pressure in bar\n", +"\n", +"//from table A-22\n", +"pr1 = 8.411\n", +"\n", +"pr2 = (P2/P1)*pr1\n", +"\n", +"//using this value of pr2 and interpolation in table A-22\n", +"T2 = 317 //in kelvin\n", +"\n", +"m2 = (P2/P1)*(T1/T2)*m1\n", +"printf('the amount of mass remaining in the tank in kg is :\n \t m2 = %f',m2)\n", +"printf('\n and its temperature in kelvin is : \n\t T = %f',T2)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.11: Example_11.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.11) A steam turbine operates at steady state with inlet conditions of p1 = 5 bar, T1= 320C. Steam leaves the turbine at a pressure of 1 bar. There is no significant heat transfer between the turbine and its surroundings, and kinetic and potential energy changes between inlet and exit are negligible. If the isentropic turbine efficiency is 75%, determine the work developed per unit mass of steam flowing through the turbine, in kJ/kg.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 1 //inlet pressure in bar\n", +"T1 = 593 //inlet temperature in kelvin\n", +"P2 = 1 //exit pressure in bar\n", +"eta = .75 //turbine efficiency\n", +"\n", +"//from table A-4\n", +"h1 = 3105.6 //in Kj/kg\n", +"s1 = 7.5308 //in kj/kg.k\n", +"//from table A-4 at 1 bar\n", +"h2s = 2743 //in kj/kg\n", +"w = eta*(h1 - h2s)\n", +"printf('the work developed per unit mass of steam flowing through in kj/kg is : \n\t w = %f',w)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.12: Example_12.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.12) A turbine operating at steady state receives air at a pressure of p1 = 3.0 bar and a temperature of T1= 390 K. Air exits the turbine at a pressure of p2 = 1.0 bar. The work developed is measured as 74 kJ per kg of air flowing through the turbine. The turbine operates adiabatically, and changes in kinetic and potential energy between inlet and exit can be neglected. Using the ideal gas model for air, determine the turbine efficiency.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 3 //pressure of air entering in bar\n", +"T1 = 390 //temperature of air entering in kelvin\n", +"P2 = 1 //pressure of exit air\n", +"Wcvdot = 74 //work developed in kj/kg\n", +"\n", +"//from table A-22,at 390k\n", +"h1 = 390.88 //in kj/kg\n", +"pr1 = 3.481\n", +"\n", +"pr2 = (P2/P1)*pr1\n", +"\n", +"//from interpolation table A-22\n", +"h2s = 285.27 //in kj/kg\n", +"\n", +"Wcvdots = h1 - h2s\n", +"\n", +"eta = Wcvdot/Wcvdots\n", +"\n", +"printf('the turbine efficiency is : \n\t eta = %f',eta)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.13: Example_13.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.13) Steam enters a nozzle operating at steady state at p1 = 1.0 MPa and T1= 320C with a velocity of 30 m/s. The pressure and temperature at the exit are p2 = 0.3 MPa and T2 = 180C. There is no significant heat transfer between the nozzle and its surroundings, and changes in potential energy between inlet and exit can be neglected. Determine the nozzle efficiency.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 1 //pressure of entering steam in Mpa\n", +"T1 = 593 //temperature of entering steam in kelvin\n", +"V1 = 30 //velocity of entering steam in m/s\n", +"P2 = .3 //pressure of exit steam in Mpa\n", +"T2 = 453 //temperature of exit steam in kelvin\n", +"\n", +"//from table A-4, at T1 = 593 kelvin and P1 = 1 Mpa;T2 = 453 kelvin and P2 = .3 Mpa\n", +"h1 = 3093.9 //in kj/kg\n", +"s1 = 7.1962 //in kj/kg.k\n", +"h2 = 2823.9 //in kj/kg\n", +"V2squareby2 = h1 - h2 + (V1^2)/2000\n", +"\n", +"//interpolating in table A-4\n", +"h2s = 2813.3 //in kj/kg\n", +"V2squareby2s = h1 - h2s + (V1^2)/2000\n", +"eta = V2squareby2/V2squareby2s\n", +"printf('the nozzle efficiency is :\n\t eta = %f',eta)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.14: Example_14.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.14) For the compressor of the heat pump system in Example 6.8, determine the power, in kW, and the isentropic efficiency using (a) data from property tables, (b) Interactive Thermodynamics: IT.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//part(a)\n", +"//from table A-9\n", +"h1 = 249.75 //in kj/kg\n", +"h2 = 294.17 //in kj/kg\n", +"\n", +"mdot = .07 //in kg/s\n", +"\n", +"wcvdot = mdot*(h1-h2)\n", +"//from table A-9\n", +"s1 = .9572 //in Kj/Kg.k\n", +"h2s = 285.58 //in kj/kg\n", +"\n", +"eta = (h2s-h1)/(h2-h1) \n", +"\n", +"printf('the power in KW is: \n\t p = %f',wcvdot)\n", +"printf('\n the isentropic efficiency is : \n\t eta = %f',eta)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.15: Example_15.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.15) An air compressor operates at steady state with air entering at p1 = 1 bar, T1= 20C, and exiting at =p2 5 bar. Determine the work and heat transfer per unit of mass passing through the device, in kJ/kg, if the air undergoes a polytropic process with n = 1.3. Neglect changes in kinetic and potential energy between the inlet and the exit. Use the ideal gas model for air.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 1 //pressure of entering air in bar\n", +"T1 = 293 //temperature of entering air in kelvin\n", +"P2 = 5 //pressure of exit air in bar\n", +"n = 1.3\n", +"\n", +"T2 = T1*((P2/P1)^((n-1)/n)) //in kelvin\n", +"R = 8.314/28.97\n", +"wcvdot=((n*R)/(n-1))*(T1-T2) //in kj/kg\n", +"\n", +"//from table A-22\n", +"h1 = 293.17 //in kj/kg\n", +"h2 = 426.35 // in kj/kg\n", +"\n", +"Qcvdot= wcvdot + (h2-h1) //in kj/kg\n", +"printf('the work per unit mass passing through the device in kj/kg is: w = %f',wcvdot)\n", +"printf('\nthe heat transfer per unit mass in Kj/kg is : q = %f ',Qcvdot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1: Example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (6.1) Water, initially a saturated liquid at 100C, is contained in a piston–cylinder assembly. The water undergoes a process to the corresponding saturated vapor state, during which the piston moves freely in the cylinder. If the change of state is brought about by heating the water as it undergoes an internally reversible process at constant pressure and temperature, determine the work and heat transfer per unit of mass, each in kJ/kg.\n", +"//solution\n", +"T = 373.15 //temperature in kelvin\n", +"//from table A-2\n", +"p = 1.014*10^5 //pressure in pascal\n", +"vg = 1.673\n", +"vf = 1.0435e-3\n", +"sg = 7.3549\n", +"sf = 1.3069\n", +"w = p*(vg-vf)*10^(-3)\n", +"Q = T*(sg-sf)\n", +"printf('the work per unit mass in kj/kg is\n\t w = %f',w)\n", +"printf('\nthe heat transfer per unit mass in kj/kg is \n\t Q = %f',Q)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2: Example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.2) Water initially a saturated liquid at 100C is contained within a piston–cylinder assembly. The water undergoes a process to the corresponding saturated vapor state, during which the piston moves freely in the cylinder. There is no heat transfer with the surroundings. If the change of state is brought about by the action of a paddle wheel, determine the net work per unit mass, in kJ/kg, and the amount of entropy produced per unit mass,in Kj/kg.k\n", +"\n", +"//solution\n", +"\n", +"//Assumptions:\n", +"//1. The water in the piston–cylinder assembly is a closed system.\n", +"//2. There is no heat transfer with the surroundings.\n", +"//3. The system is at an equilibrium state initially and finally. There is no change in kinetic or potential energy between these\n", +"//two states.\n", +"\n", +"//from table A-2 at 100 degree celcius\n", +"ug = 2506.5 //in kj/kg\n", +"uf = 418.94 //in kj/kg\n", +"sg = 7.3549\n", +"sf = 1.3069\n", +"\n", +"//from energy balance,\n", +"W = -(ug-uf)\n", +"printf('the net work per unit mass in kj/kg is:\n\t w = %f ',W)\n", +"\n", +"//from entropy balance\n", +"sigmabym = (sg-sf)\n", +"printf('\n\nthe amount of entropy produced per unit mass in kj/kg.k is :\n\t sigmabym =%f',sigmabym)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3: Example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.3) Refrigerant 134a is compressed adiabatically in a piston–cylinder assembly from saturated vapor at 0C to a final pressure of 0.7 MPa. Determine the minimum theoretical work input required per unit mass of refrigerant, in kJ/kg.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 273 //initial temperature of saturated vapor in kelvin\n", +"P2 = .7*10^6 //final pressure in pascal\n", +"\n", +"//from table A-10,\n", +"u1 = 227.06 //in kj/kg\n", +"\n", +"//minimum theoretical work corresponds to state of isentropic compression\n", +"//from table A-12,\n", +"u2s = 244.32 //in kj/kg\n", +"Wmin = u2s-u1\n", +"printf('the minimum theoretical work input required per unit mass of refrigerant in kj/kg is:\n\t Wmin = %f',Wmin)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.4: Example_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.4) Referring to Example 2.4, evaluate the rate of entropy production sigmadot in kW/K, for (a) the gearbox as the system and (b) an enlarged system consisting of the gearbox and enough of its surroundings that heat transfer occurs at the temperature of the surroundings away from the immediate vicinity of the gearbox, Tf = 293 K (20C).\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"Qdot = -1.2 //in kilo watt\n", +"Tb = 300 //in kelvin\n", +"Tf = 293 //in kelvin\n", +"\n", +"\n", +"//part (a)\n", +"//from entropy balance \n", +"sigmadot = -Qdot/Tb\n", +"printf('the rate of entropy production in kw/k with gearbox as system is:\n\t sigmadot = %e',sigmadot)\n", +"\n", +"//part(b)\n", +"//from entropy balance \n", +"sigmadt = -Qdot/Tf\n", +"printf('\n\nthe rate of entropy production in kw/k with gearbox + sorrounding as system is:\n\t sigmadot = %e',sigmadt)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.5: Example_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.5) A 0.3 kg metal bar initially at 1200K is removed from an oven and quenched by immersing it in a closed tank containing 9 kg of water initially at 300K. Each substance can be modeled as incompressible. An appropriate constant specific heat value for the water is cw = 4.2 kJ/kg. K, and an appropriate value for the metal is cm = 0.42 kJ/kg K. Heat transfer from the tank contents can be neglected. Determine (a) the final equilibrium temperature of the metal bar and the water, in K, and (b) the amount of entropy produced, in kJ/k.\n", +"\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"Tmi = 1200 //initial temperature of metal in kelvin\n", +"cm = .42 //specific heat of metal in KJ/kg.k\n", +"mm = .3 //mass of metal in kg\n", +"Twi = 300 //initial temperature of water in kelvin\n", +"cw = 4.2 //specific heat of water in KJ/Kg.k\n", +"mw = 9 //mass of water in kg\n", +"\n", +"\n", +"//part(a)\n", +"//solving energy balance equation yields\n", +"Tf = (mw*(cw/cm)*Twi+mm*Tmi)/(mw*(cw/cm)+mm)\n", +"\n", +"//part (b)\n", +"//solving entropy balance equation yields\n", +"sigma = mw*cw*log(Tf/Twi)+mm*cm*log(Tf/Tmi)\n", +"\n", +"printf('the final equilibrium temperature of the metal bar and the water in kelvin is :\n\t Tf = %f',Tf)\n", +"printf('\n\n the amount of entropy produced in kj/k is: \n\tsigma = %f ',sigma)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.6: Example_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.6) Steam enters a turbine with a pressure of 30 bar, a temperature of 400C, and a velocity of 160 m/s. Saturated vapor at 100C exits with a velocity of 100 m /s. At steady state, the turbine develops work equal to 540 kJ per kg of steam flowing through the turbine. Heat transfer between the turbine and its surroundings occurs at an average outer surface temperature of 350 K. Determine the rate at which entropy is produced within the turbine per kg of steam flowing, in kJ/kg.k. Neglect the change in potential energy between inlet and exit\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 30 //pressure of steam entering the turbine in bar\n", +"T1 = 400 //temperature of steam entering the turbine in degree celcius\n", +"V1 = 160 //velocity of steam entering the turbine in m/s\n", +"T2 = 100 //temperature of steam exiting in degree celcius\n", +"V2 = 100 //velocity of steam exiting in m/s\n", +"Wcvdot = 540 //work produced by turbine in kJ/kg of steam\n", +"Tb = 350 //temperature of the boundary in kelvin\n", +"\n", +"//from table A-4 and table A-2,\n", +"h1 = 3230.9 //specific enthalpy at entry in Kj/kg\n", +"h2 = 2676.1 //specific enthalpy at exit in kj/kg\n", +"\n", +"//reduction in mass and energy balance equations results in \n", +"Qcvdot = Wcvdot + (h2 - h1)+ (V2^2-V1^2)/(2*10^3) //heat transfer rate\n", +"\n", +"//from table A-2\n", +"s2 = 7.3549 //in kj/kg.k\n", +"//from table A-4\n", +"s1 = 6.9212 //in kj/kg.k\n", +"\n", +"//from entropy and mass balance equations\n", +"sigmadot = -(Qcvdot/Tb) + (s2-s1)\n", +"\n", +"printf('the rate at which entropy is produced within the turbine per kg of steam flowing, in kJ/kg.k is:\n\t entropyrate = %f',sigmadot)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.7: Example_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.7) An inventor claims to have developed a device requiring no energy transfer by work or heat transfer, yet able to produce hot and cold streams of air from a single stream of air at an intermediate temperature. The inventor provides steady-state test data indicating that when air enters at a temperature of 21C and a pressure of 5.1 bars, separate streams of air exit at temperatures of -18C and 79C, respectively, and each at a pressure of 1 bar. Sixty percent of the mass entering the device exits at the lower temperature. Evaluate the inventor’s claim, employing the ideal gas model for air and ignoring changes in the kinetic and potential energies of the streams from inlet to exit.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"T1 = 294 //entry temperature of air in kelvin\n", +"P1 = 5.1 //entry pressure of air in bars\n", +"T2 = 352 //exit temperature of hot stream in kelvin\n", +"P2 = 1 //exit pressure of hot stream in bars\n", +"T3 = 255 //exit temperature of cold stream in kelvin\n", +"P3 = 1 //exit pressure of cold stream in bars\n", +"\n", +"cp = 1 //in kj/kg.k\n", +"R = 8.314/28.97\n", +"se = .4*(cp*log((T2)/(T1))-R*log(P2/P1)) + .6*(cp*log((T3)/(T1))-R*log(P3/P1)) //specific entropy in kj/kg.k\n", +"\n", +"printf('specific entropy in kj/kg.k = %f',se)\n", +"printf('\n\nsince se > 0, the claim of the writer is true')\n", +"\n", +"\n", +" \n", +" \n", +" \n", +" \n", +" \n", +" \n", +" \n", +" \n", +" \n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.8: Example_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//(6.8) Components of a heat pump for supplying heated air to a dwelling are shown in the schematic below. At steady state, Refrigerant 22 enters the compressor at -5C, 3.5 bar and is compressed adiabatically to 75C, 14 bar. From the compressor, the refrigerant passes through the condenser, where it condenses to liquid at 28C, 14 bar. The refrigerant then expands through a throttling valve to 3.5 bar. The states of the refrigerant are shown on the accompanying T–s diagram. Return air from the dwelling enters the condenser at 20C, 1 bar with a volumetric flow rate of 0.42 m3/s and exits at 50C with a negligible change in pressure. Using the ideal gas model for the air and neglecting kinetic and potential energy effects, (a) determine the rates of entropy production, in kW/K, for control volumes enclosing the condenser, compressor, and expansion valve, respectively. (b) Discuss the sources of irreversibility in the components considered in part (a).\n", +"\n", +"\n", +"//solution\n", +"\n", +"\n", +"//variable initialization\n", +"P1 = 3.5 //pressure of refrigerant entering the compressor in bars\n", +"T1 = 268 //temperature of refrigerant entering the compressor in kelvin\n", +"P2 = 14 //pressure of refrigerant entering the condenser in bars\n", +"T2 = 348 //temperature of refrigerant entering the condenser in kelvin\n", +"P3 = 14 //pressure of refrigerant exiting the condenser in bars\n", +"T3 = 301 //temperature of refrigerant exiting the condenser in kelvin\n", +"P4 = 3.5 //pressure of refrigerant after passing through expansion valve in bars\n", +"P5 = 1 //pressure of indoor return air entering the condenser in bars\n", +"T5 = 293 //temperature of indoor return air entering the condenser in kelvin\n", +"AV5 = .42 //volumetric flow rate of indoor return air entering the condenser in m^3/s\n", +"P6 = 1 //pressure of return air exiting the condenser in bar\n", +"T6 = 323 //temperature of return air exiting the condenser in kelvin\n", +"\n", +"//part(a)\n", +"\n", +"//from table A-9\n", +"s1 = .9572 //in kj/kg.k\n", +"//interpolating in table A-9\n", +"s2 = .98225 //in kj/kg.k\n", +"h2 = 294.17 //in kj/kg\n", +"//from table A-7\n", +"s3 = .2936 //in kj/kg.k\n", +"h3 = 79.05 //in kj/kg\n", +"\n", +"h4 = h3 //since expansion through valve is throttling process\n", +"\n", +"//from table A-8\n", +"hf4 = 33.09 //in kj/kg\n", +"hg4 = 246 //in kj/kg\n", +"sf4 = .1328 //in kj/kg.k\n", +"sg4 = .9431 //in kj/kg.k\n", +"\n", +"x4 = (h4-hf4)/(hg4-hf4) //quality at state 4\n", +"s4 = sf4 + x4*(sg4-sf4) //specific entropy at state 4\n", +"\n", +"/////condenser!!\n", +"v5 = ((8314/28.97)*T5)/(P5*10^5) //specific volume at state 5\n", +"mairdot = AV5/v5 \n", +"cp = 1.005 //in kj/kg.k\n", +"h6 = cp*T6\n", +"h5 = cp*T5\n", +"mrefdot = mairdot*(h6-h5)/(h2-h3)\n", +"deltaS65 = cp*log(T6/T5)-(8.314/28.97)*log(P6/P5) //change in specific entropy\n", +"sigmacond = (mrefdot*(s3-s2)) + (mairdot*(deltaS65))\n", +"\n", +"/////compressor!!\n", +"sigmacomp = mrefdot*(s2-s1)\n", +"\n", +"\n", +"////valve!!\n", +"sigmavalve = mrefdot *(s4-s3)\n", +"\n", +"printf('\nthe rates of entropy production, in kW/K, for control volume enclosing the condenser is \n\t R1 = %e ',sigmacond)\n", +"printf('\nthe rates of entropy production, in kW/K, for control volume enclosing the compressor is \n\t R2 = %e ',sigmacomp)\n", +"printf('\nthe rates of entropy production, in kW/K, for control volume enclosing the expansion valve is \n\t R3 = %e ',sigmavalve)\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"\n", +" " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.9: Example_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// (6.9) Air undergoes an isentropic process from p1 = 1 bar, T1= 300K to a final state where the temperature is T2= 650K.,Employing the ideal gas model, determine the final pressure p2, in atm. Solve using (a) pr data from Table A-22 (b) Interactive Thermodynamics: IT, and (c) a constant specific heat ratio k evaluated at the mean temperature, 475K, from Table A-20.\n", +"\n", +"//solution\n", +"\n", +"//variable initialization\n", +"P1 = 1 //initial pressure in bar\n", +"T1 = 300 //initial temperature in kelvin\n", +"T2 = 650 //final temperature in kelvin\n", +"\n", +"//part(a)\n", +"//from table A-22\n", +"pr2 = 21.86 \n", +"pr1 = 1.3860\n", +"p2 = P1*(pr2/pr1)\n", +"printf('part(a) P2 in bar = %f ',p2)\n", +"//part(b)\n", +"printf('\n part(b) IT software problem')\n", +"//part(c)\n", +"k = 1.39 //from table A-20\n", +"p2a = P1*((T2/T1)^(k/(k-1)))\n", +"printf('\n part(c) P2a in bar = %f',p2a)" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |