summaryrefslogtreecommitdiff
path: root/Thermodynamics_Demystified_by_M_C_Potter/7-Power_Gas_Cycles.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Thermodynamics_Demystified_by_M_C_Potter/7-Power_Gas_Cycles.ipynb')
-rw-r--r--Thermodynamics_Demystified_by_M_C_Potter/7-Power_Gas_Cycles.ipynb567
1 files changed, 567 insertions, 0 deletions
diff --git a/Thermodynamics_Demystified_by_M_C_Potter/7-Power_Gas_Cycles.ipynb b/Thermodynamics_Demystified_by_M_C_Potter/7-Power_Gas_Cycles.ipynb
new file mode 100644
index 0000000..099f9f3
--- /dev/null
+++ b/Thermodynamics_Demystified_by_M_C_Potter/7-Power_Gas_Cycles.ipynb
@@ -0,0 +1,567 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 7: Power Gas Cycles"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.10: adding_ideal_internal_heat_exchanger_and_regenerator.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"clear\n",
+"//solution\n",
+"// initialization of variables\n",
+"\n",
+"Cp=1 // specific constant at constant pressure\n",
+"k=1.4 // polytropic constant for air\n",
+"r=10\n",
+"T3=-10+273 // temperature at entry of compressor\n",
+"T6=-40+273 // temperature at entry of turbine\n",
+"\n",
+"T5=T3 // heat exchanger\n",
+"T2=T6 // heat exchanger\n",
+"\n",
+"T4=T3*(r^((k-1)/k)) // temperature after compression\n",
+"T1=T6*(1/r^((k-1)/k)) // temperature after exit from turbine\n",
+"\n",
+"printf('The minimum temperature is %0.i degree celsius \n',T1-273)\n",
+"\n",
+"qin=Cp*(T2-T1) // heat input\n",
+"Wcomp=Cp*(T4-T3)// compressor work\n",
+"Wturb=Cp*(T6-T1) // turbine work\n",
+"\n",
+"COP=qin/(Wcomp-Wturb) // COP of refrigeration\n",
+"printf(' The COP is %0.3f ',COP) \n",
+"\n",
+"// the answer is correct within given limits"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.1: the_percent_clearance_and_the_MEP.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//solution\n",
+"// initialization of variables\n",
+"\n",
+"r=12 // compression ratio\n",
+"k=1.4 // polytropic index for air\n",
+"p1=200 // pressure at state 1 in kPa\n",
+"p3=10000 // pressure at state 3 in kPa\n",
+"\n",
+"c=100/(r-1) // clearance in percentage\n",
+"printf('The percent clearance is %0.2f %% \n',c)\n",
+"v3=100 // let us assume v3=100 m^3 for calculations\n",
+"p2=p1*(r**k) // polytopic process pressure relation\n",
+"p4=p3*(1/(r**k))// polytropic process pressure relation\n",
+"w34=v3*(r*p4-p3)/(1-k) // polytropic work done in process 3 to 4\n",
+"v2=v3 // constant volume process\n",
+"w12=v2*(p2-r*p1)/(1-k)\n",
+"wcycle=w12+w34 // total work in cycle\n",
+" // now equating the polytropic work calculated to work by MEP\n",
+"MEP=wcycle/(r*v2-v2) // as work = pressure*change in volume\n",
+"printf('The MEP is %i kPa',MEP) \n",
+"// The solution is wrong in textbook as calculation for P2 is wrong \n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.2: Otto_cycle_with_compression_ratio_of_10.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//solution\n",
+"// initialization of variables\n",
+"\n",
+"r=10 // compression ratio\n",
+"k=1.4 // polytropic index for air\n",
+"R=0.287 // specific gas constant for air\n",
+"Cv=0.717 // specific heat at constant volume\n",
+"Wnet=1000 // net work output in kJ/kg\n",
+"T1=227+273 // low air temperaure in kelvin\n",
+"p1=200 // low pressure in kPa\n",
+"\n",
+"effi=1-(1/r^(k-1)) // thermal efficeiency \n",
+"printf('The maximum possible thermal efficiency is %0.1f %% \n',effi*100)\n",
+"\n",
+"T2=T1*(r)^(k-1) // isentropic process temperature relation\n",
+"\n",
+"T4=((Wnet/Cv)+T2-T1)/((r^(k-1))-1) // using expression for work\n",
+"\n",
+"T3=T4*(r)^(k-1)\n",
+"\n",
+"efficarnot=1-T1/T3\n",
+"printf('The carnot efficiency is %0.1f %%',efficarnot*100)\n",
+"\n",
+"v1=R*T1/p1 // initial volume \n",
+"v2=v1/r // from compression ratio\n",
+"\n",
+"MEP=Wnet/(v1-v2) // mean effective pressure equation\n",
+"\n",
+"printf('The MEP is %0.0f kPa',MEP)\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.3: A_diesel_cycle_with_a_compression_ratio_18.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//solution\n",
+"// initialization of variables\n",
+"\n",
+"\n",
+"r=18 // compression ratio\n",
+"k=1.4 // polytropic index for air\n",
+"R=0.287 // specific gas constant for air\n",
+"Cv=0.717 // specific heat at constant volume\n",
+"Cp=1.0 // specific heat at constant pressure\n",
+"T1=200+273 // lower temperaure in kelvin\n",
+"P1=200 // low pressure in kPa\n",
+"T3=2000 // higher temperature of cycle in kelvin\n",
+"\n",
+"v1=R*T1/P1 // specific volume at state 1 in m^3\n",
+"v2=v1/r // specific volume after compression in m^3\n",
+"\n",
+"T2=T1*(v1/v2)^(k-1) // temperature after compression\n",
+"P2=P1*(v1/v2)^k // pressure after compression\n",
+"P3=P2 // diesel cycle\n",
+"v3=R*T3/P3 // volume at state 3\n",
+"\n",
+"rc=v3/v2 // cutoff ratio\n",
+"\n",
+"effi=1-((rc^k)-1)/(r^(k-1)*k*(rc-1))\n",
+"\n",
+"\n",
+"printf('The thermal efficiency is %0.2f %% \n',effi*100)\n",
+"\n",
+"v4=v1 // diesel cycle\n",
+"T4=T3*(v3/v4)^(k-1) // adiabatic process\n",
+"\n",
+"qin=Cp*(T3-T2) // using first law \n",
+"qout=Cv*(T4-T1) // heat rejected \n",
+"\n",
+"Wnet=qin-qout // net work\n",
+"MEP=Wnet/(v1-v2) // expression of mean effective pressure in terms of work\n",
+"\n",
+"printf(' The MEP is %i kPa',MEP)\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.4: without_constant_specific_heats.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//solution\n",
+"// initialization of variables\n",
+"\n",
+"r=18 // compression ratio\n",
+"k=1.4 // polytropic index for air\n",
+"R=0.287 // specific gas constant for air\n",
+"T1=200+273 // lower temperaure in kelvin\n",
+"P1=200 // low pressure in kPa\n",
+"T3=2000 // higher temperature of cycle in kelvin \n",
+"\n",
+"v1=R*T1/P1 // specific volume at state 1 in m^3\n",
+"//using table E.1\n",
+"u1=340 // specific internal energy in kJ/kg\n",
+"vr1=198.1 // in m^3/kg\n",
+"\n",
+"vr2=vr1*(1/r) // as r=v1/v2\n",
+"\n",
+"// now finding corresponding values from table E.1\n",
+"T2=1310 // temperature in kelvin\n",
+"Pr2=34 // pressure in kPa\n",
+"h2=1408 // specific entropy in kJ/kg\n",
+"v2=v1/18 // volume at state 2\n",
+"P2=R*T2/v2 // pressure at state 2\n",
+"\n",
+"h3=2252.1 // specific enthalpy in kJ/kg from table E.1\n",
+"vr3=2.776 \n",
+"P3=P2 // diesel cycle\n",
+"v3=R*T3/P3 // after compression volume\n",
+"v4=v1 // isochoric process\n",
+"vr4=vr3*v4/v3 // isentropic process\n",
+"// now using Vr4 we read corresponding value from table E.1\n",
+"T4=915 // final temperature in kelvin\n",
+"u4=687.5 // specific internal energy at state 4\n",
+"\n",
+"qin=h3-h2 // using first law \n",
+"qout=u4-u1 // heat rejected \n",
+"\n",
+"Wnet=qin-qout // net work\n",
+"effi=100*Wnet/qin // thermal efficiency\n",
+"printf('The thermal efficiency is %0.2f %% \n',effi)\n",
+"\n",
+"MEP=Wnet/(v1-v2) // expression of mean effective pressure in terms of work\n",
+"\n",
+"printf(' The MEP is %0.2f kPa \n',MEP)\n",
+"\n",
+"erroreffi=(66.6-effi)*100/effi // error in efficiency\n",
+"errorMEP=(515-MEP)*100/MEP // error in MEP\n",
+"\n",
+"printf(' The %% error in efficiency is %0.1f %% \n',erroreffi)\n",
+"printf(' The %% error in MEP is %0.1f %% \n',errorMEP)\n",
+"\n",
+"// the answers are slight different due to approximation in textbook ... here answers are precise"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.5: thermal_efficiency_for_this_Brayton_cycle.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//solution\n",
+"// initialization of variables\n",
+"Cp=1.0 // specific heat at constant pressure\n",
+"k=1.4 // polytropic index for air\n",
+"T1=25+273 // temperature at compressor inlet\n",
+"T3=850+273 // maximum temperature in kelvin\n",
+"\n",
+"r=5 // pressure ratio=P2/P1 & P4/P3\n",
+"\n",
+"T2=T1*(r)^((k-1)/k) // temperature after compression\n",
+"\n",
+"T4=T3*(1/r)^((k-1)/k) // final temperature\n",
+"\n",
+"Wcomp=Cp*(T2-T1) // compressor work\n",
+"Wturb=Cp*(T3-T4) // turbine work\n",
+"\n",
+"BWR=Wcomp/Wturb // back work ratio\n",
+"\n",
+"printf('The BWR is %0.1f %%\n',BWR*100) \n",
+"\n",
+"Effi=1-r^((1-k)/k) // thermal efficiency\n",
+"\n",
+"printf(' The thermal efficiency is %0.1f %% \n',Effi*100)\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.6: compressor_and_gas_turbine_have_efficiency_of_75_percent.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//solution\n",
+"// initialization of variables\n",
+"\n",
+"Cp=1.0 // specific heat at constant pressure\n",
+"k=1.4 // polytropic index for air\n",
+"T1=25+273 // temperature at compressor inlet\n",
+"T3=850+273 // maximum temperature in kelvin\n",
+"\n",
+"r=5 // pressure ratio=P2/P1 & P4/P3\n",
+"efficomp=0.75 // efficiency of compressor\n",
+"effiturb=0.75 // efficiency of turbine\n",
+"\n",
+"T2dash=T1*(r)^((k-1)/k) // temperature after compression\n",
+"Wcomp=Cp*(T2dash-T1)/efficomp // compressor work\n",
+"\n",
+"T4dash=T3*(1/r)^((k-1)/k) // final temperature\n",
+"Wturb=Cp*(T3-T4dash)*effiturb // turbine work\n",
+"\n",
+"BWR=100*Wcomp/Wturb // back work ratio\n",
+"\n",
+"printf('The BWR is %0.1f %%\n',BWR) \n",
+"\n",
+"T2=(Wcomp/Cp)+T1 // actual temperature of state 2\n",
+"\n",
+"qin=Cp*(T3-T2) // using first law \n",
+"\n",
+"Wnet=(Wturb-Wcomp) // net work\n",
+"\n",
+"effi=100*Wnet/qin // thermal efficiency\n",
+"printf('The thermal efficiency is %0.2f %% \n',effi)\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.7: ideal_regenerator_to_the_gas_turbine_cycle.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//solution\n",
+"// initialization of variables\n",
+"\n",
+"Cp=1.0 // specific heat at constant pressure\n",
+"k=1.4 // polytropic index for air\n",
+"T1=25+273 // temperature at compressor inlet\n",
+"T3=850+273 // maximum temperature in kelvin\n",
+"\n",
+"r=5 // pressure ratio=P2/P1 & P4/P3\n",
+"\n",
+"T2=T1*(r)^((k-1)/k) // temperature after compression\n",
+"\n",
+"T4=T3*(1/r)^((k-1)/k) // final temperature\n",
+"\n",
+"Wcomp=Cp*(T2-T1) // compressor work\n",
+"Wturb=Cp*(T3-T4) // turbine work\n",
+"\n",
+"BWR=Wcomp/Wturb // back work ratio\n",
+"\n",
+"printf('The BWR is %0.1f %%\n',BWR*100) \n",
+"\n",
+"effi=(1-((T1/T4)*(r^((k-1)/k))))// efficiency\n",
+"printf(' The thermal efficiency is %0.1f %% \n',effi*100)\n",
+"// The solution in textbook is incorrect dur to wrong value of T4 (temperature at state 4)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.8: gas_turbine_provides_the_energy_to_the_boiler.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"clear\n",
+"//solution\n",
+"// initialization of variables\n",
+"\n",
+"//REFER TO FIG.:7.8\n",
+"\n",
+"Cp=1 // specific constant at constant pressure\n",
+"k=1.4 // polytropic constant for air\n",
+"T5=25+273 // temperature at state 5 in kelvin\n",
+"T7=850+273 // temperature at state 4 in kelvin\n",
+"T9=350 // exit temperature of water from bolier in kelvin\n",
+"WdotST=100000 // power from steam turbine in Watt\n",
+"r=5 // pressure ratio=P2/P1 & P4/P3\n",
+"\n",
+"h1=192 // specific enthalpy at 10 Kpa from steam table\n",
+"h2=h1 // isenthalpic process\n",
+"h3=3214 // specific enthalpy at 4 Mpa and 400 degree celsius from steam table\n",
+"s3=6.769 // specific entropy at 4 Mpa and 400 degree celsius from steam table\n",
+"\n",
+"s4=s3 // isentropic process\n",
+"sf=0.6491 // specific entropy of saturated liquid at 10 kPa and 45 degree celsiusfrom table C.2\n",
+"sg=8.1510 // specific entropy of saturated liquid at 10 kPa and 45 degree celsiusfrom table C.2\n",
+"x4=(s4-sf)/(sg-sf) // quality of steam\n",
+"\n",
+"hf=h1 // specific enthalpy of saturated liquid @ 10 Kpa \n",
+"hg=2584.6\n",
+"h4=hf+x4*(hg-hf) // specific entropy at state 4\n",
+"\n",
+"mdots=WdotST/(h3-h4) // steam mass flow rate from turbine output\n",
+"\n",
+"T6=T5*(r^((k-1)/k)) // adiabatic process relation\n",
+"T8=T7*(1/r^((k-1)/k)) // adiabatic process relation\n",
+"\n",
+"// Now using energy balance in boiler\n",
+"mdota=mdots*(h3-h2)/(Cp*(T8-T9)) // mass flow rate of water\n",
+"Wdotturb=mdota*Cp*(T7-T8) // power produced by turbine\n",
+"\n",
+"Wdotcomp=mdota*Cp*(T6-T5) // energy needed by compressor\n",
+"\n",
+"WdotGT=Wdotturb-Wdotcomp // net turbine work\n",
+"\n",
+"Qdotin=mdota*Cp*(T7-T6) // energy input by combustor\n",
+"\n",
+"effi=100*(WdotST+WdotGT)/Qdotin // combined efficiency\n",
+"\n",
+"printf('The thermal efficiency of the combined cycle is %0.1f %% ',effi)\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.9: compressor_with_compression_ratio_of_10.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"clear\n",
+"//solution\n",
+"// initialization of variables\n",
+"\n",
+"Cp=1 // specific constant at constant pressure\n",
+"k=1.4 // polytropic constant for air\n",
+"r=10\n",
+"T2=-10+273 // temperature at entry of compressor\n",
+"T4=30+273 // temperature at entry of turbine\n",
+"\n",
+"T3=T2*(r^((k-1)/k)) // temperature at state 3 in kelvin\n",
+"T1=T4*(1/r^((k-1)/k)) // temperature at state 1 in degree celsius\n",
+"printf('The minimum temperature is %0.1f degree celsius \n',T1-273)\n",
+"\n",
+"qin=Cp*(T2-T1) // heat input\n",
+"Wcomp=Cp*(T3-T2)// compressor work\n",
+"Wturb=Cp*(T4-T1) // turbine work\n",
+"\n",
+"COP=qin/(Wcomp-Wturb) // COP of refrigeration\n",
+"printf(' The COP is %0.2f ',COP)"
+ ]
+ }
+],
+"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
+}