{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 8: Available energy Availability and irreversibility" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.10: Calculation_of_rate_of_energy_lossof_gas_flowing_through_a_pipe.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "m = 3; R = 0.287; \n", "T0 = 300; k = 0.10; // k = dP/P1\n", "Sgen = m*R*k;\n", "I = Sgen*T0;\n", "disp('kW',I,'The rate of energy loss because of the pressure drop due to friction')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.11: Energy_calculation_on_mixing_of_stream_of_water.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "m1 = 2; // m1_dot\n", "m2 = 1;\n", "T1 = 90+273; \n", "T2 = 30+273;\n", "T0 =300;\n", "m = m1+m2;\n", "x = m1/m;\n", "t = T2/T1; // Tau\n", "cp = 4.187;\n", "Sgen = m*cp*log((x+t*(1-x))/(t^(1-x)));\n", "I = T0*Sgen;\n", "disp('kW/K',Sgen,'The rate of entropy generation is')\n", "disp('kW',I,'The rate of energy loss due to mixing is')\n", "// Alternatively\n", "T = (m1*T1+m2*T2)/(m1+m2); // euilibrium temperature\n", "Sgen1 = m1*cp*log(T/T1)+m2*cp*log(T/T2);\n", "I1 = T0*Sgen1;" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.12: Calculations_on_efficiency_of_burning_of_fuel.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "Qr = 500; // Heat release in kW\n", "Tr = 2000;\n", "T0 = 300;\n", "// Part (a)\n", "Qa = 480; Ta = 1000;\n", "n1a = (Qa/Qr);\n", "n2a = n1a*(1-(T0/Ta))/(1-(T0/Tr));\n", "disp('PART (A)')\n", "disp('%',n1a*100,'The first law efficiency is')\n", "disp('%',n2a*100,'The Second law efficiency is')\n", "// Part (b)\n", "Qb = 450; Tb = 500;\n", "n1b = (Qb/Qr);\n", "n2b = n1b*(1-(T0/Tb))/(1-(T0/Tr));\n", "disp('PART (B)')\n", "disp('%',n1b*100,'The first law efficiency is')\n", "disp('%',n2b*100,'The Second law efficiency is')\n", "// Part (c)\n", "Qc = 300; Tc = 320;\n", "n1c = (Qc/Qr);\n", "n2c = n1c*(1-(T0/Tc))/(1-(T0/Tr));\n", "disp('PART (C)')\n", "disp('%',n1c*100,'The first law efficiency is')\n", "disp('%',n2c*100,'The Second law efficiency is')\n", "// Part (d)\n", "Qd = 450; \n", "n1d = (Qd/Qr);\n", "n2a_= n1d*(1-(T0/Ta))/(1-(T0/Tr));\n", "n2b_= n1d*(1-(T0/Tb))/(1-(T0/Tr));\n", "n2c_= n1d*(1-(T0/Tc))/(1-(T0/Tr));\n", "disp('Part (D)')\n", "disp('%',n1d*100,'The first law efficiency is')\n", "disp('%',n2a_*100,'The Second law efficiency of part (a) is')\n", "disp('%',n2b_*100,'The Second law efficiency of part (b) is')\n", "disp('%',n2c_*100,'The Second law efficiency of part (c) is')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.14: Calculation_of_power_and_efficiency_in_a_compressor.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "cp = 1.005; T2 = 433; T1 = 298;\n", "T0 = 298; R = 0.287; P2 = 8; P1 = 1;\n", "Q = -100; m = 1;\n", "W = Q + m*cp*(T1-T2);\n", "AF = cp*(T2-T1)-T0*((cp*log(T2/T1))-(R*log(P2/P1))) ; // AF = af2-af1\n", "e = AF/-W; // efficiency \n", "disp('kW',W,'The power input is')\n", "disp(e,'The second law efficiency of the compressor is')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.15: Determination_of_energy_of_vaccume.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Since vaccume has zero mass\n", "U = 0; H0 = 0; S = 0;\n", "// If the vaccume ha reduced to dead state\n", "U0 = 0; H0 = 0 ; S0 = H0; V0 = 0;\n", "P0 = 100; V = 1;\n", "fi = P0*V;\n", "disp('kJ',fi,'The energy of the complete vaccume is')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.16: Calculation_of_energy_produced_in_chilling_process_of_fish.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "m = 1000; T0 = 300; P0 = 1; \n", "T1 = 300;\n", "T2 = 273-20; Tf = 273-2.2;\n", "Cb = 1.7; Ca = 3.2;\n", "Lh = 235;\n", "H12 = m*((Cb*(Tf-T2))+Lh+(Ca*(T1-Tf)));\n", "H21 = -H12;\n", "S12 = m*((Cb*log(Tf/T2))+(Lh/Tf)+(Ca*log(T1/Tf)));\n", "S21 = -S12;\n", "E = H21-T0*S21;\n", "disp('kJ',E,'Energy produced is')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.17: Thermodynamic_calculation_on_air.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "cv = 0.718; T2 = 500; T1 = 300;\n", "m = 1; T0 = 300;\n", "// Case (a)\n", "Sua = cv*log(T2/T1);\n", "Ia = T0*Sua;\n", "disp('kJ/kg',Ia,'The irreversibility in case a is')\n", "// Case (b)\n", "Q = m*cv*(T2-T1);\n", "T = 600;\n", "Sub = Sua-(Q/T);\n", "Ib = T0*Sub;\n", "disp('kJ/kg',Ib,'The irreversibility in case b is')\n", " " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.18: Energy_calculation_of_steam_through_turbine.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "h1 = 3230.9; s1 = 6.69212; V1 = 160; T1 = 273+400;\n", "h2 = 2676.1; s2 = 7.3549; V2 = 100; T2 = 273+100;\n", "T0 = 298; W = 540; Tb = 500;\n", "Q = (h1-h2)+((V1^2-V2^2)/2)*1e-03-W;\n", "I = 151.84-Q*(0.404);\n", "AF = W + Q*(1-(T0/Tb)) + I; // AF = af1-af2\n", "n2 = W/AF;\n", "disp('kJ/kg',I,'Irreversibility per unit mass is')\n", "disp(n2,'The second law effiency of the turbine is')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.19: Availability_calculations_on_a_furnace.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "T0 = 300; T = 1500;\n", "Q = -8.5; W = 8.5;\n", "// Case (a)\n", "I = Q*(1-T0/T) + W;\n", "R = Q*(1-T0/T);\n", "disp('kW',I,'and',R,'Rate of availability transfer with heat and the irreversibility rate are')\n", "// Case (b)\n", "T1 = 500;\n", "Ib = - Q*(1-T0/T) + Q*(1-T0/T1);\n", "disp('kW',Ib,'Rate of availability in case b is')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.1: Calculation_of_fraction_of_available_energy_in_heat_transfer.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "T0 = 308;\n", "T1 = 693; \n", "T1_ = 523; // T1_ = T1'\n", "T1_ = 523; // ''\n", "f = (T0*(T1-T1_))/(T1_*(T1-T0));\n", "disp(f,'The fraction of energy that becomes unavailable due to irreversible heat transfer is')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.20: Energy_calculation_of_air_through_compressor.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "P1 = 1; T1 = 273+30; \n", "P2 = 3.5; T2 = 141+273 ; V = 90;\n", "T0 = 303;\n", "// Part (a)\n", "g = 1.4;\n", "T2s = T1*((P2/P1)^((g-1)/g));\n", "disp('As T2s> T2 so the process must be polytropic')\n", "// Part (b)\n", "p = log(P2/P1); q = log(T2/T1);\n", "n = p/(p-q);\n", "disp(n,'The polytropic index is')\n", "// Part (c)\n", "cp = 1.0035; R = 0.287;\n", "Wa = cp*(T1-T2)-(V2^2/2)*1e-03 ;\n", "Wt = -R*T0*log(P2/P1)-(V2^2/2)*1e-03;\n", "Nt = Wt/Wa;\n", "disp(Nt,'The isothermal effiency is')\n", "// Part (d)\n", "f12 = cp*(T1-T2) + T0*((R*log(P2/P1))-(cp*log(T2/T1))) - (V2^2/2)*1e-03 ;\n", "I = f12-Wa ; \n", "disp('kW respectively',I,'and',f12,'The minimum work input and irreversibility are')\n", "// Part (e)\n", "n2 = (f12/Wa);\n", "disp(n2,'Second law efficiency is')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.2: Calculation_of_increase_in_available_energy_in_a_steam_boiler.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "lhw = 1858.5; // Latent heat of water\n", "Tew = 220+273;\n", "Sw = lhw/Tew; \n", "Tig = 1100; // Initial temperature of the gas\n", "Tfg = 550; // Final ''\n", "k = 1*lhw/(Tig-Tfg); // k = mg_dot*cpg\n", "Tg2 = 823; Tg1 = 1373\n", "Sg = integrate('k/T','T',Tg1,Tg2)\n", "St = Sg+Sw; \n", "disp('kJ/K',St,'Total change in entropy is ')\n", "T0 = 303;\n", "disp('kJ',T0*St,'Increase in unavailable energy is')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.3: Calculation_of_available_energy_in_water.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "Tw = 75+273;\n", "Ts = 5+273; // Ts = T0\n", "m = 40;\n", "cp = 4.2;\n", "W = integrate('m*cp*(1-(Ts/T))','T',Ts,Tw);\n", "Q1 = m*cp*(Tw-Ts);\n", "UE = Q1-W;\n", "disp('kJ',W,'Total work')\n", "disp('kJ',Q1,'Heat released')\n", "disp('kJ',UE,'Internal energy change')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.4: Calculation_of_decrease_in_available_energy_in_water.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "Ts = 273+15;\n", "Tw1 = 95+273;\n", "Tw2 = 35+273;\n", "m1 = 25; m2 = 35;\n", "cp = 4.2;\n", "AE25 = integrate('m1*cp*(1-(Ts/T))','T',Ts,Tw1);\n", "AE35 = integrate('m2*cp*(1-(Ts/T))','T',Ts,Tw2);\n", "AEt = AE25 + AE35;\n", "Tm = (m1*Tw1+m2*Tw2)/(m1+m2); // Temperature after mixing\n", "AE60 = integrate('(m1+m2)*cp*(1-(Ts/T))','T',Ts,Tm);\n", "AE = AEt - AE60;\n", "disp('kJ',AE,'The decrease in the totla energy is')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.5: Calculation_of_the_final_RPM_of_the_flywheel.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "N1 = 3000;\n", "w1 = (2*%pi*N1)/60;\n", "I = 0.54;\n", "Ei = 0.5*I*w1^2;\n", "ti = 15+273;\n", "m = 2;\n", "dt = Ei/(1000*2*4.187);\n", "tf = ti+dt;\n", "AE = integrate('m*4.187*(1-(ti/T))','T',ti,tf);\n", "UE = Ei/1000 - AE;\n", "w2 = sqrt(AE*1000*2/I);\n", "N2 = (w2*60)/(2*%pi);\n", "disp(N2,'The final RPM of the flywheel would be')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.6: Energy_calculations_on_air.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "T1 = 353; T2 = 278;\n", "V2 = 2; V1 = 1;\n", "P0 = 100; P1 = 500;\n", "R = 0.287; cv = 0.718;\n", "m = 2;\n", "S = integrate('(m*cv)/T','T',T1,T2) + integrate('(m*R)/V','V',V1,V2); // S = S1-S2\n", "U = m*cv*(T1-T2);\n", "Wmax = U-(T2*(-S));\n", "V1_ = (m*R*T1)/P1;\n", "CA = Wmax-P0*(V1_); // Change in availability\n", "I = T2*S; \n", "disp('kJ',Wmax,'The maximum work is') \n", "disp('kJ',CA,'Change in availability is')\n", "disp('kJ',I,'Irreversibility is')\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.7: Energy_calculation_of_air_through_a_turbine.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "P1 = 500; P2 = 100;\n", "T1 = 793; T2 = 573;\n", "cp = 1.005; T0 = 293; R = 0.287;\n", "S21 = (R*log(P2/P1))-(cp*log(T2/T1))\n", "CA = cp*(T1-T2)-T0*S21; // Change in v=availability\n", "disp('kJ/kg',CA,'The decrease in availability is')\n", "Wmax = CA;\n", "disp('kJ/kg',Wmax,'The maximum work is')\n", "Q = -10;\n", "W = cp*(T1-T2)+Q ;\n", "I = Wmax-W;\n", "disp('kJ/kg',I,'The irreversibility is')\n", "// Altenatively\n", "Ssystem = -Q/T0;\n", "Ssurr = -S21;\n", "I1 = T0*(Ssystem+Ssurr);\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.8: Energy_calculation_on_a_air_preheater.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "T0 = 300;\n", "Tg1 = 573; Tg2 = 473;\n", "Ta1 = 313; \n", "cpg = 1.09; cpa = 1.005;\n", "mg = 12.5; ma = 11.15;\n", "f1 = cpg*(Tg1-T0)-T0*cpg*(log(Tg1/T0));\n", "f2 = cpg*(Tg2-T0)-T0*cpg*(log(Tg2/T0));\n", "disp('kJ/Kg respectively',f2,'and',f1,'The initial and final availbility of the products are')\n", "// Part (b)\n", "Dfg = f1-f2;\n", "Ta2 = Ta1 + (mg/ma)*(cpg/cpa)*(Tg1-Tg2);\n", "Ifa = cpa*(Ta2-Ta1)-T0*cpa*(log(Ta2/Ta1));\n", "I = mg*Dfg-ma*Ifa;\n", "disp('kW',I,'The irreversibility of the process is')\n", "// Part (c)\n", "Ta2_ = Ta1*(%e^(-(mg/ma)*(cpg/cpa)*log(Tg2/Tg1)));\n", "Q1 = mg*cpg*(Tg1-Tg2);\n", "Q2 = ma*cpa*(Ta2_-Ta1);\n", "W = Q1-Q2;\n", "disp('kW',W,'Tota power generated by the heat engine')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.9: Calculation_of_rate_of_energy_degradation_of_gas_flowing_through_a_pipe.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "T2 = 1063;\n", "T1 = 1073;\n", "m = 2; cp = 1.1;\n", "I = m*cp*((T1-T2)-T0*(log(T1/T2)));\n", "disp('kW',I,'The irrevesibility rate is')\n", "// At lower temperature\n", "T1_ = 353; T2_ = 343;\n", "I_ = m*cp*((T1_-T2_)-T0*(log(T1_/T2_)));\n", "disp('kW',I_,'The irrevesibility rate at lower temperature is')" ] } ], "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 }