summaryrefslogtreecommitdiff
path: root/Basic_And_Applied_Thermodynamics_by_P._K._Nag
diff options
context:
space:
mode:
authorTrupti Kini2016-11-25 23:30:54 +0600
committerTrupti Kini2016-11-25 23:30:54 +0600
commitf0c24554eb84d718c4938d7cfa3735f4dd1be7e2 (patch)
tree16d822af7b0292293f4cff502f67554aaa6b89ef /Basic_And_Applied_Thermodynamics_by_P._K._Nag
parent103a54c081b98c88c98f0a5d689f7b148b9a6502 (diff)
downloadPython-Textbook-Companions-f0c24554eb84d718c4938d7cfa3735f4dd1be7e2.tar.gz
Python-Textbook-Companions-f0c24554eb84d718c4938d7cfa3735f4dd1be7e2.tar.bz2
Python-Textbook-Companions-f0c24554eb84d718c4938d7cfa3735f4dd1be7e2.zip
Added(A)/Deleted(D) following books
A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter10_kN6Dpid.ipynb A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter11_tIlzIkR.ipynb A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter12_PgrcCS3.ipynb A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter1_eLqBEle.ipynb A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter2_F25WLJ6.ipynb A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter3_Eijvt7y.ipynb A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter4_rlhSgIB.ipynb A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter5_YQ3b0EW.ipynb A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter6_raABo34.ipynb A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter7_52Xb53f.ipynb A BSc_First_Year_Physics_by_P._BalaBhaskar,_N._Srinivasa_Rao,_B._Sanjeeva_Rao/Chapter8_mk2HyQz.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter10_NUnB5Sw.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter11_pIim3x0.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter12_9A34qBU.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter13_ZusP0LZ.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter14_HgYvpWb.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter15_o1Meb0U.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter16_xq1IcPx.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter17_JAzeWmK.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter18_7Yy7cvJ.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter19_GQTZX04.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter1_seG0iD4.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter20_7AIMdUg.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter21_ingIztX.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter22_yljf4OR.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter2_exrY10K.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter3_4zPOo0N.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter4_UHVlvXM.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter5_He9TCwH.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter6_569mm1H.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter7_uRawaHX.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter8_KEcrcQP.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter9_2XNkqrL.ipynb A Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/16.11_EVddapc.png A Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/3.3_hWZB9rU.png A Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/7.10_IDdNUer.png A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter11_0YOsUSl.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter12_hzQe7ah.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter13_DuT5TXy.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter14_3UXi8E3.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter15_YmFtkbT.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter16_NzhdF5v.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter18_gAN9M3I.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter19_d2Dk0b0.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter20_oPoeIwV.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter21_g3i9pmI.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter22_kZ51MuY.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter23_MeQwZwE.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter2_9eBOyNb.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter5_0stc93N.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter6_Qjw2zj2.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter8_1dOnAi7.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter9_12ISo6t.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/screenshots/pic1_SdzvQJK.png A Electrical_&_Electronic_Systems_by_Neil_Storey/screenshots/pic2_6vjSxZe.png A Electrical_&_Electronic_Systems_by_Neil_Storey/screenshots/pic3_vqn3sAt.png A Problems_in_Electrical_Engineering_by_Parker_Smith/README.txt A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter10_QlnhZhy.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter11_0iM0C4n.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter12_KLDtsnD.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter13_PUt6mPw.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter14_1MNPptQ.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter15_xVW7XGn.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter16_au5Aji1.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter17_0ixqhLJ.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter18_jjgTIC5.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter19_Z3Jn476.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter1_nKyAwVf.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter2_jki9geU.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter3_9BtkYo4.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter4_KaWbXff.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter5_NTVaiVF.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter7_fElJXKG.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter8_P6SjSkH.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/Chapter9_5BJhRQ7.ipynb A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/screenshots/11.4_upwwc7G.png A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/screenshots/13.1_fg5oW41.png A RCC_Theory_and_Design_by_M._G._Shah_and_C._M._Kale/screenshots/15.4_yoOlH2F.png A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter01.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter02.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter03.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter04.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter05.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter06.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter07.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter08.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter09.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter10.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter11.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter12.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter13.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter14.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter15.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter16.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter17.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter18.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/Chapter19.ipynb A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/screenshots/15.8.png A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/screenshots/4.3.png A Thermodynamics,_Statistical_Thermodynamics_and_Kinetics_by_T._Engel_and_P._Reid/screenshots/9.6.png A f_by_df/1_An_overview_of_C.ipynb A f_by_df/screenshots/amit_Das.png A f_by_df/screenshots/amit_Das_2s4uFcV.png A f_by_df/screenshots/anshul_zMmwiWY.png A sample_notebooks/RahulJoshi/Chapter_1_An_Overview_of_Heat_Trasnfer.ipynb
Diffstat (limited to 'Basic_And_Applied_Thermodynamics_by_P._K._Nag')
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter10_NUnB5Sw.ipynb599
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter11_pIim3x0.ipynb221
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter12_9A34qBU.ipynb890
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter13_ZusP0LZ.ipynb641
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter14_HgYvpWb.ipynb735
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter15_o1Meb0U.ipynb760
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter16_xq1IcPx.ipynb555
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter17_JAzeWmK.ipynb323
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter18_7Yy7cvJ.ipynb706
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter19_GQTZX04.ipynb1372
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter1_seG0iD4.ipynb121
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter20_7AIMdUg.ipynb912
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter21_ingIztX.ipynb528
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter22_yljf4OR.ipynb497
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter2_exrY10K.ipynb113
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter3_4zPOo0N.ipynb370
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter4_UHVlvXM.ipynb343
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter5_He9TCwH.ipynb465
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter6_569mm1H.ipynb365
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter7_uRawaHX.ipynb453
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter8_KEcrcQP.ipynb1023
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter9_2XNkqrL.ipynb925
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/16.11_EVddapc.pngbin0 -> 76256 bytes
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/3.3_hWZB9rU.pngbin0 -> 24766 bytes
-rw-r--r--Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/7.10_IDdNUer.pngbin0 -> 67805 bytes
25 files changed, 12917 insertions, 0 deletions
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter10_NUnB5Sw.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter10_NUnB5Sw.ipynb
new file mode 100644
index 00000000..49866ab5
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter10_NUnB5Sw.ipynb
@@ -0,0 +1,599 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 10: Properties of gases and gas mixture"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex10.1:pg-366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 10.1\n",
+ "\n",
+ "\n",
+ " The final equilibrium pressure is 1.16869318853 MPa\n",
+ "\n",
+ " The amount of heat transferred to the surrounding is -226.04503125 kJ\n",
+ " \n",
+ "\n",
+ " If the vessel is perfectly insulated\n",
+ "\n",
+ " The final temperature is 45.4545454545 degree Celsius\n",
+ "\n",
+ " The final pressure is 1.24058552709 MPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "Pa = 1.5 # Pressure in vessel A in MPa\n",
+ "Ta = 50 # Temperature in vessel A in K\n",
+ "ca = 0.5 # Content in vessel A in kg mol\n",
+ "Pb = 0.6 # Pressure in vessel B in MPa\n",
+ "Tb = 20 # Temperature in vessel B in K\n",
+ "mb = 2.5 # Content in vessel B in kg mol\n",
+ "R = 8.3143 # Universal gas constant\n",
+ "Va = (ca*R*(Ta+273))/(Pa*1e03) # volume of vessel A\n",
+ "ma = ca*28 # mass of gas in vessel A\n",
+ "Rn = R/28 # Gas content to of nitrogen\n",
+ "Vb = (mb*Rn*(Tb+273))/(Pb*1e03) # volume of vessel B\n",
+ "V = Va + Vb # Total volume\n",
+ "m = ma + mb # Total mass\n",
+ "Tf = 27 # Equilibrium temperature in degree Celsius\n",
+ "P = (m*Rn*(Tf+273))/V # Equilibrium pressure \n",
+ "g = 1.4 # Heat capacity ratio\n",
+ "cv = Rn/(g-1) # Heat capacity at constant volume\n",
+ "U1 = cv*(ma*Ta+mb*Tb) # Initial internal energy \n",
+ "U2 = m*cv*Tf# Final internal energy \n",
+ "Q = U2-U1 # heat transferred\n",
+ "\n",
+ "print \"\\n Example 10.1\"\n",
+ "print \"\\n\\n The final equilibrium pressure is \",P/1e3 ,\" MPa\"\n",
+ "print \"\\n The amount of heat transferred to the surrounding is \",Q ,\" kJ\"\n",
+ "#The answers vary due to round off error\n",
+ "\n",
+ "T_ = (ma*Ta+mb*Tb)/m # final temperature\n",
+ "P_ = (m*Rn*(T_+273))/V # final pressure\n",
+ "print \" \\n\\n If the vessel is perfectly insulated\"\n",
+ "print \"\\n The final temperature is \",T_ ,\" degree Celsius\"\n",
+ "print \"\\n The final pressure is \",P_/1e3 ,\" MPa\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex10.2:pg-368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 10.2\n",
+ "\n",
+ "\n",
+ " Gas constant of the gas is 0.461 kJ/kg K \n",
+ "\n",
+ " Molecular weight the gas is 18.0347071584 kg/kg mol\n",
+ "\n",
+ " The heat transfer at constant volume is 286.33 kJ\n",
+ "\n",
+ " Work done is 0 kJ\n",
+ "\n",
+ " The change in internal energy is 286.33 kJ\n",
+ "\n",
+ " The change in enthalpy is 373.92 kJ\n",
+ "\n",
+ " The change in entropy is 0.885987320143 kJ/k\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "cp = 1.968 # Heat capacity in kJ/kg\n",
+ "cv = 1.507 # Heat capacity in kJ/kg\n",
+ "R_ = 8.314 # Gas constant\n",
+ "V = 0.3 # Volume of chamber in m**3\n",
+ "m = 2 # mass of gas in kg\n",
+ "T1 = 5.0# Initial gas temperature in degree Celsius\n",
+ "T2 = 100.0 # Final gas temperature in degree Celsius\n",
+ "R = cp-cv # Universal gas constant\n",
+ "mu = R_/R # molecular weight\n",
+ "Q12 = m*cv*(T2-T1) # The heat transfer at constant volume\n",
+ "W12 = 0 # work done\n",
+ "U21 = Q12 # change in internal energy\n",
+ "H21= m*cp*(T2-T1) # change in enthalpy\n",
+ "S21 = m*cv*math.log((T2+273)/(T1+273)) #change in entropy \n",
+ "\n",
+ "print \"\\n Example 10.2\"\n",
+ "print \"\\n\\n Gas constant of the gas is \",R ,\" kJ/kg K \"\n",
+ "print \"\\n Molecular weight the gas is \",mu ,\" kg/kg mol\"\n",
+ "print \"\\n The heat transfer at constant volume is \",Q12 ,\" kJ\"\n",
+ "print \"\\n Work done is \",0 ,\" kJ\"\n",
+ "print \"\\n The change in internal energy is \",U21 ,\" kJ\"\n",
+ "print \"\\n The change in enthalpy is \",H21 ,\" kJ\"\n",
+ "print \"\\n The change in entropy is \",S21 ,\" kJ/k\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex10.3:pg-369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 10.3\n",
+ "\n",
+ " The work done in the expansion is 300.72200185 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "from scipy import integrate\n",
+ "m = 1.5 # Mass of gas in kg\n",
+ "P1 = 5.6 # Initial pressure of gas in MPa\n",
+ "V1 = 0.06 # Initial volume of gas in m**3\n",
+ "T2_ = 240 # Final temperature of gas in degree Celsius\n",
+ "a = 0.946 # Constant\n",
+ "b = 0.662 # Constant\n",
+ "k = 1e-4 # Constant\n",
+ "# Part (b)\n",
+ "R = a-b # constant\n",
+ "T2 = T2_+273 # Final temperature of gas in KK\n",
+ "T1 = (P1*1e03*V1)/(m*R) # Initial temperature\n",
+ "W12,er =integrate.quad(lambda T:m*(b+k*T),T1,T2) # Work done\n",
+ "\n",
+ "print \"\\n Example 10.3\"\n",
+ "print \"\\n The work done in the expansion is \",-W12 ,\" kJ\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex10.5:pg-371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 10.5\n",
+ "\n",
+ " The work transfer for the whole path is 93.4986082985 kJ\n",
+ "\n",
+ " The heat transfer for the whole path 571.638005316 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "m = 0.5 # mass of air in kg\n",
+ "P1 = 80 # Initial pressure kPa\n",
+ "T1 = 60 # Initial temperature in degree Celsius\n",
+ "P2 = 0.4 # Final pressure in MPa\n",
+ "R = 0.287 # Gas constant\n",
+ "V1 = (m*R*(T1+273))/(P1) # Volume of air at state 1\n",
+ "g = 1.4 # Heat capacity ratio\n",
+ "T2 = (T1+273)*(P2*1e3/P1)**((g-1)/g)# Final temperature\n",
+ "W12 = (m*R*(T1+273-T2))/(g-1) # Work done in \n",
+ "V2 = V1*((P1/(P2*1e3))**(1/g)) # Final volume\n",
+ "W23 = P2*(V1-V2)*1e3 # # Work done\n",
+ "W = W12+W23 # Net work done\n",
+ "V3 = V1 # constant volume\n",
+ "T3 = (T2)*(V3/V2) # Temperature at state 3\n",
+ "cp = 1.005 # Heat capacity at constant volume in kJ/kgK\n",
+ "Q = m*cp*(T3-T2)# Heat transfer\n",
+ "print \"\\n Example 10.5\"\n",
+ "print \"\\n The work transfer for the whole path is \",W ,\" kJ\"\n",
+ "#The answers vary due to round off error\n",
+ "print \"\\n The heat transfer for the whole path \",Q ,\" kJ\"\n",
+ "#The answer provided in the textbook is wrong\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex10.6:pg-372"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 10.6\n",
+ "\n",
+ " The heat received in the cycle is 137.268292683 kJ\n",
+ "\n",
+ " The heat rejected in the cycle 84.2666952566 kJ\n",
+ "\n",
+ " The efficiency of the cycle is 39.0 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "P1 = 700 # Initial pressure of gas in kPa\n",
+ "T1 = 260 # Initial temperature of gas in degree Celcius \n",
+ "T3 = T1 # Temperature at state 3\n",
+ "V1 = 0.028 # Initial volume of gas in m**3\n",
+ "V2 = 0.084 # Final volume of gas in m**3\n",
+ "R = 0.287 # Gas constant\n",
+ "m = (P1*V1)/(R*(T1+273)) # mass of gas \n",
+ "P2 = P1 # Pressure at state 2\n",
+ "T2 = (T1+273)*((P2*V2)/(P1*V1)) # Temperature at state 2\n",
+ "n = 1.5 # polytropic index \n",
+ "P3 = P2*(((T3+273)/(T2))**(n/(n-1))) # Pressure at state 3\n",
+ "cp = 1.005 # COnstant pressure heat capacity in kJ/kgK\n",
+ "cv = 0.718 # COnstant volume heat capacity in kJ/kgK\n",
+ "Q12 = m*cp*(T2-T1-273) # HEat transfer\n",
+ "Q23 = m*cv*(T3+273-T2) + (m*R*(T2-T3-273))/(n-1) # Heat transfer\n",
+ "Q31 = m*R*(T1+273)*math.log(P3/P2) # Heat transfer\n",
+ "Q1 = Q12 # Heat equivalance\n",
+ "Q2 = -(Q23+Q31) # Net heat transfer\n",
+ "e = 1-(Q2/Q1) # First law efficiency\n",
+ "\n",
+ "print \"\\n Example 10.6\"\n",
+ "print \"\\n The heat received in the cycle is \",Q1 ,\" kJ\"\n",
+ "print \"\\n The heat rejected in the cycle \",Q2 ,\" kJ\"\n",
+ "print \"\\n The efficiency of the cycle is \",math. ceil(e*100) ,\" percent\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex10.7:pg-374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 10.7\n",
+ "\n",
+ " Cv of the gas is 0.661000944287 kJ/kg K\n",
+ "\n",
+ " Cp of the gas is 0.89896128423 kJ/kg K\n",
+ "\n",
+ " Increase in the entropy of the gas is 0.080159241414 kJ/kg K\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "P1 = 300 # Initial gas pressure in kPa\n",
+ "V1 = 0.07 # Initial volume of gas in m**3\n",
+ "m = 0.25 # Mass of gas in kg\n",
+ "T1 = 80 # Initial temperature of gas in degree Celsius\n",
+ "R = (P1*V1)/(m*(T1+273)) # constant\n",
+ "P2 = P1 # process condition\n",
+ "V2 = 0.1 # Final volume in m**3\n",
+ "T2 = (P2*V2)/(m*R) # Final temperature in K\n",
+ "W = -25 #Work done in kJ\n",
+ "cv = -W/(m*(T2-T1-273)) # Constant volume heat capacity in kJ/kg\n",
+ "cp = R+cv #Constant pressure heat capacity in kJ/kg\n",
+ "S21 = m*cp*math.log(V2/V1) # Entropy change\n",
+ "print \"\\n Example 10.7\"\n",
+ "print \"\\n Cv of the gas is \",cv ,\" kJ/kg K\"\n",
+ "print \"\\n Cp of the gas is \",cp ,\" kJ/kg K\"\n",
+ "print \"\\n Increase in the entropy of the gas is \",S21 ,\" kJ/kg K\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex10.8:pg-374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 10.8\n",
+ "\n",
+ "\n",
+ " Mole fraction of N2 is 0.485294117647\n",
+ "\n",
+ " Mole fraction of CO2 is 0.514705882353\n",
+ "\n",
+ " Equivalent molecular weight of mixture is 36.2352941176 kg/kg mol\n",
+ "\n",
+ "\n",
+ " The equivalent gas constant of the mixture is 0.229444805195 kJ/kg K\n",
+ "\n",
+ "\n",
+ " Partial pressures of nitrogen and CO2 are \n",
+ " 145.588235294 kPa and 154.411764706 kPa respectively\n",
+ "\n",
+ " Partial volume of nitrogen and CO2 are \n",
+ " 0.870000714286 kPa and 0.922728030303 kPa respectively\n",
+ "\n",
+ "\n",
+ " Total volume of mixture is 1.79272874459 m**3\n",
+ "\n",
+ " Density of mixture is 4.46247098126 kg/m**3\n",
+ "\n",
+ "\n",
+ " Cp and Cv of mixture are \n",
+ " 0.920740483948 kJ/kg K and 0.691295678753 kJ/kg K respectively\n",
+ "\n",
+ "\n",
+ " Change in internal energy of the system heated at constant volume is 110.6073086 kJ\n",
+ "\n",
+ " Change in enthalpy of the system heated at constant volume is 147.318477432 kJ\n",
+ "\n",
+ " Change in entropy of the system heated at constant volume is 0.36517324538 kJ/kg K\n",
+ "\n",
+ "\n",
+ " Change in entropy of the system heated at constant Pressure is 0.486376236695 kJ/kgK\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "mn = 3.0 # Mass of nitrogen in kg\n",
+ "mc = 5.0 # mass of CO2 in kg\n",
+ "an = 28.0 # Atomic weight of nitrogen\n",
+ "ac = 44.0 # Atomic weight of CO2\n",
+ "# Part (a)\n",
+ "xn = (mn/an)/((mn/an)+(mc/ac)) # mole fraction of nitrogen\n",
+ "xc = (mc/ac)/((mn/an)+(mc/ac)) # mole fraction of carbon\n",
+ "\n",
+ "print \"\\n Example 10.8\"\n",
+ "print \"\\n\\n Mole fraction of N2 is \",xn \n",
+ "print \"\\n Mole fraction of CO2 is \",xc\n",
+ "#The answers vary due to round off error\n",
+ "\n",
+ "# Part (b)\n",
+ "M = xn*an+xc*ac # Equivalent molecular weight\n",
+ "print \"\\n Equivalent molecular weight of mixture is \",M ,\"kg/kg mol\" \n",
+ "\n",
+ "# Part (c)\n",
+ "R = 8.314 # Gas constant\n",
+ "Req = ((mn*R/an)+(mc*R/ac))/(mn+mc)\n",
+ "print \"\\n\\n The equivalent gas constant of the mixture is \",Req ,\" kJ/kg K\" \n",
+ "\n",
+ "# Part (d)\n",
+ "P = 300.0 # Initial pressure in kPa\n",
+ "T = 20.0 # Initial temperature in degree Celsius\n",
+ "Pn = xn*P # Partial pressure of Nitrogen\n",
+ "Pc = xc*P # Partial pressure of CO2 \n",
+ "Vn = (mn*R*(T+273))/(P*an) # Volume of nitrogen\n",
+ "Vc = (mc*R*(T+273))/(P*ac) # Volume of CO2\n",
+ "print \"\\n\\n Partial pressures of nitrogen and CO2 are \\n \",Pn ,\" kPa and \",Pc ,\" kPa respectively\"\n",
+ "print \"\\n Partial volume of nitrogen and CO2 are \\n \",Vn ,\" kPa and \",Vc ,\" kPa respectively\"\n",
+ "# Part (e)\n",
+ "V = (mn+mc)*Req*(T+273)/P # Total volume\n",
+ "rho = (mn+mc)/V # mass density\n",
+ "print \"\\n\\n Total volume of mixture is \",V ,\" m**3\" \n",
+ "print \"\\n Density of mixture is \",rho ,\" kg/m**3\" \n",
+ "\n",
+ "# Part (f)\n",
+ "gn = 1.4 # Heat capacity ratio for nitrogen\n",
+ "gc = 1.286 # Heat capacity ratio for carbon dioxide \n",
+ "cvn = R/((gn-1)*an) # cp and cv of N2\n",
+ "cpn = gn*cvn # Constant pressure heat capacity of nitrogen\n",
+ "cvc = R/((gc-1)*ac) # cp and cv of CO2\n",
+ "cpc = gc*cvc# COnstant pressure heat capacity of carbon dioxide \n",
+ "cp = (mn*cpn+mc*cpc)/(mn+mc) # Constant pressure heat capacity ratio of mixture\n",
+ "cv = (mn*cvn+mc*cvc)/(mn+mc) # Constant volume Heat capacity ratio of mixture\n",
+ "print \"\\n\\n Cp and Cv of mixture are \\n \",cp ,\"kJ/kg K and \",cv ,\"kJ/kg K respectively\" \n",
+ "T1 = T \n",
+ "T2 = 40 \n",
+ "U21 = (mn+mc)*cv*(T2-T1)\n",
+ "H21 = (mn+mc)*cp*(T2-T1)\n",
+ "S21v = (mn+mc)*cv*math.log((T2+273)/(T1+273)) # If heated at constant volume\n",
+ "S21p = (mn+mc)*cp*math.log((T2+273)/(T1+273)) # If heated at constant Pressure\n",
+ "\n",
+ "print \"\\n\\n Change in internal energy of the system heated at constant volume is \",U21 ,\"kJ\" \n",
+ "print \"\\n Change in enthalpy of the system heated at constant volume is \",H21 ,\"kJ\" \n",
+ "print \"\\n Change in entropy of the system heated at constant volume is \",S21v ,\" kJ/kg K\"\n",
+ "print \"\\n\\n Change in entropy of the system heated at constant Pressure is \",S21p ,\"kJ/kgK\" \n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex10.9:pg-375"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 10.9\n",
+ "\n",
+ " Increase in entropy is 1.22920562691 kJ/kg K\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "mo = 2.0 # mass of oxygen in kg\n",
+ "mn = 6.0 # mass of nitrogen in kg\n",
+ "muo = 32.0 # molecular mass of oxygen\n",
+ "mun = 28.0 # molecular mass of nitrogen\n",
+ "o = mo/muo # mass fraction of oxygen\n",
+ "n = mn/mun # mass fraction of nitrogen\n",
+ "xo = o/(n+o) # mole fraction of oxygen\n",
+ "xn = n/(n+o) # mole fraction of nitrogen\n",
+ "R = 8.314 # Universal gas constant\n",
+ "Ro = R/muo # Gas constant for oxygen\n",
+ "Rn = R/mun # Gas constant for nitrogen\n",
+ "dS = -mo*Ro*math.log(xo)-mn*Rn*math.log(xn) # Increase in entropy \n",
+ "\n",
+ "print \"\\n Example 10.9\"\n",
+ "print \"\\n Increase in entropy is \",dS ,\" kJ/kg K\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex10.10:pg-376"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 10.10\n",
+ "\n",
+ " Specific volume is 3.05515367719 *10**-3 m3/kg\n",
+ "\n",
+ " Specific temperature is 57.85 K\n",
+ "\n",
+ " Specific pressure is 5.46 MPa\n",
+ "\n",
+ " Reduced volume is 1.48226362179 m3/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "an = 20.183 # molecular weight of neon\n",
+ "Pc = 2.73 # Critical pressure\n",
+ "Tc = 44.5 # Critical tmperature in Kelvin\n",
+ "Vc = 0.0416 # volume of gas in m**3\n",
+ "Pr = 2 # Reduced Pressure\n",
+ "Tr = 1.3 # Reduced temperature\n",
+ "Z = 0.7 # Compressibility factor\n",
+ "P = Pr*Pc # Corresponding Pressure \n",
+ "T = Tr*Tc # Corresponding temperature\n",
+ "R = 8.314 # Gas constant\n",
+ "v = (Z*R*T)/(P*an) # Corresponding volume\n",
+ "vr = (v*an)/(Vc*1e3) # reduced volume\n",
+ "\n",
+ "print \"\\n Example 10.10\"\n",
+ "print \"\\n Specific volume is \",v ,\" *10**-3 m3/kg\"\n",
+ "print \"\\n Specific temperature is \",T ,\" K\"\n",
+ "print \"\\n Specific pressure is \",P ,\" MPa\"\n",
+ "print \"\\n Reduced volume is \",vr ,\" m3/kg\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter11_pIim3x0.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter11_pIim3x0.ipynb
new file mode 100644
index 00000000..3e09ba67
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter11_pIim3x0.ipynb
@@ -0,0 +1,221 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 11:Thermodynamic relations Equilibrium and stability"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex11.3:pg-436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 11.3\n",
+ "\n",
+ " Vapour pressure of benzene is 17.6682592008 kPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "Tb = 353.0 # boiling point of benzene in K\n",
+ "T = 303.0 # Operational temperature in K\n",
+ "R = 8.3143 #Gas constant\n",
+ "P = 101.325*math.exp((88/R)*(1.0-(Tb/T)))\n",
+ "\n",
+ "print \"\\n Example 11.3\"\n",
+ "print \"\\n Vapour pressure of benzene is \",P ,\" kPa\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex11.4:pg-436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 11.4\n",
+ "\n",
+ " Temperature at triple point is 195.197740113 K\n",
+ "\n",
+ " Pressure at triple point is 44.631622076 mm Hg\n",
+ "\n",
+ "\n",
+ " Latent heat of sublimation is 31211.8822 kJ/kg mol\n",
+ "\n",
+ " Latent heat of vapourization is is 25466.7009 kJ/kg mol\n",
+ "\n",
+ " Latent heat of fusion is 5745.1813 kJ/kg mol\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T = (3754-3063)/(23.03-19.49) # Temperature at triple point in K\n",
+ "P = math.exp(23.03-(3754/195.2)) # Pressure at triple point\n",
+ "R = 8.3143 # Gas constant\n",
+ "Lsub = R*3754 # Latent heat of sublimation\n",
+ "Lvap = 3063*R # Latent heat of vaporisation\n",
+ "Lfu = Lsub-Lvap # Latent heat of fusion\n",
+ "\n",
+ "print \"\\n Example 11.4\"\n",
+ "print \"\\n Temperature at triple point is \",T ,\" K\"\n",
+ "print \"\\n Pressure at triple point is \",P ,\" mm Hg\"\n",
+ "print \"\\n\\n Latent heat of sublimation is \",Lsub ,\" kJ/kg mol\"\n",
+ "print \"\\n Latent heat of vapourization is is \",Lvap ,\" kJ/kg mol\"\n",
+ "print \"\\n Latent heat of fusion is \",Lfu ,\" kJ/kg mol\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex11.6:pg-438"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 11.6\n",
+ "\n",
+ "\n",
+ " Energy of first system is 1.6212885 kJ,\n",
+ " Energy of second system is 2.43193275 kJ,\n",
+ " Volume of first system is 0.008 m**3,\n",
+ " Volume of second system is 0.012 m**3,\n",
+ " Pressure is 135.107375 kN/m**2,\n",
+ " Temperature is 260.0 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "R = 8.3143 # Gas constant in kJ/kg-mol-K\n",
+ "N1 = 0.5 # Mole no. of first system\n",
+ "N2 = 0.75 # Mole no. of second system\n",
+ "T1 = 200 # Initial temperature of first system in K\n",
+ "T2 = 300 # Initial temperature of second system in K\n",
+ "v = 0.02 # Total volume in m**3\n",
+ "print \"\\n Example 11.6\\n\"\n",
+ "Tf = (T2*N2+T1*N1)/(N1+N2)\n",
+ "Uf_1 = (3.0/2.0)*(R*N1*Tf)*(10**-3)\n",
+ "Uf_2 = (3.0/2.0)*(R*N2*Tf)*(10**-3)\n",
+ "pf = (R*Tf*(N1+N2)*(10**-3))/v\n",
+ "Vf_1 = R*N1*(10**-3)*Tf/pf\n",
+ "Vf_2 = v-Vf_1\n",
+ "print \"\\n Energy of first system is \",Uf_1 ,\" kJ,\\n Energy of second system is \",Uf_2 ,\" kJ,\\n Volume of first system is \",Vf_1 ,\" m**3,\\n Volume of second system is \",Vf_2 ,\" m**3,\\n Pressure is \",pf ,\" kN/m**2,\\n Temperature is \",Tf ,\" K.\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex11.10:pg-446"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 11.10 \n",
+ "\n",
+ " Power required to run the compressor = -10.6853713009 kW, \n",
+ " The rate at which heat must be removed from the compressor = -11.9346733668 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "R = 0.082 # Gas constant in litre-atm/gmol-K\n",
+ "m = 1.5 # Mass flow rate in kg/s\n",
+ "p1 = 1.0 # Pressure in atm\n",
+ "t2 = 300.0 # Temperature after compression in K\n",
+ "p2 = 400.0 # Pressure after compression in atm\n",
+ "Tc = 151.0 # For Argon in K\n",
+ "pc = 48.0 # For Argon in atm\n",
+ "print \"\\n Example 11.10 \"\n",
+ "a = 0.42748*((R*1000)**2)*((Tc)**2)/pc\n",
+ "b = 0.08664*(R*1000)*(Tc)/pc\n",
+ "# By solving equation v2**2 - 49.24*v2**2 + 335.6*v2 - 43440 = 0\n",
+ "v2 = 56.8 # In cm**3/g mol\n",
+ "v1 = (R*1000)*(t2)/p1\n",
+ "delta_h = -1790 # In J/g mol\n",
+ "delta_s = -57 # In J/g mol\n",
+ "Q = (t2*delta_s*(10**5)/39.8)/(3600*1000)\n",
+ "W = Q - (delta_h*(10**5)/39.8)/(3600*1000)\n",
+ "print \"\\n Power required to run the compressor = \",W ,\" kW, \\n The rate at which heat must be removed from the compressor = \",Q ,\" kW\"\n",
+ "# Answers vary due to round off error.\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter12_9A34qBU.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter12_9A34qBU.ipynb
new file mode 100644
index 00000000..540dfc4d
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter12_9A34qBU.ipynb
@@ -0,0 +1,890 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 12: Vapour power cycle"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex12.1:pg-492"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 12.1\n",
+ "\n",
+ " The work required in saturated liquid form is -0.9387 kJ/kg\n",
+ "\n",
+ " The work required in saturated vapor form is -520.0 kJ/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Part (a)\n",
+ "P1 = 1 # Initial pressure in bar\n",
+ "P2 = 10 # Final pressure in bar\n",
+ "vf = 0.001043 # specific volume of liquid in m**3/kg\n",
+ "Wrev = vf*(P1-P2)*1e5 # Work done\n",
+ "\n",
+ "print \"\\n Example 12.1\"\n",
+ "print \"\\n The work required in saturated liquid form is \",Wrev/1000 ,\" kJ/kg\"\n",
+ "#The answers vary due to round off error\n",
+ "\n",
+ "# Part (b)\n",
+ "h1 = 2675.5 # Enthalpy at state 1 in kJ/kg\n",
+ "s1 = 7.3594 # Entropy at state 1 kJ/kgK\n",
+ "s2 = s1 # Isentropic process\n",
+ "h2 = 3195.5 # Enthalpy at state 2 kJ/kg\n",
+ "Wrev1 = h1-h2 # Work done\n",
+ "print \"\\n The work required in saturated vapor form is \",Wrev1 ,\" kJ/kg\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex12.2:pg-493"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 12.2\n",
+ "\n",
+ " Net work per kg of steam is 969.599095338 kJ/kg\n",
+ "\n",
+ " Cycle efficiency is 32.4996706636 percent\n",
+ "\n",
+ "\n",
+ " Percentage reduction in net work per kg of steam is 20.093190186 percent\n",
+ "\n",
+ " Percentage reduction in cycle efficiency is 20.093190186 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "h1 = 3159.3 # Enthalpy at state 1 in kJ/kg\n",
+ "s1 = 6.9917 # Entropy at state 1 in kJ/kgK\n",
+ "h3 = 173.88 # Enthalpy at state 3 in kJ/kg\n",
+ "s3 = 0.5926 # Entropy at state 3 in kJ/kgK\n",
+ "sfp2 = s3 # Isentropic process\n",
+ "hfp2 = h3 # Isenthalpic process\n",
+ "hfgp2 = 2403.1 # Latent heat of vaporization in kJ/kg\n",
+ "sgp2 = 8.2287 # Entropy of gas in kJ/kgK\n",
+ "vfp2 = 0.001008 # Specific volume in m**3/kg\n",
+ "sfgp2 = 7.6361# Entropy of liquid in kJ/kgK\n",
+ "x2s = (s1-sfp2)/(sfgp2)# Steam quality\n",
+ "h2s = hfp2+(x2s*hfgp2) # Enthalpy at state 2s\n",
+ "# Part (a)\n",
+ "P1 = 20 # Turbine inlet pressure in bar\n",
+ "P2 = 0.08 # Turbine exit pressure in bar\n",
+ "h4s = vfp2*(P1-P2)*1e2+h3 # Enthalpy at state 4s\n",
+ "Wp = h4s-h3 # Pump work\n",
+ "Wt = h1-h2s # Turbine work\n",
+ "Wnet = Wt-Wp # Net work \n",
+ "Q1 = h1-h4s # Heat addition\n",
+ "n_cycle = Wnet/Q1# Cycle efficiency\n",
+ "print \"\\n Example 12.2\"\n",
+ "print \"\\n Net work per kg of steam is \",Wnet ,\" kJ/kg\"\n",
+ "#The answer provided in the textbook is wrong\n",
+ "\n",
+ "print \"\\n Cycle efficiency is \",n_cycle*100 ,\" percent\"\n",
+ "\n",
+ "# Part (b)\n",
+ "n_p = 0.8 # pump efficiency\n",
+ "n_t = 0.8# Turbine efficiency\n",
+ "Wp_ = Wp/n_p # Pump work\n",
+ "Wt_ = Wt*n_t # Turbine work\n",
+ "Wnet_ = Wt_-Wp_# Net work\n",
+ "P = 100*((Wnet-Wnet_)/Wnet) # Percentage reduction in net work\n",
+ "n_cycle_ = Wnet_/Q1 # cycle efficiency\n",
+ "P_ = 100*((n_cycle-n_cycle_)/n_cycle) #reduction in cycle\n",
+ "print \"\\n\\n Percentage reduction in net work per kg of steam is \",P ,\" percent\"\n",
+ "print \"\\n Percentage reduction in cycle efficiency is \",P_ ,\" percent\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex12.3:pg-495"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 12.3\n",
+ "\n",
+ " The greatest allowable steam pressure at the turbine inlet is 16.832 bar\n",
+ "\n",
+ " Rankine cycle efficiency is 31.684100869 percent\n",
+ "\n",
+ " Mean temperature of heat addition is 187.657819629 degree celcius\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "P1 = 0.08 # Exhaust pressure in bar\n",
+ "sf = 0.5926 # Entropy of fluid in kJ/kgK\n",
+ "x2s = 0.85 # Steam quality\n",
+ "sg = 8.2287 # Entropy of gas in kJ/kgK\n",
+ "s2s = sf+(x2s*(sg-sf)) # Entropy of mixture at state 2s in kJ/kgK\n",
+ "s1 = s2s # Isentropic process\n",
+ "P2 = 16.832 # by steam table opposite to s1 in bar\n",
+ "h1 = 3165.54 # Enthalpy at state 1 in kJ/kg\n",
+ "h2s = 173.88 + (0.85*2403.1) # Enthalpy at state 2s in kJ/kg\n",
+ "h3 = 173.88# Enthalpy at state 3 in kJ/kg\n",
+ "vfp2 = 0.001 # specific volume of liquid in m**3/kg\n",
+ "h4s = h3 + (vfp2*(P2-P1)*100)# Enthalpy at state 4s in kJ/kg\n",
+ "Q1 = h1-h4s # Heat addition\n",
+ "Wt = h1-h2s # Turbine work\n",
+ "Wp = h4s-h3 # Pump work\n",
+ "n_cycle = 100*((Wt-Wp)/Q1) # Cycle efficiency\n",
+ "Tm = (h1-h4s)/(s2s-sf) # Mean temperature of heat addition\n",
+ "\n",
+ "print \"\\n Example 12.3\"\n",
+ "print \"\\n The greatest allowable steam pressure at the turbine inlet is \",P2 ,\" bar\"\n",
+ "\n",
+ "print \"\\n Rankine cycle efficiency is \",n_cycle ,\" percent\"\n",
+ "\n",
+ "print \"\\n Mean temperature of heat addition is \",Tm-273 ,\" degree celcius\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex12.4:pg-496"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 12.4 \n",
+ "\n",
+ "\n",
+ " Quality at turbine exhaust is 0.88\n",
+ "\n",
+ " Cycle efficiency is 43.9043470625 percent\n",
+ "\n",
+ " Steam rate is 2.18181818182 kg/kW h\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "h1 = 3465 # Enthalpy at state 1 in kJ/kgK\n",
+ "h2s = 3065 #Enthalpy at state 2s in kJ/kgK \n",
+ "h3 = 3565 #Enthalpy at state 3 in kJ/kgK\n",
+ "h4s = 2300 # Enthalpy at state 4s in kJ/kgK\n",
+ "x4s = 0.88 # Steam quality at state 4s\n",
+ "h5 = 191.83# Enthalpy at state 5 in kJ/kgK\n",
+ "v = 0.001 # specific volume in m**3/kg\n",
+ "P = 150 # Boiler outlet pressure in bar\n",
+ "Wp = v*P*100 # Pump work\n",
+ "h6s = 206.83 # Enthalpy at state 6s in kJ/kgK\n",
+ "Q1 = (h1-h6s)+(h3-h2s) # Heat addition\n",
+ "Wt = (h1-h2s)+(h3-h4s) # Turbine work\n",
+ "Wnet = Wt-Wp # Net work\n",
+ "n_cycle = 100*Wnet/Q1 # cycle efficiency\n",
+ "sr = 3600/Wnet #Steam rate\n",
+ "\n",
+ "print \"\\n Example 12.4 \\n\"\n",
+ "print \"\\n Quality at turbine exhaust is \",0.88\n",
+ "print \"\\n Cycle efficiency is \",n_cycle ,\" percent\"\n",
+ "print \"\\n Steam rate is \",sr ,\" kg/kW h\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex12.5:pg-497"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 12.5\n",
+ "\n",
+ "\n",
+ " Efficiency of the cycle is 36.0687573387 percent\n",
+ "\n",
+ " Steam rate of the cycle is 3.85264705574 kg/kW h\n",
+ "\n",
+ " Increase in temperature due to regeneration is 27.3862065182 degree centigrade\n",
+ "\n",
+ " Increase in steam rate due to regeneration is 0.385518227773 kg/kW h\n",
+ "\n",
+ " Increase in Efficiency of the cycle due to regeneration is 1.90293971596 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "h1 = 3230.9 # Enthalpy at state 1 in kJ/kg\n",
+ "s1 = 6.9212 # Entropy at state 1 in kJ/kgK\n",
+ "s2 = s1 # Isentropic process\n",
+ "s3 = s1 # Isentropic process\n",
+ "h2 = 2796 # Enthalpy at state 2 in kJ/kg\n",
+ "sf = 0.6493 # ENtropy of fluid onkJ/kgK\n",
+ "sfg = 7.5009 # Entropy change due to vaporization\n",
+ "x3 = (s3-sf)/sfg # steam quality\n",
+ "h3 = 191.83 + x3*2392.8 # Enthalpy at state 3\n",
+ "h4 = 191.83 # Enthalpy at state 4 in kJ/kg\n",
+ "h5 = h4 # Isenthalpic process\n",
+ "h6 = 640.23 # Enthalpy at state 6 in kJ/kg\n",
+ "h7 = h6 # Isenthalpic process\n",
+ "m = (h6-h5)/(h2-h5) # regenerative mass\n",
+ "Wt = (h1-h2)+(1-m)*(h2-h3) # turbine work\n",
+ "Q1 = h1-h6 # Heat addition\n",
+ "n_cycle = 100*Wt/Q1 # Cycle efficiency\n",
+ "sr = 3600/Wt # Steam rate\n",
+ "s7 = 1.8607 # Entropy at state 7 in kJ/kgK\n",
+ "s4 = 0.6493 # Entropy at state 4 in kJ/kgK \n",
+ "Tm = (h1-h7)/(s1-s7) # Mean temperature of heat addition with regeneration\n",
+ "Tm1 = (h1-h4)/(s1-s4) # Mean temperature of heat addition without regeneration\n",
+ "dT = Tm-Tm1 # Change in temperature\n",
+ "Wt_ = h1-h3 # Turbine work\n",
+ "sr_ = 3600/Wt_ # Steam rate\n",
+ "dsr = sr-sr_# Change in steam rate\n",
+ "n_cycle_ = 100*(h1-h3)/(h1-h4) # Cycle effciency\n",
+ "dn = n_cycle-n_cycle_# Change in efficiency\n",
+ "print \"\\n Example 12.5\\n\"\n",
+ "print \"\\n Efficiency of the cycle is \",n_cycle ,\" percent\"\n",
+ "\n",
+ "print \"\\n Steam rate of the cycle is \",sr ,\" kg/kW h\"\n",
+ "#The answer provided in the textbook is wrong\n",
+ "\n",
+ "print \"\\n Increase in temperature due to regeneration is \",dT ,\" degree centigrade\"\n",
+ "print \"\\n Increase in steam rate due to regeneration is \",dsr ,\" kg/kW h\"\n",
+ "#The answer provided in the textbook is wrong\n",
+ "\n",
+ "print \"\\n Increase in Efficiency of the cycle due to regeneration is \",dn ,\" percent\"\n",
+ "\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex12.6:pg-499"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 12.6\n",
+ "\n",
+ "\n",
+ " Steam quality at turbine exhaust is 0.90269510582\n",
+ "\n",
+ " Net work per kg of stem is 798.641701509 kJ/kg\n",
+ "\n",
+ " Cycle efficiency is 33.3978046046 percent\n",
+ "\n",
+ " Stream rate is 4.50765342356 kg/kW h\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "h1 = 3023.5 # Enthalpy of steam at state 1 in kJ/kg\n",
+ "s1 = 6.7664 # Enthalpy of steam at state 1 in kJ/kgK\n",
+ "s2 = s1 # Isentropic process\n",
+ "s3 = s1 #Isentropic process\n",
+ "s4 = s1 #Isentropic process\n",
+ "t_sat_20 = 212 # Saturation temperature at 20 bar in degree Celsius\n",
+ "t_sat_1 = 46 # Saturation temperature at 1 bar in degree Celsius\n",
+ "dt = t_sat_20-t_sat_1 # Change in temperature\n",
+ "n =3 # number of heaters\n",
+ "t = dt/n # temperature rise per heater\n",
+ "t1 = t_sat_20-t # Operational temperature of first heater\n",
+ "t2 = t1-t# Operational temperature of second heater\n",
+ "# 0.1 bar\n",
+ "hf = 191.83 # Enthalpy of fluid in kJ/kg\n",
+ "hfg = 2392.8 # Latent heat of vaporization in kJ/kg\n",
+ "sf = 0.6493# Entropy of fluid in kJ/kgK\n",
+ "sg = 8.1502# Entropy of gas in kJ/kgK\n",
+ "# At 100 degree\n",
+ "hf100 = 419.04 # Enthalpy of fluid in kJ/kg \n",
+ "hfg100 = 2257.0# Latent heat of vaporization in kJ/kg \n",
+ "sf100 = 1.3069 # Entropy of fluid in kJ/kgK \n",
+ "sg100 = 7.3549 # Entropy of gas in kJ/kgK\n",
+ "# At 150 degree\n",
+ "hf150 = 632.20 # Enthalpy of fluid in kJ/kg \n",
+ "hfg150 = 2114.3# Latent heat of vaporization in kJ/kg \n",
+ "sf150 = 1.8418 # Entropy of fluid in kJ/kgK \n",
+ "sg150 = 6.8379# Entropy of gas in kJ/kgK\n",
+ "x2 = (s1-sf150)/4.9961 # Steam quality\n",
+ "h2 = hf150+(x2*hfg150) # Enthalpy at state 2 in kJ/kg\n",
+ "x3 = (s1-sf100)/6.0480 # Steam quality\n",
+ "h3 = hf100+(x3*hfg100) # Enthalpy at state 3 in kJ/kg \n",
+ "x4 = (s1-sf)/7.5010 # Steam quality\n",
+ "h4 = hf+(x4*hfg)#Enthalpy at state 4 in kJ/kg\n",
+ "h5 = hf # Enthalpy at state 5 in kJ/kg\n",
+ "h6 = h5 #Enthalpy at state 6 in kJ/kg\n",
+ "h7 = hf100 # Enthalpy at state 7 in kJ/kg\n",
+ "h8 = h7 # Enthalpy at state 8 in kJ/kg\n",
+ "h9 = 632.2 # Enthalpy at state 9 in kJ/kg\n",
+ "h10 = h9 # Enthalpy at state 10 in kJ/kg\n",
+ "m1 = (h9-h7)/(h2-h7) # regenerative mass \n",
+ "m2 = ((1-m1)*(h7-h6))/(h3-h6) # regenerative mass\n",
+ "Wt = 1*(h1-h2)+(1-m1)*(h2-h3)+(1-m1-m2)*(h3-h4) # Turbine work\n",
+ "Q1 = h1-h9 # Heat addition\n",
+ "Wp = 0 # Pump work is neglected\n",
+ "n_cycle = 100*(Wt-Wp)/Q1 # Cycle efficiency\n",
+ "sr = 3600/(Wt-Wp) # Steam rate\n",
+ "\n",
+ "print \"\\n Example 12.6\\n\"\n",
+ "print \"\\n Steam quality at turbine exhaust is \",x3\n",
+ "print \"\\n Net work per kg of stem is \",Wt ,\" kJ/kg\"\n",
+ "print \"\\n Cycle efficiency is \",n_cycle ,\" percent\"\n",
+ "print \"\\n Stream rate is \",sr ,\" kg/kW h\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex12.7:pg-501"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 12.7\n",
+ "\n",
+ "\n",
+ " The second law efficiency is 47.3045857486 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "Ti = 2000.0 # Hot gas inlet temperature in K\n",
+ "Te = 450.0 # Hot gas exhaust temperature in K\n",
+ "T0 = 300.0 # Ambient temperature in K\n",
+ "Q1_dot = 100.0 # Heating rate provided by steam in kW\n",
+ "cpg = 1.1 # Heat capacity of gas in kJ/kg\n",
+ "wg = Q1_dot/(cpg*(Ti-Te)) # mass flow rate of hot gas\n",
+ "af1 = wg*cpg*T0*((Ti/T0)-1-math.log(Ti/T0)) # Availability at inlet\n",
+ "af2 = wg*cpg*T0*((Te/T0)-1-math.log(Te/T0)) # Availability at exit\n",
+ "afi = af1-af2 # Change in availability\n",
+ "h1 = 2801.0 # Enthalpy at state 1 in kJ/kg\n",
+ "h3 = 169.0 #Enthalpy at state 3 in kJ/kg\n",
+ "h4 = 172.8 #Enthalpy at state 4 in kJ/kg\n",
+ "h2 = 1890.2 # Enthalpy at state 2 in kJ/kg\n",
+ "s1 = 6.068 # Entropy at state 1 in kJ/kgK\n",
+ "s2 = s1 # Isentropic process\n",
+ "s3 = 0.576 # Entropy at state 3 in kJ/kgK\n",
+ "s4 = s3 # Isentropic process\n",
+ "Wt = h1-h2 # Turbine work\n",
+ "Wp = h4-h3 # Pump work\n",
+ "Q1 = h1-h4 # Heat addition\n",
+ "Q2 = h2-h3# Heat rejection\n",
+ "Wnet = Wt-Wp # Net work\n",
+ "ws = Q1_dot/2628 # steam mass flow rate\n",
+ "afu = 38*(h1-h4-T0*(s1-s3)) # availability loss\n",
+ "I_dot = afi-afu # Rate of exergy destruction\n",
+ "Wnet_dot = ws*Wnet# Mechanical power rate\n",
+ "afc = ws*(h2-h3-T0*(s2-s3)) # Exergy flow rate of of wet steam\n",
+ "n2 = 100*Wnet_dot/af1 # second law efficiency\n",
+ "\n",
+ "print \"\\n Example 12.7\\n\"\n",
+ "print \"\\n The second law efficiency is \",n2 ,\" percent\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex12.8:pg-503"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 12.8\n",
+ "\n",
+ "\n",
+ " Part (a)\n",
+ "\n",
+ " The first law efficiency n1 is 36.4738076622\n",
+ "\n",
+ " The second law efficiency n2 is 42.9755948516\n",
+ "\n",
+ " The work ratio is 0.991498405951\n",
+ "\n",
+ " Part (b)\n",
+ "\n",
+ " The first law efficiency n1 is 39.3996247655\n",
+ "\n",
+ " The second law efficiency n2 is 66.4411884747\n",
+ "\n",
+ " The work ration is 0.993690851735\n",
+ "\n",
+ " Part (c)\n",
+ "\n",
+ " The first law efficiency n1 is 40.5460576678\n",
+ "\n",
+ " The second law efficiency n2 is 68.3744648698\n",
+ "\n",
+ " The work ration is 0.994990607389\n",
+ "\n",
+ " Part (d)\n",
+ "\n",
+ " The first law efficiency n1 is 43.8732394366\n",
+ "\n",
+ " The second law efficiency n2 is 32.4128919233\n",
+ "\n",
+ " The work ration is 0.991498405951\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Part (a)\n",
+ "h1 = 2758.0 # Enthalpy at state 1 in kJ/kg\n",
+ "h2 = 1817.0 # Enthalpy at state 2 in kJ/kg\n",
+ "h3 = 192.0 # Enthalpy at state 3 in kJ/kg\n",
+ "h4 = 200.0# Enthalpy at state 4 in kJ/kg\n",
+ "Wt = h1-h2 # turbine work\n",
+ "Wp = h4-h3 # Pump work\n",
+ "Q1 = h1-h4 # Heat addition\n",
+ "Wnet = Wt-Wp # Net work doen\n",
+ "n1 = Wnet/Q1 # First law efficiency\n",
+ "WR = Wnet/Wt # Work ratio\n",
+ "Q1_ = 100.0 # Heat addition rate in MW\n",
+ "PO = n1*Q1_ # power output\n",
+ "cpg = 1000 # Specific heat capacity in J/kg\n",
+ "wg = (Q1_/(833-450)) # mass flow rate of gas\n",
+ "EIR = wg*cpg*((833-300)-300*(math.log(833/300)))/1000 # Exergy input\n",
+ "n2 = PO/EIR # Second law efficiency\n",
+ "\n",
+ "print \"\\n Example 12.8\\n\"\n",
+ "print \"\\n Part (a)\"\n",
+ "print \"\\n The first law efficiency n1 is \",n1*100\n",
+ "print \"\\n The second law efficiency n2 is \",n2*100\n",
+ "print \"\\n The work ratio is \",WR\n",
+ "# Part (b)\n",
+ "h1b = 3398.0 # Enthalpy at state 1 in kJ/kg\n",
+ "h2b = 2130.0 # Enthalpy at state 2 in kJ/kg\n",
+ "h3b = 192.0 # Enthalpy at state 3 in kJ/kg\n",
+ "h4b = 200.0# Enthalpy at state 4 in kJ/kg\n",
+ "Wtb = 1268.0 # turbine work in kJ/kg\n",
+ "Wpb = 8.0 # Pump work in kJ/kg\n",
+ "Q1b = 3198.0# Heat addition rate in kW\n",
+ "n1b = (Wtb-Wpb)/Q1b #first law efficiency\n",
+ "WRb = (Wtb-Wpb)/Wtb # WOrk ratio\n",
+ "EIRb = 59.3 # Exergy input rate in MW\n",
+ "Wnetb = Q1_*n1b # net work done\n",
+ "\n",
+ "n2b = Wnetb/EIRb # Second law efficiency\n",
+ "print \"\\n Part (b)\" \n",
+ "print \"\\n The first law efficiency n1 is \",n1b*100\n",
+ "print \"\\n The second law efficiency n2 is \",n2b*100\n",
+ "print \"\\n The work ration is \",WRb\n",
+ "\n",
+ "# Part (c)\n",
+ "h1c = 3398.0 # Enthalpy at state 1 in kJ/kg\n",
+ "h2c = 2761.0 # Enthalpy at state 2 in kJ/kg\n",
+ "h3c = 3482.0# Enthalpy at state 3 in kJ/kg\n",
+ "h4c = 2522.0 # Enthalpy at state 4 in kJ/kg\n",
+ "h5c = 192.0 # Enthalpy at state 5 in kJ/kg\n",
+ "h6c = 200.0# Enthalpy at state 6 in kJ/kg\n",
+ "Wt1 = 637.0 # Turbine work in kJ/kg\n",
+ "Wt2 = 960.0 # Turbine work in kJ/kg\n",
+ "Wtc = Wt1+Wt2 # Net turbine work in kJ/kg\n",
+ "Wp = 8.0 # Pump work in kJ/kg \n",
+ "Wnetc = Wtc-Wp # net work done \n",
+ "Q1c = 3198+721 # Heat addition\n",
+ "n1c = Wnetc/Q1c# First law efficiency\n",
+ "WRc = Wnetc/Wtc# Work ratio\n",
+ "POc = Q1_*n1c# Power output\n",
+ "EIRc = 59.3# Exergy input in MW\n",
+ "n2c = POc/EIRc # Second law efficiency\n",
+ "print \"\\n Part (c)\"\n",
+ "print \"\\n The first law efficiency n1 is \",n1c*100\n",
+ "print \"\\n The second law efficiency n2 is \",n2c*100\n",
+ "print \"\\n The work ration is \",WRc\n",
+ "\n",
+ "# Part (d)\n",
+ "T3 = 45.8 # saturation temperature at 0.1 bar in degree celsius \n",
+ "T1 = 295.0 # saturation temperature at 80 bar in degree celsius \n",
+ "n1d = 1.0-((T3+273)/(T1+273)) # First law efficiency\n",
+ "Q1d = 2758-1316 # Heat addition\n",
+ "Wnet = Q1d*n1d # Net work output\n",
+ "Wpd = 8.0 # Pump work in kJ/kg\n",
+ "Wtd = 641.0# Turbine work in kJ/kg\n",
+ "WRd = (Wt-Wp)/Wt # Work ratio\n",
+ "POd = Q1_*0.439# Power output\n",
+ "EIRd = (Q1_/(833-593))*cpg*((833-300)-300*(math.log(833/300)))/1000 #Exergy Input rate in MW\n",
+ "n2d = POd/EIRd # Second law efficiency\n",
+ "print \"\\n Part (d)\"\n",
+ "print \"\\n The first law efficiency n1 is \",n1d*100\n",
+ "print \"\\n The second law efficiency n2 is \",n2d*100\n",
+ "print \"\\n The work ration is \",WRd\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex12.9:pg-505"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 12.9\n",
+ "\n",
+ "\n",
+ " Temperature of the steam is 360.0 degree celcius\n",
+ "\n",
+ " Pressure of the steam is 22.5 bar\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "hfg = 2202.6 # Latent heat of fusion in kJ/kg\n",
+ "Qh = 5.83 # Heat addition in MJ/s\n",
+ "ws = Qh/hfg # steam flow rate\n",
+ "eg = 0.9 # efficiency of generator\n",
+ "P = 1000.0 # Power generation rate in kW\n",
+ "Wnet = 1000.0/eg # Net output\n",
+ "nbrake = 0.8 # brake thermal efficiency\n",
+ "h1_2s = Wnet/(ws*nbrake) # Ideal heat addition\n",
+ "n_internal = 0.85 # internal efficiency\n",
+ "h12 = n_internal*h1_2s # Actual heat addition\n",
+ "hg = 2706.3 # Enthalpy of gas in kJ/kg\n",
+ "h2 = hg #Isenthalpic process \n",
+ "h1 = h12+h2 # Total enthalpy \n",
+ "h2s = h1-h1_2s # Enthalpy change\n",
+ "hf = 503.71 # Enthalpy of fluid in kJ/kg \n",
+ "x2s = (h2s-hf)/hfg # Quality of steam\n",
+ "sf = 1.5276 # entropy of fluid in kJ/kgK\n",
+ "sfg = 5.6020 # Entropy change due to vaporization in kJ/kgK\n",
+ "s2s = sf+(x2s*sfg) # Entropy at state 2s\n",
+ "s1 = s2s # Isentropic process\n",
+ "P1 = 22.5 # Turbine inlet pressure in bar from Mollier chart\n",
+ "t1 = 360.0 # Temperature of the steam in degree Celsius from Mollier chart\n",
+ "\n",
+ "print \"\\n Example 12.9\\n\"\n",
+ "print \"\\n Temperature of the steam is \",t1 ,\" degree celcius\"\n",
+ "print \"\\n Pressure of the steam is \",P1 ,\" bar\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex12.10:pg-506"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 12.10\n",
+ "\n",
+ "\n",
+ " Fuel burning rate is 18.1592477786 tonnes/day\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "h1 = 3037.3 # Enthalpy at state 1 in kJ/kg\n",
+ "x = 0.96 # Steam quality\n",
+ "h2 = 561+(x*2163.8) # Enthalpy at state 2 \n",
+ "s2 = 1.6718+(x*5.3201)# Entropy at state 2 \n",
+ "s3s = s2 # Isentropic process\n",
+ "x3s = (s3s-0.6493)/7.5009 # Quality at state 3s \n",
+ "h3s = 191.83+(x3s*2392.8) # Enthalpy at state 3s \n",
+ "h23 = 0.8*(h2-h3s) # Enthalpy change in process 23\n",
+ "h3 = h2-h23 # Enthalpy at state 3\n",
+ "h5 = 561.47 # Enthalpy at state 5\n",
+ "h4 = 191.83# Enthalpy at state 4\n",
+ "Qh = 3500 # Heat addition in kJ/s\n",
+ "w = Qh/(h2-h5) # mass flow rate\n",
+ "Wt = 1500 # Turbine work\n",
+ "ws = (Wt+w*(h2-h3))/(h1-h3) # Steam flow rate \n",
+ "ws_ = 3600*ws # Steam flow rate in kg/h\n",
+ "h6 = ((ws-w)*h4+w*h5)/ws #Enthalpy at state 6\n",
+ "h7 = h6# Enthalpy at state 7\n",
+ "n_boiler = 0.85 # Boiler efficiency\n",
+ "CV = 44000 # Calorific value of fuel in kJ/kg\n",
+ "wf = (1.1*ws_*(h1-h7))/(n_boiler*CV) # Fuel consumption rate\n",
+ "\n",
+ "print \"\\n Example 12.10\\n\"\n",
+ "print \"\\n Fuel burning rate is \",wf*24/1000 ,\" tonnes/day\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex12.11:pg-508"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 12.11\n",
+ "\n",
+ "\n",
+ " The minimum pressure at which bleeding is neccessary is 10 bar\n",
+ "\n",
+ " Steam flow at turbine inlet is 0.206237542099 kg/s\n",
+ "\n",
+ " Cycle efficiency is 35.9203808526 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "h1 = 3285.0 # Enthalpy at state 1 in kJ/kg\n",
+ "h2s = 3010.0 # Enthalpy at state 2s in kJ/kg\n",
+ "h3 = 3280.0 # # Enthalpy at state 3 in kJ/kg\n",
+ "h4s = 3030.0 # # Enthalpy at state 4s in kJ/kg\n",
+ "# Saturation pressure at temperature 180 degree centigrade\n",
+ "psat = 10 # In bar\n",
+ "h4 = h3-0.83*(h3-h4s) # # Enthalpy at state 4 \n",
+ "h5s = 2225.0 # # Enthalpy at state 5s in kJ/kg\n",
+ "h5 = h4-0.83*(h4-h5s) # # Enthalpy at state 5\n",
+ "h6 = 162.7 # Enthalpy at state 6 in kJ/kg\n",
+ "h7 = h6 # # Enthalpy at state 7 \n",
+ "h8 = 762.81# Enthalpy at state 8 in kJ/kg\n",
+ "h2 = h1-0.785*(h1-h2s) #Enthalpy at state 2 \n",
+ "m = (h8-h7)/(h4-h7) # regenerative mass flow\n",
+ "n_cycle = ((h1-h2)+(h3-h4)+(1-m)*(h4-h5))/((h1-h8)+(h3-h2)) # Cycle efficiency\n",
+ "\n",
+ "print \"\\n Example 12.11\\n\"\n",
+ "print \"\\n The minimum pressure at which bleeding is neccessary is \",psat ,\" bar\"\n",
+ "print \"\\n Steam flow at turbine inlet is \",m ,\" kg/s\"\n",
+ "print \"\\n Cycle efficiency is \",n_cycle*100 ,\" percent\"\n",
+ "#The answers vary due to round off error\n",
+ "# Part A and Part B are theoretical problems\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex12.12:pg-510"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 12.12 \n",
+ "\n",
+ "\n",
+ " Overall efficiency of the cycle is 52.7981817715 percent\n",
+ "\n",
+ " Flow through the mercury turbine is math.exp kg/h 593428.190307\n",
+ "\n",
+ " Useful work done in binary vapor cycle is 28.3728027889 MW\n",
+ "\n",
+ " Overall efficiency is 46.1693685319 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# From table \n",
+ "h1 = 2792.2 # Enthalpy at state 1 in kJ/kg \n",
+ "h4 = 122.96# Enthalpy at state 4 in kJ/kg \n",
+ "hb = 254.88 # Enthalpy at state b in kJ/kg \n",
+ "hc = 29.98# Enthalpy at state c in kJ/kg \n",
+ "ha = 355.98 # Enthalpy at state a in kJ/kg \n",
+ "hd = hc # Isenthalpic process\n",
+ "h2 = 1949.27 # # Enthalpy at state 2 in kJ/kg \n",
+ "#\n",
+ "m = (h1-h4)/(hb-hc) # Amount of mercury circulating\n",
+ "Q1t = m*(ha-hd) # Heat addition\n",
+ "W1t = m*(ha-hb) + (h1-h2) # Turbine work\n",
+ "n = W1t/Q1t # first law efficiency\n",
+ "\n",
+ "print \"\\n Example 12.12 \\n\"\n",
+ "print \"\\n Overall efficiency of the cycle is \",n*100 ,\" percent\"\n",
+ "#The answers vary due to round off error\n",
+ "\n",
+ "S = 50000 # Stem flow rate through turbine in kg/h\n",
+ "wm = S*m # mercury flow rate\n",
+ "print \"\\n Flow through the mercury turbine is math.exp kg/h\",wm\n",
+ "\n",
+ "Wt = W1t*S/3600 # Turbine work\n",
+ "print \"\\n Useful work done in binary vapor cycle is \",Wt/1e3 ,\" MW\"\n",
+ "nm = 0.85 # Internal efficiency of mercury turbine\n",
+ "ns = 0.87 # Internal efficiency of steam turbine\n",
+ "WTm = nm*(ha-hb) # turbine work of mercury based cycle\n",
+ "hb_ = ha-WTm # Enthalpy at state b in kJ/kg\n",
+ "m_ = (h1-h4)/(hb_-hc) # mass flow rate of mercury\n",
+ "h1_ = 3037.3 # Enthalpy at state 1 in kJ/kg\n",
+ "Q1t = m_*(ha-hd)+(h1_-h1) # Heat addition\n",
+ "x2_ = (6.9160-0.4226)/(8.47-0.4226) # steam quality\n",
+ "h2_ = 121+(0.806*2432.9) # Enthalpy at state 2 in kJ/kg \n",
+ "WTst = ns*(h1_-h2_) # Turbine work\n",
+ "WTt = m_*(ha-hb_)+WTst # Total turbine work\n",
+ "N = WTt/Q1t #Overall efficiency \n",
+ "print \"\\n Overall efficiency is \",N*100 ,\" percent\"\n",
+ "# The answers vary due to round off error\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter13_ZusP0LZ.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter13_ZusP0LZ.ipynb
new file mode 100644
index 00000000..7d2de00a
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter13_ZusP0LZ.ipynb
@@ -0,0 +1,641 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 13: Gas power cycle"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex13.1:pg-554"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 13.1\n",
+ "\n",
+ "\n",
+ " Cycle efficiency is 56.4724718352 percent\n",
+ "\n",
+ " Maximum temperature in the cycle is 3632.38927303 K\n",
+ "\n",
+ " Maximum pressure in the cycle is 9.43477733254 MPa\n",
+ "\n",
+ " Mean effective pressure is 1.53325865881 MPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T1 = 35 # Air inlet temperature in degree Celsius\n",
+ "P1 = 0.1 # Air inlet pressure in MPa\n",
+ "Q1 = 2100 # Heat supply in kJ/kg\n",
+ "R = 0.287 # gas constant\n",
+ "rk = 8 # Compression ratio\n",
+ "g = 1.4 # Heat capacity ratio\n",
+ "n_cycle = 1-(1/rk**(g-1)) # cycle efficiency \n",
+ "v1 = (R*(T1+273))/(P1*1e3) # Initial volume\n",
+ "v2 = v1/8 # Volume after compression\n",
+ "T2 = (T1+273)*(v1/v2)**(g-1) # Temperature after compression\n",
+ "cv = 0.718 # Constant volume heat capacity in kJ/kg\n",
+ "T3 = Q1/cv + T2 # Temperature at after heat addition\n",
+ "P21 = (v1/v2)**g # Pressure ratio\n",
+ "P2 = P21*P1 # Pressure after compression\n",
+ "P3 = P2*(T3/T2) # Pressure after heat addition\n",
+ "Wnet = Q1*n_cycle # Net work output\n",
+ "Pm = Wnet/(v1-v2) # Mean pressure\n",
+ "print \"\\n Example 13.1\\n\"\n",
+ "print \"\\n Cycle efficiency is \",n_cycle*100 ,\" percent\"\n",
+ "print \"\\n Maximum temperature in the cycle is \",T3 ,\" K\"\n",
+ "print \"\\n Maximum pressure in the cycle is \",P3 ,\" MPa\"\n",
+ "print \"\\n Mean effective pressure is \",Pm/1e3 ,\" MPa\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex13.2:pg-555"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 13.2\n",
+ "\n",
+ "\n",
+ " Air standard efficiency is 59.8676909231 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "rk = 14.0 # Compression ratio\n",
+ "k = 6.0 # cutoff percentage ratio\n",
+ "rc = k/100*(rk-1)+1\n",
+ "g = 1.4 # Heat capacity ratio\n",
+ "n_diesel = 1.0-((1.0/g))*(1.0/rk**(g-1))*((rc**(g-1))/(rc-1)) # Cycle efficiency\n",
+ "print \"\\n Example 13.2\\n\"\n",
+ "print \"\\n Air standard efficiency is \",n_diesel*100 ,\" percent\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex13.3:pg-556"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 13.3\n",
+ "\n",
+ "\n",
+ " Cut-off ratio is 2.00789702047\n",
+ "\n",
+ " Heat supplied per kg of air is 884.346993978 kJ/kg\n",
+ "\n",
+ " Cycle efficiency is 61.3340410825 percent\n",
+ "\n",
+ " Mean effective pressure is 699.968703831 kPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "rk = 16 # Compression ratio\n",
+ "T1 = 15 # Air inlet temperature in degree Celsius\n",
+ "P1 = 0.1 # Air inlet pressure in MPa\n",
+ "T3 = 1480 # Highest temperature in cycle in degree Celsius\n",
+ "g = 1.4 # Heat capacity ratio\n",
+ "R = 0.287 # Gas constant\n",
+ "T2 = (T1+273)*(rk**(g-1)) # Temperature after compression\n",
+ "rc = (T3+273)/T2 # cut off ratio\n",
+ "cp = 1.005 # Constant pressure heat constant\n",
+ "cv = 0.718 # Constant volume heat constant\n",
+ "Q1 = cp*(T3+273-T2) # Heat addition\n",
+ "T4 = (T3+273)*((rc/rk)**(g-1)) # Temperature after heat addition\n",
+ "Q2 = cv*(T4-T1-273) # Heat rejection\n",
+ "n = 1-(Q2/Q1) # cycle efficiency\n",
+ "n_ = 1-((1/g))*(1/rk**(g-1))*((rc**(g-1))/(rc-1)) # cycle efficiency from another formula\n",
+ "Wnet = Q1*n # Net work \n",
+ "v1 = (R*(T1+273))/(P1*1e3) # Volume before compression\n",
+ "v2 = v1/rk # Volume after compression\n",
+ "Pm = Wnet/(v1-v2) # Mean pressure\n",
+ "print \"\\n Example 13.3\\n\"\n",
+ "print \"\\n Cut-off ratio is \",rc\n",
+ "print \"\\n Heat supplied per kg of air is \",Q1 ,\" kJ/kg\"\n",
+ "print \"\\n Cycle efficiency is \",n*100 ,\" percent\"\n",
+ "print \"\\n Mean effective pressure is \",Pm ,\" kPa\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex13.4:pg-558"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 13.4\n",
+ "\n",
+ "\n",
+ " Efficiency of the cycle is 66.3143793932 percent\n",
+ "\n",
+ " Mean effective pressure is 4.45799460092 bar\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T1 = 50.0 # Temperature before compression stroke in degree Celsius\n",
+ "rk = 16.0 # Compression ratio\n",
+ "g = 1.4 # Heat capacity ratio\n",
+ "P3 = 70.0 # Maximum cycle pressure in bar\n",
+ "cv = 0.718 # Constant volume heat addition capacity\n",
+ "cp = 1.005 # Constant pressure heat addition capacity\n",
+ "R = 0.287 # Gas constant\n",
+ "T2 = (T1+273)*((rk**(g-1))) #Temperature after compression stroke \n",
+ "P1 = 1.0 # Pressure before compression in bar\n",
+ "P2 = P1*(rk)**g # Pressure after compression\n",
+ "T3 = T2*(P3/P2) # Temperature after constant volume heat addition\n",
+ "Q23 = cv*(T3-T2) # Constant volume heat added\n",
+ "T4 = (Q23/cp)+T3 # Temperature after constant pressure heat addition\n",
+ "v43 = T4/T3 # cut off ratio \n",
+ "v54 = rk/v43 # Expansion ratio\n",
+ "T5 = T4*(1/v54)**(g-1) # Temperature after expansion\n",
+ "P5 = P1*(T5/(T1+273)) # Pressure after expansion\n",
+ "Q1 = cv*(T3-T2)+cp*(T4-T3) # Total heat added\n",
+ "Q2 = cv*(T5-T1-273) # Heat rejected\n",
+ "n_cycle = 1-(Q2/Q1) # Cycle efficiency\n",
+ "v1 = (R*(T1+273))/(P1*1e2) # Volume before compression \n",
+ "v2 = (1/16)*v1 # Swept volume\n",
+ "Wnet = Q1*n_cycle # Net work done\n",
+ "Pm = Wnet/(v1-v2) # Mean pressure\n",
+ "print \"\\n Example 13.4\\n\"\n",
+ "print \"\\n Efficiency of the cycle is \",n_cycle*100 ,\" percent\"\n",
+ "print \"\\n Mean effective pressure is \",Pm/100 ,\" bar\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex13.5:pg-559"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 13.5\n",
+ "\n",
+ "\n",
+ " The percentage increase in cycle efficiency \n",
+ " due to regeneration is 41.4076056717 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "P1 = 0.1 # Air pressure at turbine inlet in MPa\n",
+ "T1 = 30 # Air temperature at turbine inlet in degree Celsius\n",
+ "T3 = 900 # Maximum cycle temperature at turbine inlet in degree Celsius\n",
+ "rp = 6 # Pressure ratio\n",
+ "nt = 0.8 # Turbine efficiency\n",
+ "nc = 0.8# Compressor efficiency\n",
+ "g = 1.4 # Heat capacity ratio\n",
+ "cv = 0.718 # Constant volume heat capacity\n",
+ "cp = 1.005 # Constant pressure heat capacity\n",
+ "R = 0.287 # Gas constant\n",
+ "T2s = (T1+273)*(rp)**((g-1)/g)\n",
+ "T4s = (T3+273)/((rp)**((g-1)/g))\n",
+ "T21 = (T2s-T1-273)/nc # Temperature raise due to compression\n",
+ "T34 = nt*(T3+273-T4s) # Temperature drop due to expansion\n",
+ "Wt = cp*T34 # Turbine work\n",
+ "Wc = cp*T21 # Compressor work\n",
+ "T2 = T21+T1+273 # Temperature after compression\n",
+ "Q1 = cp*(T3+273-T2) # Heat added\n",
+ "n = (Wt-Wc)/Q1 # First law efficiency\n",
+ "T4 = T3+273-T34 # Temperature after expansion\n",
+ "T6 = 0.75*(T4-T2) + T2 # Regeneration temperature \n",
+ "Q1_ = cp*(T3+273-T6)# Heat added\n",
+ "n_ = (Wt-Wc)/Q1_ #cycle efficiency\n",
+ "I = (n_-n)/n # Fractional increase in cycle efficiency\n",
+ "print \"\\n Example 13.5\\n\"\n",
+ "print \"\\n The percentage increase in cycle efficiency \\n due to regeneration is \",I*100 ,\" percent\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex13.6:pg-560"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 13.6\n",
+ "\n",
+ "\n",
+ " Maximum work done per kg of air is 239.466740619 kJ/kg\n",
+ "\n",
+ " Cycle efficiency is 47.1237354986 percent\n",
+ "\n",
+ " Ratio of Brayton and Carnot efficiency is 0.654123779948\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "cp = 1.005 # Constant pressure heat capacity\n",
+ "Tmax = 1073.0 # Maximum cycle temperature in K\n",
+ "Tmin = 300.0# Minimum cycle temperature in K\n",
+ "Wnet_max = cp*(math.sqrt(Tmax)-math.sqrt(Tmin))**2 # maximum work\n",
+ "n_cycle = 1.0-math.sqrt(Tmin/Tmax) # cycle efficiency\n",
+ "n_carnot = 1.0-(Tmin/Tmax) # Carnot efficiency\n",
+ "r = n_cycle/n_carnot # Efficiency ratio\n",
+ "print \"\\n Example 13.6\\n\"\n",
+ "print \"\\n Maximum work done per kg of air is \",Wnet_max ,\" kJ/kg\"\n",
+ "print \"\\n Cycle efficiency is \",n_cycle*100 ,\" percent\"\n",
+ "print \"\\n Ratio of Brayton and Carnot efficiency is \",r\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex13.7:pg-561"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 13.7\n",
+ "\n",
+ "\n",
+ " The thermal efficiency of the cycle is 40.0663025288 percent\n",
+ "\n",
+ " Work ratio is 0.544951697902\n",
+ "\n",
+ " Power output is 40.0663025288 MW\n",
+ "\n",
+ " Energy flow rate of the exhaust gas stream is 20.5297861501 MW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "rp = 6 # pressure ratio\n",
+ "g = 1.4 # Heat capacity ratio\n",
+ "cv = 0.718 # Constant volume heat capacity\n",
+ "cp = 1.005 #Constant pressure heat capacity\n",
+ "R = 0.287 # Gas constant\n",
+ "T1 = 300 # Minimum temperature in K\n",
+ "T3 = 1100 # Maximum cycle temperature in K\n",
+ "T0 = 300 # Atmospheric temperature in K\n",
+ "n_cycle = 1-(1/rp**((g-1)/g)) # cycle efficiency\n",
+ "T2 = (T1)*(rp**((g-1)/g)) # Temperature after compression\n",
+ "T4 = (T3)/(rp**((g-1)/g)) # Temperature after expansion\n",
+ "Wc = cp*(T2-T1) # Compressor work\n",
+ "Wt = cp*(T3-T4) # Turbine work\n",
+ "WR = (Wt-Wc)/Wt # Work ratio\n",
+ "Q1 = 100 # Heat addition in MW\n",
+ "PO = n_cycle*Q1 # Power output\n",
+ "m_dot = (Q1*1e06)/(cp*(T3-T2)) # Mass flow rate\n",
+ "R = m_dot*cp*T0*((T4/T0)-1-math.log(T4/T0)) # Exergy flow rate\n",
+ "print \"\\n Example 13.7\\n\"\n",
+ "print \"\\n The thermal efficiency of the cycle is \",n_cycle*100 ,\" percent\"\n",
+ "print \"\\n Work ratio is \",WR\n",
+ "print \"\\n Power output is \",PO ,\" MW\"\n",
+ "print \"\\n Energy flow rate of the exhaust gas stream is \",R/1e6 ,\" MW\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex13.8:pg-562"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 13.8\n",
+ "\n",
+ "\n",
+ " Percentage of air that may be taken from the compressor is 11.5044247788 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "nc = 0.87 # Compressor efficiency \n",
+ "nt = 0.9 # Turbine efficiency\n",
+ "T1 = 311 # Compressor inlet temperature in K\n",
+ "rp = 8 # compressor pressure ratio\n",
+ "P1 = 1 # Initial pressure in atm\n",
+ "T3 = 1367 # Turbine inlet temperature\n",
+ "P2 = P1*rp # Final pressure \n",
+ "P3 = 0.95*P2 # Actual pressure after compression\n",
+ "P4 = 1 # Atmospheric pressure\n",
+ "g = 1.4 # Heat capacity ratio\n",
+ "cv = 0.718 # Constant volume heat capacity\n",
+ "cp = 1.005 # Constant pressure heat capacity\n",
+ "R = 0.287 # Gas constant\n",
+ "# With no cooling\n",
+ "T2s = T1*((P2/P1)**((g-1)/g)) # Ideal temperature after compression\n",
+ "T2 = T1 + (T2s-T1)/0.87 # Actual temperature after compression\n",
+ "T4s = T3*(P4/P3)**((g-1)/g) # Ideal temperature after expansion\n",
+ "n = (((T3-T4s)*nt)-((T2s-T1)/nc))/(T3-T2) # cycle efficiency\n",
+ "# With cooling\n",
+ "n_cycle = n-0.05\n",
+ "x = 0.13 # Fluid quality\n",
+ "r = x/(x+1) # \n",
+ "print \"\\n Example 13.8\\n\"\n",
+ "print \"\\n Percentage of air that may be taken from the compressor is \",r*100 ,\" percent\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex13.9:pg-563"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 13.9 \n",
+ "\n",
+ "\n",
+ " Optimum specific output is 1.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#Given that\n",
+ "nc = 0.85 # Compressor efficiency\n",
+ "nt = 0.9 # Turbine efficiency\n",
+ "r = 3.5 # Ratio of max and min temperature \n",
+ "gama = 1.4 # Ratio of heat capacities for air\n",
+ "print \"\\n Example 13.9 \\n\"\n",
+ "x = (gama-1)/gama\n",
+ "r_opt = ((nc*nt*r)**(2/3))**(1/x)\n",
+ "print \"\\n Optimum specific output is \",r_opt\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex13.10:pg-566"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 13.10 \n",
+ "\n",
+ "\n",
+ " The temperature of the gases at the turbine exit is 1114.47439653 K,\n",
+ " The pressure of the gases at the turbine exit is 311.998817219 kN/m**2,\n",
+ " The velocity of gases at the nozzle exit is 1.0 m/sec,\n",
+ " The propulsive efficiency of the cycle is -10.6673736259 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#Given that\n",
+ "v = 300.0 # Aircraft velocity in m/s\n",
+ "p1 = 0.35 # Pressure in bar\n",
+ "t1 = -40.0 # Temperature in degree centigrade\n",
+ "rp = 10.0 # The pressure ratio of compressor \n",
+ "t4 = 1100.0 # Temperature of gases at turbine intlet in degree centigrade\n",
+ "ma = 50.0 # Mass flow rate of air at the inlet of compressor in kg/s\n",
+ "cp = 1.005 # Heat capacity of air at constant pressure in kJ/kg-K\n",
+ "gama=1.4 # Ratio of heat capacities for air\n",
+ "print \"\\n Example 13.10 \\n\"\n",
+ "T1 = t1+273\n",
+ "T4 = t4+273\n",
+ "T2 = T1 + (v**2)/(2*cp)*(10**-3)\n",
+ "p2 = p1*(100)*((T2/T1)**(gama/(gama-1)))\n",
+ "p3 = rp*p2\n",
+ "p4 =p3\n",
+ "T3 = T2*((p3/p2)**((gama-1)/gama))\n",
+ "T5 = T4-T3+T2\n",
+ "p5 = ((T5/T4)**(gama/(gama-1)))*(p4)\n",
+ "p6 = p1*100\n",
+ "T6 = T5*((p6/p5)**((gama-1)/gama))\n",
+ "V6 = (2*cp*(T5-T6)*1000)**(1/2)\n",
+ "Wp = ma*(V6-v)*v*(10**-6)\n",
+ "Q1 = ma*cp*(T4-T3)*(10**-3)\n",
+ "np = Wp/Q1\n",
+ "print \"\\n The temperature of the gases at the turbine exit is \",T5 ,\" K,\\n The pressure of the gases at the turbine exit is \",p5 ,\" kN/m**2,\\n The velocity of gases at the nozzle exit is \",V6 ,\" m/sec,\\n The propulsive efficiency of the cycle is \",np*100 ,\" percent\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex13.11:pg-567"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 13.11 \n",
+ "\n",
+ "\n",
+ " Air fuel ratio is 39.6515678976\n",
+ "\n",
+ " Overall efficiency of combined plant is 53.5993550102 percent \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "Ta = 15 # Atmospheric temperature in degree Celsius \n",
+ "rp = 8 # pressure ratio\n",
+ "g = 1.33 # heat capacity ratio for gas\n",
+ "g1 = 1.40 # heat capacity ratio for air\n",
+ "cv = 0.718 # Constant volume heat capacity\n",
+ "cpa = 1.005 # Constant pressure heat capacity for air\n",
+ "cpg = 1.11 # Constant pressure heat capacity for gas\n",
+ "R = 0.287 # Gas constant\n",
+ "Tb = (Ta+273)*(rp)**((g1-1)/g1) # Temperature after compression\n",
+ "Tc = 800 # Temperature after heat addition in degree Celsius\n",
+ "Td = (Tc+273)/((rp)**((g-1)/g)) # Temperature after expansion\n",
+ "Wgt = cpg*(Tc+273-Td)-cpa*(Tb-Ta-273)\n",
+ "Q1 = cpg*(Tc+273-Tb)\n",
+ "Q1_ = cpg*(Tc+273-Td)\n",
+ "h1 = 3775 # Enthalpy at state 1 in kJ/kg\n",
+ "h2 = 2183 # Enthalpy at state2 in kJ/kg\n",
+ "h3 = 138 # Enthalpy at state3 in kJ/kg\n",
+ "h4 = h3 # Isenthalpic process\n",
+ "Q1_st = h1-h3 # Total heat addition\n",
+ "Q_fe = cpg*(Tc-100) # Heat transfer by steam\n",
+ "was = Q1_st/Q_fe # air steam mass ratio\n",
+ "Wst = h1-h2# work done by steam turbine\n",
+ "PO = 190e03 # Power output in kW\n",
+ "ws = PO/(was*Wgt+Wst)# steam flow rate\n",
+ "wa = was*ws # Air flow rate\n",
+ "CV = 43300 # Calorific volume of fuel in kJ/kg\n",
+ "waf = CV/(Q1+Q1_) # Air fuel ratio\n",
+ "FEI = (wa/waf)*CV # Fuel energy input\n",
+ "noA = PO/FEI # combined cycle efficiency\n",
+ "\n",
+ "print \"\\n Example 13.11 \\n\"\n",
+ "print \"\\n Air fuel ratio is \",waf\n",
+ "print \"\\n Overall efficiency of combined plant is \",noA*100,\" percent \"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter14_HgYvpWb.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter14_HgYvpWb.ipynb
new file mode 100644
index 00000000..eab55652
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter14_HgYvpWb.ipynb
@@ -0,0 +1,735 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 14: Refrigeration cycle"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex14.1:pg-602"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 14.1\n",
+ "\n",
+ "\n",
+ " Power required to drive the plane is 12.9850746269 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T2 = -5.0 # Cold storage temperature in degree Celsius\n",
+ "T1 = 35.0 # Surrounding temperature in degree Celsius\n",
+ "COP = (T2+273)/((T1+273)-(T2+273))\n",
+ "ACOP = COP/3 # Actual COP\n",
+ "Q2 = 29.0 # Heat leakage in kW\n",
+ "W = Q2/ACOP\n",
+ "print \"\\n Example 14.1\\n\"\n",
+ "print \"\\n Power required to drive the plane is \",W ,\" kW\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex14.2:pg-603"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 14.2\n",
+ "\n",
+ "\n",
+ " The rate of heat removal is 8.5572 kW\n",
+ "\n",
+ " Power input to the compressor is 2.1606 kW\n",
+ "\n",
+ " The heat rejection rate in the condenser is 10.7178 kW\n",
+ "\n",
+ " COP is 3.9605665093 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# At P = 0.14 MPa\n",
+ "h1 = 236.04 # Enthalpy at state 1 in kJ/kg\n",
+ "s1 = 0.9322 # Entropy at state 2 in kJ/kgK\n",
+ "s2 = s1 # Isenthalpic process\n",
+ "# At P = 0.8 MPa\n",
+ "h2 = 272.05 # Enthalpy at state 2 in kJ/kg\n",
+ "h3 = 93.42 # Enthalpy at state 3 in kJ/kg\n",
+ "h4 = h3 # Isenthalpic process\n",
+ "m = 0.06 # mass flow rate in kg/s\n",
+ "Q2 = m*(h1-h4) # Heat absorption\n",
+ "Wc = m*(h2-h1) # Compressor work\n",
+ "Q1 = m*(h2-h4) # Heat rejection in evaporator\n",
+ "COP = Q2/Wc # coefficient of performance\n",
+ "\n",
+ "print \"\\n Example 14.2\\n\"\n",
+ "print \"\\n The rate of heat removal is \",Q2 ,\" kW\"\n",
+ "print \"\\n Power input to the compressor is \",Wc ,\" kW\"\n",
+ "print \"\\n The heat rejection rate in the condenser is \",Q1 ,\" kW\"\n",
+ "print \"\\n COP is \",COP ,\" kW\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex14.3:pg-604"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 14.3\n",
+ "\n",
+ "\n",
+ " Refrigerant flow rate is 0.179046449765 kg/s\n",
+ "\n",
+ " Volume flow rate is 0.0137865766319 m**3/s\n",
+ "\n",
+ " Compressor discharge temperature is 48.0 degree Celsius \n",
+ "\n",
+ " Pressure ratio is 4.38417305586\n",
+ "\n",
+ " Heat rejected to the condenser is 24.1390423573 kW\n",
+ "\n",
+ " Flash gas percentage is 30.5290768345 percent\n",
+ "\n",
+ " COP is 4.14187643021 kW\n",
+ "\n",
+ " Power required to drive the compressor is 4.69459791283 kW\n",
+ "\n",
+ " Ratio of COP of cycle with Carnot refrigerator is 0.787428979127\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "h1 = 183.19 # Enthalpy at state 1 in kJ/kg\n",
+ "h2 = 209.41 # Enthalpy at state 2 in kJ/kg\n",
+ "h3 = 74.59 # Enthalpy at state 3 in kJ/kg\n",
+ "h4 = h3 # Isenthalpic process\n",
+ "T1 = 40.0 # Evaporator temperature in degree Celsius \n",
+ "T2 = -10.0 # Condenser temperature in degree Celsius\n",
+ "W = 5.0 # Plant capacity in tonnes of refrigeration\n",
+ "w = (W*14000/3600)/(h1-h4) # Refrigerant flow rate\n",
+ "v1 = 0.077 # Specific volume of vapor in m**3/kg\n",
+ "VFR = w*v1 # volume flow rate\n",
+ "T = 48.0 # Compressor discharge temperature in degree Celsius\n",
+ "P2 = 9.6066 # Pressure after compression\n",
+ "P1 = 2.1912 # Pressure before compression\n",
+ "rp = P2/P1 # Pressure ratio\n",
+ "Q1 = w*(h2-h3) # Heat rejected in condenser\n",
+ "hf = 26.87 # Enthalpy of fluid in kJ/kg\n",
+ "hfg = 156.31# Latent heat of vaporization in kJ/kg\n",
+ "x4 = (h4-hf)/hfg # quality of refrigerant\n",
+ "COP_v = (h1-h4)/(h2-h1) # Actual coefficient of performance of cycle\n",
+ "PI = w*(h2-h1) # Power input\n",
+ "COP = (T2+273)/((T1+273)-(T2+273)) # Ideal coefficient of performance\n",
+ "r = COP_v/COP\n",
+ "print \"\\n Example 14.3\\n\"\n",
+ "print \"\\n Refrigerant flow rate is \",w ,\" kg/s\"\n",
+ "print \"\\n Volume flow rate is \",VFR ,\" m**3/s\"\n",
+ "print \"\\n Compressor discharge temperature is \",T ,\" degree Celsius \"\n",
+ "print \"\\n Pressure ratio is \",rp\n",
+ "print \"\\n Heat rejected to the condenser is \",Q1 ,\" kW\"\n",
+ "print \"\\n Flash gas percentage is \",x4*100 ,\" percent\"\n",
+ "print \"\\n COP is \",COP_v ,\" kW\"\n",
+ "print \"\\n Power required to drive the compressor is \",PI ,\" kW\"\n",
+ "print \"\\n Ratio of COP of cycle with Carnot refrigerator is \",r\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex14.4:pg-605"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 14.4\n",
+ "\n",
+ "\n",
+ " Refrigeration effect is 126 kJ/kg\n",
+ "\n",
+ " Refrigerant flow rate is 0 kg/s\n",
+ "\n",
+ " Diameter of cylinder is 100.0 cm\n",
+ "\n",
+ " Length of cylinder is 110.0 cm\n",
+ "\n",
+ " COP is 4\n",
+ "\n",
+ " Power required to drive the compressor is 0 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "h3 = 882 # Enthalpy at state 3 in kJ/kg\n",
+ "h2 = 1034 # Enthalpy at state 2 in kJ/kg\n",
+ "h6 = 998 # Enthalpy at state 6 in kJ/kg\n",
+ "h1 = 1008 # Enthalpy at state 1 in kJ/kg\n",
+ "v1 = 0.084 # Specific volume at state 1 in m**3/kg\n",
+ "t4 = 25 # Temperature at state 4 in degree Celsius\n",
+ "m = 10 # mass flow rate in kg/s\n",
+ "h4 = h3-h1+h6 \n",
+ "h5 = h4 # isenthalpic process\n",
+ "w = (m*14000)/((h6-h5)*3600) # in kg/s\n",
+ "VFR = w*3600*v1 # Volume flow rate in m**3/h\n",
+ "ve = 0.8 # volumetric efficiency\n",
+ "CD = VFR/(ve*60) # Compressor displacement in m**3/min\n",
+ "N = 900 # Number of strokes per minute\n",
+ "n = 2 # number of cylinder\n",
+ "\n",
+ "D = ((CD*4)/(math.pi*1.1*N*n))**(1/3) # L = 1.1D L = length D = diameter\n",
+ "L = 1.1*D\n",
+ "COP = (h6-h5)/(h2-h1) # coefficient of performance\n",
+ "PI = w*(h2-h1) # Power input\n",
+ "\n",
+ "print \"\\n Example 14.4\\n\"\n",
+ "print \"\\n Refrigeration effect is \",h6-h5 ,\" kJ/kg\"\n",
+ "print \"\\n Refrigerant flow rate is \",w ,\" kg/s\"\n",
+ "print \"\\n Diameter of cylinder is \",D*100 ,\" cm\"\n",
+ "print \"\\n Length of cylinder is \",L*100 ,\" cm\"\n",
+ "print \"\\n COP is \",COP\n",
+ "print \"\\n Power required to drive the compressor is \",PI ,\" kW\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex14.5:pg-607"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 14.5\n",
+ "\n",
+ "\n",
+ " Increase in work of compression for single stage is 15.719846307 percent\n",
+ "\n",
+ " Increase in COP for 2 stage compression is 15.719846307 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "P2 = 1554.3 # Pressure at state 2 in kPa\n",
+ "P1 = 119.5# Pressure at state 1 in kPa\n",
+ "Pi = math.sqrt(P1*P2)\n",
+ "h1 = 1404.6 # Enthalpy at state1 in kJ/kg\n",
+ "h2 = 1574.3 # Enthalpy at state2 in kJ/kg\n",
+ "h3 = 1443.5 # Enthalpy at state3 in kJ/kg\n",
+ "h4 = 1628.1# Enthalpy at state4 in kJ/kg\n",
+ "h5 = 371.7 # Enthalpy at state5 in kJ/kg\n",
+ "h6 = h5 # Isenthalpic process\n",
+ "h7 = 181.5# Enthalpy at state7 in kJ/kg\n",
+ "w = 30 # capacity of plant in tonnes of refrigeration\n",
+ "m2_dot = (3.89*w)/(h1-h7) # mass flow rate in upper cycle\n",
+ "m1_dot = m2_dot*((h2-h7)/(h3-h6))# mass flow rate in lower cycle\n",
+ "Wc_dot = m2_dot*(h2-h1)+m1_dot*(h4-h3) # Compressor work\n",
+ "COP = w*3.89/Wc_dot # Coefficient of performance of cycle\n",
+ "# single stage\n",
+ "h1_ = 1404.6 #Enthalpy at state1 in kJ/kg \n",
+ "h2_ = 1805.1 # Enthalpy at state2 in kJ/kg \n",
+ "h3_ = 371.1 # Enthalpy at state3 in kJ/kg \n",
+ "h4_ = h3_ # Isenthalpic process\n",
+ "m_dot = (3.89*30)/(h1_-h4_) # mass flow rate in cycle\n",
+ "Wc = m_dot*(h2_-h1_) # Compressor work\n",
+ "COP_ = w*3.89/Wc # Coefficient of performance of cycle\n",
+ "IW = (Wc-Wc_dot)/Wc_dot # Increase in compressor work\n",
+ "ICOP = (COP-COP_)/COP_ # Increase in COP for 2 stage compression\n",
+ "print \"\\n Example 14.5\\n\"\n",
+ "print \"\\n Increase in work of compression for single stage is \",IW*100 ,\" percent\"\n",
+ "print \"\\n Increase in COP for 2 stage compression is \",ICOP*100 ,\" percent\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex14.6:pg-608"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 14.6\n",
+ "\n",
+ "\n",
+ " The COP of the plant is 5.93506047745 , \n",
+ " The mass flow rate of refrigerant in the evaporator is 3.38045251321 kg/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "te = -10 # Evaporator temperature in degree celsius\n",
+ "pc = 7.675 # Condenser pressure in bar\n",
+ "pf = 4.139 # Flash chamber pressure in bar\n",
+ "P = 100 # Power input to compressor in kW\n",
+ "print \"\\n Example 14.6\\n\"\n",
+ "# From the property table of R-134a,\n",
+ "h7 = 140.96 # In kJ/kg\n",
+ "hf = 113.29 # In kJ/kg\n",
+ "hfg = 300.5-113.29 # In kJ/kg\n",
+ "hg = 300.5 # In kJ/kg\n",
+ "h1 = 288.86 # In kJ/kg\n",
+ "s1 = 1.17189 # # In kJ/kgK\n",
+ "s2 =s1\n",
+ "#By interpolation \n",
+ "h2 = 303.468 # In kJ/kg\n",
+ "x8 = (h7-hf)/hfg\n",
+ "m1=x8\n",
+ "h5 = (1-m1)*h2 + m1*hg\n",
+ "# By interpolation\n",
+ "s5 = 1.7174 # In kJ/kgK\n",
+ "s6=s5\n",
+ "h6 = 315.79 # In kJ/kg\n",
+ "m = P/((h6-h5) + (1-m1)*(h2-h1))\n",
+ "m_e = (1-m1)*m\n",
+ "COP = m_e*(h1-hf)/P\n",
+ "print \"\\n The COP of the plant is \",COP ,\", \\n The mass flow rate of refrigerant in the evaporator is \",m_e ,\" kg/s\"\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex14.7:pg-609"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 14.7\n",
+ "\n",
+ "\n",
+ " Steam flow rate required is 0.0644023696678 kg/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "tsat = 120.2 # Saturation temperature in degree Celsius\n",
+ "hfg = 2201.9 # Latent heat of fusion in kJ/kg\n",
+ "T1 = 120.2 # Generator temperature in degree Celsius\n",
+ "T2 = 30 # Ambient temperature in degree Celsius\n",
+ "Tr = -10 # Operating temperature of refrigerator in degree Celsius\n",
+ "COP_max = (((T1+273)-(T2+273))*(Tr+273))/(((T2+273)-(Tr+273))*(T1+273)) # Ideal coefficient of performance \n",
+ "ACOP = 0.4*COP_max # Actual COP\n",
+ "L = 20 # Refrigeration load in tonnes\n",
+ "Qe = (L*14000)/3600 # Heat extraction in KW\n",
+ "Qg = Qe/ACOP # Heat transfer from generator \n",
+ "x = 0.9 # Quality of refrigerant\n",
+ "H = x*hfg # Heat extraction\n",
+ "SFR = Qg/H # Steam flow rate\n",
+ "print \"\\n Example 14.7\\n\"\n",
+ "print \"\\n Steam flow rate required is \",SFR ,\" kg/s\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex14.8:pg-611"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 14.8\n",
+ "\n",
+ "\n",
+ "COP of the system is 5.50140730574\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "tf = 5 # Temperature of flash chamber in degree celsius\n",
+ "x = 0.98 # Quality of water vapour living the evaporator\n",
+ "t2 = 14 # Returning temperature of chilled water in degree celsius\n",
+ "t0 = 30 # Make up water temperature in degree celsius\n",
+ "m = 12 # Mass flow rate of chilled water in kg/s\n",
+ "nc = 0.8 # Compressor efficiecy \n",
+ "pc = 0.1 # Condenser pressure in bar\n",
+ "print \"\\n Example 14.8\\n\"\n",
+ "#From the steam table\n",
+ "hf = 58.62 # In kJ/kg at 14 degree celsius\n",
+ "hf_ = 20.93 # In kJ/kg at 5 degree celsius\n",
+ "hf__ = 125.73 # In kJ/kg at 30 degree celsius\n",
+ "hv = x*2510.7\n",
+ "Rc = m*(hf-hf_)/3.5\n",
+ "m_v = Rc*3.5/(hv-hf__)\n",
+ "# At 0.10 bar\n",
+ "hg = 2800 # In kJ/kg \n",
+ "Win = m_v*(hg-hv)/nc\n",
+ "COP = Rc*3.5/Win\n",
+ "print \"\\nCOP of the system is \",COP"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex14.9:pg-611"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 14.9\n",
+ "\n",
+ "\n",
+ " COP of the refrigerator is 0.245731992881\n",
+ "\n",
+ " Driving power required is 47.4771987558 kW\n",
+ "\n",
+ " Mass flow rate is 0.64768311581 kg/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T1 = 4.0 # Compressor inlet temperature in degree Celsius\n",
+ "T3 = 55.0 # Cooling limit in heat exchanger in degree Celsius\n",
+ "rp = 3.0 # Pressure ratio\n",
+ "g = 1.4 # Heat capacity ratio\n",
+ "cp = 1.005 # Constant volume heat capacity\n",
+ "L = 3.0 # Cooling load in tonnes of refrigeration\n",
+ "nc = 0.72 # compressor efficiency\n",
+ "T2s = (T1+273)*(rp**((g-1)/g)) # Ideal temperature after compression\n",
+ "T2 = (T1+273)+(T2s-T1-273)/nc # Actual temperature after compression\n",
+ "T4s = (T3+273)/(rp**((g-1)/g)) # Ideal temperature after expansion\n",
+ "T34 = 0.78*(T3+273-T4s) # Change in temperature during expansion process\n",
+ "T4 = T3+273-T34 # Actual temperature after expansion\n",
+ "COP = (T1+273-T4)/((T2-T1-273)-(T3+273-T4)) # Coefficient of performance of cycle\n",
+ "P = (L*14000)/(COP*3600) # Driving power required\n",
+ "m = (L*14000)/(cp*(T1+273-T4)) # Mass flow rate of air\n",
+ "print \"\\n Example 14.9\\n\"\n",
+ "print \"\\n COP of the refrigerator is \",COP\n",
+ "print \"\\n Driving power required is \",P ,\" kW\"\n",
+ "print \"\\n Mass flow rate is \",m/3600 ,\" kg/s\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex14.10:pg-611"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 14.10\n",
+ "\n",
+ "\n",
+ " Power input is 4.33428165007 kW\n",
+ "\n",
+ " Heating capacity is 20.972972973 kW\n",
+ "\n",
+ " COP is 4.83885789301\n",
+ "\n",
+ " The isentropic compressor efficiency is 79.9803085002 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "P1 = 2.4 #Compressor inlet pressure in bar\n",
+ "T1 = 0 # Compressor inlet temperature in degree Celsius\n",
+ "h1 = 188.9 # Enthalpy of refrigerant at state 1 in kJ/kg\n",
+ "s1 = 0.7177 # Entropy of refrigerant at state 1 in kJ/kgK\n",
+ "v1 = 0.0703 # Specific volume at state 1 in m**3/kg\n",
+ "P2 = 9 # Compressor outlet pressure in bar\n",
+ "T2 = 60 # Compressor outlet pressure in degree Celsius\n",
+ "h2 = 219.37 # Actual compressor outlet enthalpy in kJ/kgK\n",
+ "h2s = 213.27 # Ideal compressor outlet enthalpy in kJ/kgK\n",
+ "h3 = 71.93 # Enthalpy of refrigerant at state 3 in kJ/kg\n",
+ "h4 = h3 # Isenthalpic process\n",
+ "\n",
+ "A1V1 = 0.6/60 # volume flow rate in kg/s\n",
+ "m_dot = A1V1/v1 # mass flow rate\n",
+ "Wc_dot = m_dot*(h2-h1) # Compressor work\n",
+ "Q1_dot = m_dot*(h2-h3) # Heat extracted \n",
+ "COP = Q1_dot/Wc_dot # Coefficient of performance\n",
+ "nis = (h2s-h1)/(h2-h1) # Isentropic compressor efficiency\n",
+ "print \"\\n Example 14.10\\n\"\n",
+ "print \"\\n Power input is \",Wc_dot ,\" kW\"\n",
+ "print \"\\n Heating capacity is \",Q1_dot ,\" kW\"\n",
+ "print \"\\n COP is \",COP\n",
+ "print \"\\n The isentropic compressor efficiency is \",nis*100 ,\" percent\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex14.11:pg-611"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 14.11\n",
+ "\n",
+ "\n",
+ " Pressure ratio for the turbine is 3.61111111111\n",
+ "\n",
+ " COP is 0.533011099882\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T1 = 275.0 # Temperature of air at entrance to compressor in K \n",
+ "T3 = 310.0 # Temperature of air at entrance to turbine in K \n",
+ "P1 = 1.0 # Inlet presure in bar\n",
+ "P2 = 4.0 # Outlet pressure in bar\n",
+ "nc = 0.8 # Compressor efficiency\n",
+ "T2s = T1*(P2/P1)**(.286) # Ideal temperature after compression\n",
+ "T2 = T1 + (T2s-T1)/nc # Actual temperature after compression\n",
+ "pr1 = 0.1 # Pressure loss in cooler in bar\n",
+ "pr2 = 0.08 #Pressure loss in condensor in bar \n",
+ "P3 = P2-0.1 # Actual pressure in condesor\n",
+ "P4 = P1+0.08 # Actual pressure in evaporator\n",
+ "PR = P3/P4 # Pressure ratio\n",
+ "T4s = T3*(1/PR)**(0.286) # Ideal temperature after expansion\n",
+ "nt = 0.85 # turbine efficiency\n",
+ "T4 = T3-(T3-T4s)*nt # Actual temperature after expansion\n",
+ "COP = (T1-T4)/((T2-T3)-(T1-T4)) # Coefficient of performance \n",
+ "print \"\\n Example 14.11\\n\"\n",
+ "print \"\\n Pressure ratio for the turbine is \",PR\n",
+ "print \"\\n COP is \",COP\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex14.12:pg-611"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 14.12\n",
+ "\n",
+ "\n",
+ " Mass flow rate of air flowing through the cooling system is 1.16504854369\n",
+ "\n",
+ " COP is 0.255512245083\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "L = 60.0 # Cooling load in kW\n",
+ "p = 1.0 # Pressure in bar\n",
+ "t = 20.0 # Temperature in degree celsius\n",
+ "v = 900.0 # Speed of aircraft in km/h\n",
+ "p1 = 0.35 # Pressure in bar\n",
+ "T1 = 255 # Temperature in K\n",
+ "nd = .85 # Diffuser efficiency \n",
+ "rp = 6.0 # Pressure ratio of compressor\n",
+ "nc = .85 # Copressor efficiency \n",
+ "E = 0.9 # Effectiveness of air cooler\n",
+ "nt = 0.88 # Turbine efficiency \n",
+ "p_ = 0.08 # Pressure drop in air cooler in bar\n",
+ "p5 = 1.08 # Pressure in bar\n",
+ "cp = 1.005 # Heat capacity of air at constant pressure in kJ/kgK\n",
+ "gama = 1.4 # Ratio of heat capacities of air\n",
+ "print \"\\n Example 14.12\\n\"\n",
+ "V = v*(5/18)\n",
+ "T2_ = T1 + (V**2)/(2*cp*1000)\n",
+ "T2 = T2_\n",
+ "p2_ = p1*((T2_/T1)**((gama/(gama-1))))\n",
+ "p2 = p1 + nd*(p2_-p1)\n",
+ "p3 = rp*p2\n",
+ "T3_ = T2*((p3/p2)**((gama-1)/gama))\n",
+ "T3 = T2 + (T3_-T2)/nc\n",
+ "P = cp*(T3-T2)\n",
+ "p4 = p3 - p_\n",
+ "T4 = T3 - E*(T3-T2)\n",
+ "T5_ = T4/((p4/p5)**(.286))\n",
+ "T5 = T4 - (T4-T5_)/nt\n",
+ "RE = cp*(t+273 - T5)\n",
+ "m = L/51.5\n",
+ "Pr = m*P\n",
+ "COP = L/Pr\n",
+ "print \"\\n Mass flow rate of air flowing through the cooling system is \",m\n",
+ "print \"\\n COP is \",COP\n",
+ "#The answers vary due to round off error"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter15_o1Meb0U.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter15_o1Meb0U.ipynb
new file mode 100644
index 00000000..f64e81fc
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter15_o1Meb0U.ipynb
@@ -0,0 +1,760 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 15:Psychrometrics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex15.1:pg-631"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 15.1\n",
+ "\n",
+ "\n",
+ " Specific humidity is 0.0186241999923 kg vap./kg dry air\n",
+ "\n",
+ " Partial pressure of water vapour is 0.0294557080928 bar\n",
+ "\n",
+ " Dew point temperature is 24.1 degree celcius\n",
+ "\n",
+ " Relative humidity is 61.3660585267 percent \n",
+ "\n",
+ " Degree of saturation is 0.602092639086\n",
+ "\n",
+ " Density of dry air is 1.12382965889 kg/m**3\n",
+ "\n",
+ " Density of water vapor is 0.0209304283244 kg/m**3\n",
+ "\n",
+ " Enthalpy of the mixture is 80.1126961785 kJ/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "Ps = 0.033363 #Saturation pressure in bar\n",
+ "P = 1.0132 # Atmospheric pressure in bar\n",
+ "W2 = (0.622*Ps)/(P-Ps) # mass fraction of moisture\n",
+ "hfg2 = 2439.9 # Latent heat of vaporization in kJ/kg\n",
+ "hf2 = 109.1 # Enthalpy of liquid moisture in kJ/kg\n",
+ "cpa = 1.005 # Constant pressure heat capacity in kJ/kg\n",
+ "hg = 2559.9 # Enthalpy of gas moisture in kJ/kg\n",
+ "hw1 = hg # constant enthalpy\n",
+ "T2 = 26 # wbt in degree Celsius \n",
+ "T1 = 32 # dbt in degree Celsius \n",
+ "W1 = (cpa*(T2-T1)+(W2*hfg2))/(hw1-hf2)\n",
+ "Pw = ((W1/0.622)*P)/(1+(W1/0.622))\n",
+ "\n",
+ "Psat = 0.048 # Saturation pressure in bar at 32 degree\n",
+ "fi = Pw/Psat # Relative humidity\n",
+ "\n",
+ "mu = (Pw/Psat)*((P-Psat)/(P-Pw)) # Degree of Saturation\n",
+ "Pa = P-Pw # Air pressure\n",
+ "Ra = 0.287 # Gase constant\n",
+ "Tdb = T1+273 # dbt in K\n",
+ "rho_a = (Pa*100)/(Ra*Tdb) # Density of air \n",
+ "rho_w = W1*rho_a # Water vapor density\n",
+ "ta = 32 # air temperature in degree Celsius \n",
+ "tdb = 32 # dbt in degree Celsius \n",
+ "tdp = 24.1# Dew point temperature in degree Celsius \n",
+ "h = cpa*ta + W1*(hg+1.88*(tdb-tdp))\n",
+ "print \"\\n Example 15.1\\n\"\n",
+ "print \"\\n Specific humidity is \",W1 ,\" kg vap./kg dry air\"\n",
+ "print \"\\n Partial pressure of water vapour is \",Pw ,\" bar\"\n",
+ "print \"\\n Dew point temperature is \",tdp ,\" degree celcius\"\n",
+ "print \"\\n Relative humidity is \",fi*100 ,\" percent \"\n",
+ "print \"\\n Degree of saturation is \",mu\n",
+ "print \"\\n Density of dry air is \",rho_a ,\" kg/m**3\"\n",
+ "print \"\\n Density of water vapor is \",rho_w ,\" kg/m**3\"\n",
+ "print \"\\n Enthalpy of the mixture is \",h ,\" kJ/kg\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex15.2:pg-632"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 15.2\n",
+ "\n",
+ "\n",
+ " Humidity ratio of inlet mixture is 0.0107221417941 kg vap./kg dry air\n",
+ "\n",
+ " Relative humidity is 39.9106245278 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "Ps = 2.339 # Satutation pressure in kPa\n",
+ "P = 100.0 # Atmospheric pressure in kPa\n",
+ "W2 = (0.622*Ps)/(P-Ps) # Specific humidity\n",
+ "hfg2 = 2454.1 # Latent heat of vaporization in kJ/kg\n",
+ "hf2 = 83.96 # Enthalpy of fluid in kJ/kg\n",
+ "cpa = 1.005 # COnstant pressure heat capacity of air\n",
+ "hw1 = 2556.3# ENthalpy of water\n",
+ "T2 = 20.0 # Exit tempeature of mixture in degree Celsius\n",
+ "T1 = 30.0 # Inlet tempeature of mixture in degree Celsius\n",
+ "W1 = (cpa*(T2-T1)+(W2*hfg2))/(hw1-hf2) # Specific humidity at inlet\n",
+ "Pw1 = ((W1/0.622)*P)/(1+(W1/0.622)) # pressure due to moisture\n",
+ "Ps1 = 4.246 # Saturation pressure in kPa\n",
+ "fi = (Pw1/Ps1) # Humidity ratio \n",
+ "\n",
+ "print \"\\n Example 15.2\\n\"\n",
+ "print \"\\n Humidity ratio of inlet mixture is \",W1 ,\" kg vap./kg dry air\"\n",
+ "print \"\\n Relative humidity is \",fi*100 ,\" percent\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex15.3:pg-633"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 15.3\n",
+ "\n",
+ "\n",
+ " Mass of spray water required is 0.00338125323083 kg moisture/m**3\n",
+ "\n",
+ " Temperature to which air must be heated is 27.0827212424 degree celcius\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "Psat = 2.339 # Saturation pressure in kPa\n",
+ "fi3 = 0.50 # Humidity ratio\n",
+ "P = 101.3 # Atmospheric pressure in kPa\n",
+ "cp = 1.005 # Constant pressure heat addition in kJ/kg\n",
+ "Pw3 = fi3*Psat # Vapor pressure\n",
+ "Pa3 = P-Pw3 # Air pressure\n",
+ "W3 = 0.622*(Pw3/Pa3) # Specific humidity\n",
+ "Psa1_1 = 0.7156 # Saturation pressure in kPa\n",
+ "Pw1 = 0.7156 # moister pressure in kPa \n",
+ "Pa1 = P-Pw1 # Air pressure\n",
+ "W1 = 0.622*(Pw1/Pa1) # Specific humidity\n",
+ "W2 = W1 # Constant humidity process\n",
+ "T3 = 293.0 # Temperature at state 3 in K\n",
+ "Ra = 0.287 # Gas constant\n",
+ "Pa3 = 100.13 # Air pressure at state 3\n",
+ "va3 = (Ra*T3)/Pa3 # volume of air at state 3\n",
+ "SW = (W3-W1)/va3 # spray water \n",
+ "tsat = 9.65 # Saturation temperature in K\n",
+ "hg = 2518.0 # Enthalpy of gas in kJ/kg\n",
+ "h4 = 10.0 # Enthalpy at state 4 in kJ/kg\n",
+ "t3 = T3-273\n",
+ "t2 = ( W3*(hg+1.884*(t3-tsat))-W2*(hg-1.884*tsat) + cp*t3 - (W3-W2)*h4 )/ (cp+W2*1.884)\n",
+ "print \"\\n Example 15.3\\n\"\n",
+ "print \"\\n Mass of spray water required is \",SW ,\" kg moisture/m**3\"\n",
+ "print \"\\n Temperature to which air must be heated is \",t2 ,\" degree celcius\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex15.4:pg-635"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 15.4\n",
+ "\n",
+ "\n",
+ " Capacity of the cooling coil is 33.7880496054 tonnes\n",
+ "\n",
+ " Capacity of the heating coil is 18.7711386697 kW\n",
+ "\n",
+ " Rate of water vapor removal is 0.0319109357384 kg/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "h1 = 82.0 # Enthalpy at state 1 in kJ/kg\n",
+ "h2 = 52.0 # Enthalpy at state 2 in kJ/kg\n",
+ "h3 = 47.0 # Enthalpy at state 3 in kJ/kg\n",
+ "h4 = 40.0# Enthalpy at state 4 in kJ/kg\n",
+ "W1 = 0.020 # Specific humidity at state 1\n",
+ "W2 = 0.0115# Specific humidity at state 2 \n",
+ "W3 = W2 # Constant humidity process\n",
+ "v1 = 0.887 # Specific volume at state 1\n",
+ "v = 3.33 # amount of free sir circulated\n",
+ "G = v/v1 # air flow rate\n",
+ "CC = (G*(h1-h3)*3600)/14000 # Capacity of the heating Cooling coil\n",
+ "R = G*(W1-W3) # Rate of water vapor removal\n",
+ "HC = G*(h2-h3) #Capacity of the heating coil\n",
+ "print \"\\n Example 15.4\\n\"\n",
+ "print \"\\n Capacity of the cooling coil is \",CC ,\" tonnes\"\n",
+ "print \"\\n Capacity of the heating coil is \",HC ,\" kW\"\n",
+ "print \"\\n Rate of water vapor removal is \",R ,\" kg/s\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex15.5:pg-636"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 15.5 \n",
+ "\n",
+ "\n",
+ " Final condition of air is given by\n",
+ "\n",
+ " W3 = 0.0144 kg vap./kg dry air\n",
+ "\n",
+ " h3 = 71.6666666667 kJ/kg dry air\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "W1 = 0.0058 # Humidity ratio for first stream\n",
+ "W2 = 0.0187 # Humidity ratio for second stream\n",
+ "h1 = 35.0 # Enthalpy of first stream in kJ/kg\n",
+ "h2 = 90.0# Enthalpy of second stream in kJ/kg\n",
+ "G12 = 1.0/2.0 #ratio\n",
+ "W3 = (W2+G12*W1)/(1+G12) # Final humidity ratio of mixture\n",
+ "h3 = (2.0/3.0)*h2 + (1.0/3.0)*h1# Final enthalpy of mixture\n",
+ "\n",
+ "print \"\\n Example 15.5 \\n\"\n",
+ "print \"\\n Final condition of air is given by\"\n",
+ "print \"\\n W3 = \",W3 ,\" kg vap./kg dry air\"\n",
+ "print \"\\n h3 = \",h3 ,\" kJ/kg dry air\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex15.6:pg-637"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 15.6 \n",
+ "\n",
+ "\n",
+ " The temperature of air at the end of the drying process is 38.5 degree celsius,\n",
+ " Heat rejected during the cooling process is 18.5 kJ/kg,\n",
+ " The relative humidity is 53.0 percent,\n",
+ " The dew point temperature at the end of drying process is 11.2 degree celsius,\n",
+ " The moisture removed during the drying process is 0.007 kg vap/kg dry air\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "t = 21.0 # Temperature in degreee celsius\n",
+ "w = 20.0 # Relative humidity in percentage\n",
+ "t_ = 21.0 # Final temperature of air in degree celsius\n",
+ "print \"\\n Example 15.6 \\n\"\n",
+ "# From the psychrometric chart \n",
+ "T2 = 38.5 # In degree celsius\n",
+ "h1_3 = 60.5-42 # In kJ/kg\n",
+ "fi3 = 53.0 # In percentage \n",
+ "t4 = 11.2 # In degree celsius\n",
+ "W1_2 = 0.0153-0.0083 # In kg vap /kg dry air\n",
+ "print \"\\n The temperature of air at the end of the drying process is \",T2 ,\" degree celsius,\\n Heat rejected during the cooling process is \",h1_3 ,\" kJ/kg,\\n The relative humidity is \",fi3 ,\" percent,\\n The dew point temperature at the end of drying process is \",t4 ,\" degree celsius,\\n The moisture removed during the drying process is \",W1_2 ,\" kg vap/kg dry air\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex15.7:pg-638"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 15.7 \n",
+ "\n",
+ "\n",
+ " Capacity of the cooling coil is 32.2863520408 tonnes\n",
+ "\n",
+ " Capacity of humidifier is 69.3080357143 kg/h\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "h1 = 57.0 # Enthalpy at state 1 in kJ/kg \n",
+ "h2 = h1 # Isenthalpic process\n",
+ "h3 = 42.0 # Enthalpy at state 3 in kJ/kg\n",
+ "W1 = 0.0065 # Humidity ratio at sate 1\n",
+ "W2 = 0.0088 # Humidity ratio at sate 2\n",
+ "W3 = W2 # Constant humidity ratio process\n",
+ "t2 = 34.5 # Temperature at state 2\n",
+ "v1 = 0.896# Specific volume at state 1 in m**3/kg\n",
+ "n = 1500.0 # seating capacity of hall\n",
+ "a = 0.3 # amount of outdoor air supplied m**3 per person\n",
+ "G = (n*a)/0.896 # Amount of dry air supplied\n",
+ "CC = (G*(h2-h3)*60)/14000 # Cooling capacity \n",
+ "R = G*(W2-W1)*60 # Capacity of humidifier\n",
+ "\n",
+ "print \"\\n Example 15.7 \\n\"\n",
+ "print \"\\n Capacity of the cooling coil is \",CC ,\" tonnes\"\n",
+ "print \"\\n Capacity of humidifier is \",R ,\" kg/h\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex15.8:pg-639"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 15.8\n",
+ "\n",
+ "\n",
+ " Temperature of water leaving the tower is 21.8128048148 degree celcius\n",
+ "\n",
+ " Range of cooling water is 8.18719518522 degree Celsius\n",
+ "\n",
+ " Approach of cooling water is 6.61280481478 degree celcius\n",
+ "\n",
+ " Fraction of water evaporated is 0.0125 kg/kg dry air\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "twb1 = 15.2# Wbt in degree Celsius \n",
+ "twb2 = 26.7# Wbt in degree Celsius \n",
+ "tw3 = 30 # Temperature at state 3 in degree Celsius \n",
+ "h1 = 43 # Enthalpy at state 1 in kJ/kg\n",
+ "h2 = 83.5 # Enthalpy at state 2 in kJ/kg\n",
+ "hw = 84 # Enthalpy of water in kJ/kg\n",
+ "mw = 1.15 # mass flow rate of water in kg/s\n",
+ "W1 = 0.0088 # Humidity ratio of inlet stream \n",
+ "W2 = 0.0213 # Humidity ratio of exit stream \n",
+ "hw3 = 125.8 # Enthalpy of water entering tower in kJ/kg \n",
+ "hm = 84 # Enthalpy of make up water in kJ/kg \n",
+ "G = 1 # mass flow rate of dry air in kg/s\n",
+ "hw34 = (G/mw)*((h2-h1)-(W2-W1)*hw) # Enthalpy change\n",
+ "tw4 = tw3-(hw34/4.19) # Temperature of water leaving the tower\n",
+ "A = tw4-twb1 #Approach of cooling water\n",
+ "R = tw3-tw4 #Range of cooling water\n",
+ "x = G*(W2-W1) #Fraction of water evaporated \n",
+ "\n",
+ "print \"\\n Example 15.8\\n\"\n",
+ "print \"\\n Temperature of water leaving the tower is \",tw4 ,\" degree celcius\"\n",
+ "print \"\\n Range of cooling water is \",R ,\" degree Celsius\"\n",
+ "print \"\\n Approach of cooling water is \",A ,\" degree celcius\"\n",
+ "print \"\\n Fraction of water evaporated is \",x ,\" kg/kg dry air\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex15.9:pg-639"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 15.9 \n",
+ "\n",
+ "\n",
+ " Bypass factor of coolin coil is 0.415730337079\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "DBT = 40.0 # Dry bulb temperature in degree celsius\n",
+ "DBT_ = 25.0 # Dry bulb temperature after cooling and dehumidification in degree celsius\n",
+ "RH = 70.0 # Relative humidity in percentage\n",
+ "f = 30.0 # Air flow rate in cmm\n",
+ "print \"\\n Example 15.9 \\n\"\n",
+ "# From the psychrometric chart \n",
+ "v1 = 0.9125 # In m**3/kg\n",
+ "G = f/v1\n",
+ "h5 = 41.5 # In kJ/kg\n",
+ "W1 = 0.0182 # In kg vapor/kg dry air \n",
+ "h1 = 86.0 # In kJ/kg d.a.\n",
+ "W2 = 0.0136 # In kg vapor/kg dry air \n",
+ "h2 = 60.0 # In kJ/kg\n",
+ "L = G*(h1-h2)/3.5\n",
+ "Mo = G*(W1-W2)\n",
+ "x = (h2-h5)/(h1-h5)\n",
+ "print \"\\n Bypass factor of coolin coil is \",x\n",
+ "# Answer veries due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex15.10:pg-641"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 15.10 \n",
+ "\n",
+ "\n",
+ " Capacity of heating coil is 6.94444444444 kW,\n",
+ " Surface temperature of heating coil is 40.0 degree celsius,\n",
+ " Capacity of humidifier is 2.66666666667 kg/h \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "c = 75.0 # Capacity of classroom in no of perasons\n",
+ "DBT1 = 10.0 # Outdoor Dry bulb temperature in degree celsius\n",
+ "WBT1 = 8.0 # Outdoor Wet bulb temperature in degree celsius\n",
+ "DBT2 = 20.0 # Indoor Dry bulb temperature in degree celsius\n",
+ "RH2 = 50.0 # Relative humidity in percentage\n",
+ "x =0.5 # Bypass factor\n",
+ "f = 0.3 # Air flow rate per person in cmm\n",
+ "print \"\\n Example 15.10 \\n\"\n",
+ "# From the psychrometric chart \n",
+ "W1 = 0.0058 # In kg moisture/kg d.a.\n",
+ "h1 = 24.5 # In kJ/kg\n",
+ "h2 = 39.5 # In kJ/kg\n",
+ "h3 = h2\n",
+ "W3 = 0.0074 # In kg moisture/kg d.a.\n",
+ "t2 = 25.0 # In degree celsius\n",
+ "v1 = .81 # In m**3/kg d.a.\n",
+ "G = f*c/v1\n",
+ "C = G*(h2-h1)/60\n",
+ "t4 = (t2-x*DBT1)/(1-x)\n",
+ "ts = t4\n",
+ "C_H = G*(W3-W1)*60\n",
+ "print \"\\n Capacity of heating coil is \",C ,\" kW,\\n Surface temperature of heating coil is \",ts ,\" degree celsius,\\n Capacity of humidifier is \",C_H ,\" kg/h \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex15.11:pg-641"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 15.11 \n",
+ "\n",
+ "\n",
+ " DBT of air leaving the coil is 18.6 degree celsius,\n",
+ " WBT of air leaving the coil is 12.5 degree celsius,\n",
+ " Coil bypass factor is 0.525426680599\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "DBT = 31.0 # Dry bulb temperature in degree celsius\n",
+ "WBT = 18.5 # Wet bulb temperature in degree celsius\n",
+ "t = 4.4 # Effective surface temperature of coil in degree celsius\n",
+ "RE = 12.5 # Refrigeration effect by the coil in kW\n",
+ "f= 39.6 # Air flow rate in cmm\n",
+ "print \"\\n Example 15.11 \\n\"\n",
+ "# From the fig. given in the example\n",
+ "ws = 5.25 #In g/kg d.a.\n",
+ "hs = 17.7 #In kJ/kg d.a.\n",
+ "v1 = 0.872 # In m**3/kg d.a.\n",
+ "h1 = 52.5 # In kJ/kg d.a.\n",
+ "w1 = 8.2 # In g/kg d.a.\n",
+ "G = f/v1\n",
+ "h2 = h1-(RE*60)/G\n",
+ "w2 = w1-((h1-h2)/(h1-hs))*(w1-ws)\n",
+ "# From the psychrometric chart\n",
+ "t2 = 18.6 # In degree celsius\n",
+ "t_ = 12.5 # In degree celsius\n",
+ "x = (h2-hs)/(h1-hs)\n",
+ "print \"\\n DBT of air leaving the coil is \",t2 ,\" degree celsius,\\n WBT of air leaving the coil is \",t_ ,\" degree celsius,\\n Coil bypass factor is \",x \n",
+ "# Answer veries due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex15.12:pg-641"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 15.12 \n",
+ "\n",
+ "\n",
+ " Capacity of cooling coil is 100.803276106 tonnes,\n",
+ " Bypass factor of cooling coil is 0.0588235294118 ,\n",
+ " Capacity of heating coil is 22.6666666667 kW,\n",
+ " Surface temperature of heating coil is 44.1014332966 degree celsius,\n",
+ " Mass of water vapor removed is 5.22601984564 kg/min \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "c = 75.0 # Capacity of classroom in no of perasons\n",
+ "DBT1 = 35.0 # Outdoor Dry bulb temperature in degree celsius\n",
+ "RH1 = 70.0 # Outdoor relative humidity in percentage\n",
+ "DBT2 = 20.0 # Indoor Dry bulb temperature in degree celsius \n",
+ "RH1 = 60.0 # Indoor relative humidity in percentage\n",
+ "DPT = 10.0 # Cooling coil dew point temperature in degree celsius\n",
+ "x =0.25 # Bypass factor\n",
+ "f = 300.0 # Air flow rate in cmm\n",
+ "print \"\\n Example 15.12 \\n\"\n",
+ "# From the psychrometric chart \n",
+ "W1 = 0.0246 # In kg vap./kg d.a.\n",
+ "h1 = 98.0 # In kJ/kg\n",
+ "v1 = 0.907 # In m**3/kg d.a.\n",
+ "h3 = 42.0 # In kJ/kg\n",
+ "W3 = 0.0088 # In kg moisture/kg d.a.\n",
+ "h2 = 34.0 # In kJ/kg\n",
+ "hs = 30.0 # In kJ/kg\n",
+ "t2 = 12.0 # In degree celsius\n",
+ "G = f/v1\n",
+ "C = G*(h1-h2)/(60*3.5)\n",
+ "X = (h2-hs)/(h1-hs)\n",
+ "C_ = G*(h3-h2)/60\n",
+ "t4 = (DBT2-x*t2)/(1-x)\n",
+ "C_H = G*(W1-W3)\n",
+ "print \"\\n Capacity of cooling coil is \",C ,\" tonnes,\\n Bypass factor of cooling coil is \",X ,\",\\n Capacity of heating coil is \",t4 ,\" kW,\\n Surface temperature of heating coil is \",C_ ,\" degree celsius,\\n Mass of water vapor removed is \",C_H ,\" kg/min \"\n",
+ "#Answers veries due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex15.13:pg-641"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 15.13\n",
+ "\n",
+ "\n",
+ " Make up water flow rate is 0.127715382722 kg/s\n",
+ "\n",
+ " Volume flow rate of air is 3.39095173631 m**3/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# at 15 degree Celsius\n",
+ "Psat1 = 0.01705 # Saturation pressure in bar\n",
+ "hg1 = 2528.9 # Enthalpy in kJ/kg\n",
+ "# At 35 degree Celsius\n",
+ "Psat2 = 0.05628 # Saturation pressure in bar\n",
+ "hg2 = 2565.3 # Enthalpy in kJ/kg\n",
+ "fi1 = 0.55# Humidity ratio at state 1\n",
+ "Pw1 = fi1*Psat1 # water vapor pressure at state 1\n",
+ "fi2 = 1.0 # Humidity ratio at state 2\n",
+ "Pw2 = fi2*Psat2 # water vapor pressure at state 2 \n",
+ "P = 0.1 # Atmospheric pressure in MPa\n",
+ "W1 = (0.622*Pw1)/(P*10-Pw1)\n",
+ "W2 = (0.622*Pw2)/(P*10-Pw2)\n",
+ "MW = W2-W1 # unit mass flow rate of water\n",
+ "t2 = 35.0 # Air exit temperature in degree Celsius\n",
+ "t1 = 14.0 # make up water inlet temperature in degree Celsius \n",
+ "m_dot = 2.78 # water flow rate in kg/s\n",
+ "cpa = 1.005 # Constant pressure heat capacity ratio in kJ/kg\n",
+ "h43 = 35*4.187 # Enthalpy change\n",
+ "h5 = 14*4.187 # Enthalpy at state 5in kJ/kg\n",
+ "m_dot_w = (-(W2-W1)*h5 - W1*hg1 + W2*hg2 + cpa*(t2-t1))/(h43) \n",
+ "R = m_dot/m_dot_w \n",
+ "MW = (W2-W1)*R #Make up water flow rate\n",
+ "RWA = R*(1+W1)\n",
+ "R = 0.287 # Gas constant \n",
+ "V_dot = (RWA*R*(t1+273))/(P*1e03) # Volume flow rate of air\n",
+ "print \"\\n Example 15.13\\n\"\n",
+ "print \"\\n Make up water flow rate is \",MW ,\" kg/s\"\n",
+ "print \"\\n Volume flow rate of air is \",V_dot ,\" m**3/s\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter16_xq1IcPx.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter16_xq1IcPx.ipynb
new file mode 100644
index 00000000..c857acc0
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter16_xq1IcPx.ipynb
@@ -0,0 +1,555 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 16:Reactive Systems"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex16.2:pg-675"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 16.2\n",
+ "\n",
+ "\n",
+ " K is 0.314529177004 atm\n",
+ "\n",
+ " Epsilon is 0.611607081035\n",
+ "\n",
+ " The heat of reaction is 60974.6120608 kJ/kg mol\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "eps_e = 0.27 # Constant\n",
+ "P = 1.0 # Atmospheric pressure in bar\n",
+ "K = (4*eps_e**2*P)/(1-eps_e**2) \n",
+ "P1 = 100.0/760.0 # Pressure in Pa\n",
+ "eps_e_1 = math.sqrt((K/P1)/(4.0+(K/P1)))\n",
+ "T1 = 318.0 # Temperature in K\n",
+ "T2 = 298.0# Temperature in K\n",
+ "R = 8.3143 # Gas constant\n",
+ "K1 = 0.664 # dissociation constant at 318K\n",
+ "K2 = 0.141# dissociation constant at 298K\n",
+ "dH = 2.30*R*((T1*T2)/(T1-T2))*(math.log10(K1/K2))\n",
+ "print \"\\n Example 16.2\\n\"\n",
+ "print \"\\n K is \",K ,\" atm\"\n",
+ "print \"\\n Epsilon is \",eps_e_1\n",
+ "print \"\\n The heat of reaction is \",dH ,\" kJ/kg mol\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex16.3:pg-675"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 16.3\n",
+ "\n",
+ "\n",
+ " Equilibrium constant is 1.61983471074\n",
+ "\n",
+ " Gibbs function change is -4812.22485358 J/gmol\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "v1 = 1.0 # Assumed\n",
+ "v2 = v1# Assumed \n",
+ "v3 = v2 # Assumed\n",
+ "v4 = v2# Assumed\n",
+ "e = 0.56 # Degree of reaction\n",
+ "P = 1.0 # Dummy\n",
+ "T = 1200.0 # Reaction temperature in K\n",
+ "R = 8.3143 # Gas constant\n",
+ "x1 = (1-e)/2.0 # \n",
+ "x2 = (1-e)/2.0\n",
+ "x3 = e/2.0 \n",
+ "x4 = e/2.0\n",
+ "K = (((x3**v3)*(x4**v4))/((x1**v1)*(x2**v2)))*P**(v3+v4-v1-v2) # Equilibrium constant\n",
+ "dG = -R*T*math.log(K) #Gibbs function change\n",
+ "\n",
+ "print \"\\n Example 16.3\\n\"\n",
+ "print \"\\n Equilibrium constant is \",K\n",
+ "print \"\\n Gibbs function change is \",dG ,\"J/gmol\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex16.5:pg-678"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 16.5\n",
+ "\n",
+ "\n",
+ " The value of equillibrium constant is 0.755668681281 atm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "Veo = 1.777 # Ve/Vo\n",
+ "e = 1.0-Veo # Degree of dissociation\n",
+ "P = 0.124 # in atm\n",
+ "K = (4*e**2*P)/(1.0-e**2)\n",
+ "\n",
+ "print \"\\n Example 16.5\\n\"\n",
+ "print \"\\n The value of equillibrium constant is \",K ,\" atm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex16.6:pg-680"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 16.6\n",
+ "\n",
+ "\n",
+ " Cp is 4.48364424966 J/g mol K\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "v1 = 1.0 # Assumed\n",
+ "v2 = 0 # Assumed\n",
+ "v3 = 1.0 # Assumed\n",
+ "v4 = 1.0/2.0# Assumed\n",
+ "dH = 250560.0 # Enthalpy change in j/gmol\n",
+ "e = 3.2e-03 # Constant\n",
+ "R = 8.3143 # Gas constant\n",
+ "T = 1900.0 # Reaction temperature\n",
+ "Cp = ((dH**2)*(1+e/2)*e*(1+e))/(R*T**2*(v1+v2)*(v3+v4))\n",
+ "print \"\\n Example 16.6\\n\"\n",
+ "print \"\\n Cp is \",Cp ,\" J/g mol K\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex16.7:pg-681"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 16.7\n",
+ "\n",
+ "\n",
+ " The composition of fuel is 14.7645650439 percent Hydrogen and 85.2354349561 percent Carbon\n",
+ "\n",
+ " Air fuel ratio is 23.9829146049\n",
+ "\n",
+ " Percentage of excess air used is 67.2268907563 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "a = 21.89 # stochiometric coefficient\n",
+ "y = 18.5 # stochiometric coefficient\n",
+ "x = 8.9 # stochiometric coefficient\n",
+ "PC = 100*(x*12)/((x*12)+(y)) # Carbon percentage\n",
+ "PH = 100-PC # Hydrogen percentage\n",
+ "AFR = ((32*a)+(3.76*a*28))/((12*x)+y) #Air fuel ratio\n",
+ "EAU = (8.8*32)/((21.89*32)-(8.8*32)) # Excess air used\n",
+ "\n",
+ "print \"\\n Example 16.7\\n\"\n",
+ "print \"\\n The composition of fuel is \",PH ,\" percent Hydrogen and \",PC ,\" percent Carbon\"#The answer provided in the textbook is wrong\n",
+ "print \"\\n Air fuel ratio is \",AFR\n",
+ "print \"\\n Percentage of excess air used is \",EAU*100 ,\" percent\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex16.8:pg-682"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 16.8\n",
+ "\n",
+ "\n",
+ " Heat transfer per kg mol of fuel is -965198.0 kJ\n",
+ "\n",
+ " Q_cv is -890324.0 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "hf_co2 = -393522.0 # Enthalpy of reaction in kJ/kg mol\n",
+ "hf_h20 = -285838.0# Enthalpy of reaction in kJ/kg mol\n",
+ "hf_ch4 = -74874.0# Enthalpy of reaction in kJ/kg mol\n",
+ "D = hf_co2 + (2*hf_h20) #Heat transfer \n",
+ "QCV = D-hf_ch4 # Q_cv\n",
+ "\n",
+ "print \"\\n Example 16.8\\n\"\n",
+ "print \"\\n Heat transfer per kg mol of fuel is \",D ,\" kJ\"\n",
+ "print \"\\n Q_cv is \",QCV ,\" kJ\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex16.9:pg-683"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 16.9 \n",
+ "\n",
+ "\n",
+ " Fuel consumption rate is 38.5131749981 kg/h\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Below values are taken from table\n",
+ "Hr = -249952+(18.7*560)+(70*540)\n",
+ "Hp = 8*(-393522+20288)+9*(-241827+16087)+6.25*14171+70*13491\n",
+ "Wcv = 150.0 # Energy out put from engine in kW\n",
+ "Qcv = -205.0 # Heat transfer from engine in kW\n",
+ "n = (Wcv-Qcv)*3600/(Hr-Hp)\n",
+ "print \"\\n Example 16.9 \\n\"\n",
+ "print \"\\n Fuel consumption rate is \",n*114 ,\" kg/h\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex16.11:pg-684"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 16.11 \n",
+ "\n",
+ "\n",
+ " Reversible work is 47139 kJ/kg\n",
+ "\n",
+ " Increase in entropy during combustion is 3699.6688 kJ/kg mol K\n",
+ "\n",
+ " Irreversibility of the process 25056.8559091 kJ/kg\n",
+ "\n",
+ " Availability of products of combustion is 22082.1440909 kJ/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Refer table 16.4 for values\n",
+ "T0 = 298.0 # Atmospheric temperature in K\n",
+ "Wrev = -23316-3*(-394374)-4*(-228583) # Reversible work in kJ/kg mol\n",
+ "Wrev_ = Wrev/44 # Reversible work in kJ/kg\n",
+ "Hr = -103847 # Enthalpy of reactants in kJ/kg\n",
+ "T = 980.0 # Through trial and error\n",
+ "Sr = 270.019+20*205.142+75.2*191.611 # Entropy of reactants\n",
+ "Sp = 3*268.194 + 4*231.849 + 15*242.855 + 75.2*227.485 # Entropy of products\n",
+ "IE = Sp-Sr # Increase in entropy\n",
+ "I = T0*3699.67/44 # Irreversibility\n",
+ "Si = Wrev_ - I# Availability of products of combustion \n",
+ "\n",
+ "print \"\\n Example 16.11 \\n\"\n",
+ "print \"\\n Reversible work is \",Wrev_ ,\" kJ/kg\"\n",
+ "print \"\\n Increase in entropy during combustion is \",Sp-Sr ,\" kJ/kg mol K\"\n",
+ "print \"\\n Irreversibility of the process \",I ,\" kJ/kg\"\n",
+ "print \"\\n Availability of products of combustion is \",Si ,\" kJ/kg\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex16.12:pg-685"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 6.12\n",
+ "\n",
+ "\n",
+ " The chemical energy of carbon is 410541.588354 kJ/k mol\n",
+ "\n",
+ " The chemical energy of hydrogen is 235211.889921 kJ/k mol\n",
+ "\n",
+ " The chemical energy of methane is 821580.156423 kJ/k mol\n",
+ "\n",
+ " The chemical energy of Carbon monoxide is 275364.910207 kJ/k mol\n",
+ "\n",
+ " The chemical energy of liquid methanol is 716698.69005 kJ/k mol\n",
+ "\n",
+ " The chemical energy of nitrogen is 691.0909601 kJ/k mol\n",
+ "\n",
+ " The chemical energy of Oxygen is 3946.64370597 kJ/k mol\n",
+ "\n",
+ " The chemical energy of Carbon dioxide is 20108.2320604 kJ/k mol\n",
+ "\n",
+ " The chemical energy of Water is 5.21177422707 kJ/k mol\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T0 = 298.15 # Environment temperature in K\n",
+ "P0 = 1 # Atmospheric pressure in bar\n",
+ "R = 8.3143# Gas constant\n",
+ "xn2 = 0.7567 # mole fraction of nitrogen\n",
+ "xo2 = 0.2035 # mole fraction of oxygen\n",
+ "xh2o = 0.0312 # mole fraction of water\n",
+ "xco2 = 0.0003# mole fraction of carbon dioxide\n",
+ "# Part (a)\n",
+ "g_o2 = 0 # Gibbs energy of oxygen\n",
+ "g_c = 0 # Gibbs energy of carbon\n",
+ "g_co2 = -394380 # Gibbs energy of carbon dioxide\n",
+ "A = -g_co2 + R*T0*math.log(xo2/xco2) # Chemical energy\n",
+ "\n",
+ "# Part (b)\n",
+ "g_h2 = 0 # Gibbs energy of hydrogen\n",
+ "g_h2o_g = -228590# # Gibbs energy of water\n",
+ "B = g_h2 + g_o2/2 - g_h2o_g + R*T0*math.log(xo2**0.5/xh2o)\n",
+ "# Chemical energy\n",
+ "# Part (c)\n",
+ "g_ch4 = -50790 # Gibbs energy of methane\n",
+ "C = g_ch4 + 2*g_o2 - g_co2 - 2*g_h2o_g + R*T0*math.log((xo2**2)/(xco2*xh2o))\n",
+ "# Chemical energy\n",
+ "# Part (d)\n",
+ "g_co = -137150# # Gibbs energy of carbon mono oxide\n",
+ "D = g_co + g_o2/2 - g_co2 + R*T0*math.log((xo2**0.5)/xco2)\n",
+ "# Chemcal energy\n",
+ "# Part (e)\n",
+ "g_ch3oh = -166240 # Gibbs energy of methanol\n",
+ "E = g_ch3oh + 1.5*g_o2 - g_co2 - 2*g_h2o_g + R*T0*math.log((xo2**1.5)/(xco2*(xh2o**2)))\n",
+ "# Chemical energy\n",
+ "# Part (f)\n",
+ "F = R*T0*math.log(1/xn2)\n",
+ "# Chemical energy\n",
+ "# Part (g)\n",
+ "G = R*T0*math.log(1/xo2)\n",
+ "# Chemical energy\n",
+ "# Part (h)\n",
+ "H = R*T0*math.log(1/xco2)\n",
+ "# Chemical energy\n",
+ "# Part (i)\n",
+ "g_h2o_l = -237180 # Gibbs energy of liquid water\n",
+ "I = g_h2o_l - g_h2o_g + R*T0*math.log(1/xh2o)\n",
+ "# Chemical energy\n",
+ "print \"\\n Example 6.12\\n\"\n",
+ "print \"\\n The chemical energy of carbon is \",A ,\" kJ/k mol\"\n",
+ "print \"\\n The chemical energy of hydrogen is \",B ,\" kJ/k mol\"\n",
+ "print \"\\n The chemical energy of methane is \",C ,\" kJ/k mol\"\n",
+ "print \"\\n The chemical energy of Carbon monoxide is \",D ,\" kJ/k mol\"\n",
+ "print \"\\n The chemical energy of liquid methanol is \",E ,\" kJ/k mol\"\n",
+ "print \"\\n The chemical energy of nitrogen is \",F ,\" kJ/k mol\"\n",
+ "print \"\\n The chemical energy of Oxygen is \",G ,\" kJ/k mol\"\n",
+ "print \"\\n The chemical energy of Carbon dioxide is \",H ,\" kJ/k mol\"\n",
+ "print \"\\n The chemical energy of Water is \",I ,\" kJ/k mol\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex16.13:pg-686"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 6.13\n",
+ "\n",
+ "\n",
+ " The rate of heat transfer from the engine = -4.33120060702 kW,\n",
+ " The second law of efficiency of the engine = 13.3396896634 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Environmet\n",
+ "T0 = 298.15 # Environment temperature in K\n",
+ "P0 = 1.0 # Atmospheric pressure in atm\n",
+ "R = 8.3143# Gas constant\n",
+ "xn2 = 0.7567 # mole fraction of nitrogen\n",
+ "xo2 = 0.2035 # mole fraction of oxygen\n",
+ "xh2o = 0.0312 # mole fraction of water\n",
+ "xco2 = 0.0003# mole fraction of carbon dioxide\n",
+ "xother = 0.0083 # Mole fraction of other gases\n",
+ "# Liquid octane\n",
+ "t1 = 25.0 # Temperature of liquid octane in degree centigrade\n",
+ "m = 0.57 # Mass flow rate in kg/h\n",
+ "T2 = 670 # Temperature of combustion product at exit in K\n",
+ "x1 = 0.114 # Mole fraction of CO2\n",
+ "x2 = .029 # Mole fraction of CO\n",
+ "x3 = .016 # Mole fraction of O2\n",
+ "x4 = .841 # Mole fraction of N2\n",
+ "Wcv = 1 # Power developed by the engine in kW\n",
+ "print \"\\n Example 6.13\\n\"\n",
+ "# By carbon balance \n",
+ "b = 55.9 \n",
+ "# By hydrogen balace\n",
+ "c=9\n",
+ "# By oxygen balance\n",
+ "a = 12.58\n",
+ "Qcv = Wcv- 3845872*(.57/(3600*114.22))\n",
+ "E = 5407843.0 # Chemical exergy of C8H18\n",
+ "nII = Wcv/(E*.57/(3600*114.22))\n",
+ "print \"\\n The rate of heat transfer from the engine = \",Qcv ,\" kW,\\n The second law of efficiency of the engine = \",nII*100 ,\" percent\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter17_JAzeWmK.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter17_JAzeWmK.ipynb
new file mode 100644
index 00000000..145463d3
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter17_JAzeWmK.ipynb
@@ -0,0 +1,323 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 17:Compressible Fluid Flow"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex17.2:pg-717"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 17.2 \n",
+ "\n",
+ "\n",
+ " Mass flow rate of air through diffuser is 59.4200292233 Kg/s\n",
+ "\n",
+ " Mach number of leaving air is 0.135\n",
+ "\n",
+ " Temperature of leaving air is 71.4290750078 degree celcius\n",
+ "\n",
+ " Pressure of leaving air is 0.260471799082 MPa \n",
+ "\n",
+ " Net thrust is 51.3284455434 kN\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "P1 = 0.18 # Diffuser static pressure in MPa\n",
+ "R = 0.287 # Gas constant\n",
+ "T1 = 37 # Static temperature \n",
+ "P0 = 0.1# Atmospheric pressure in MPa\n",
+ "A1 = 0.11 # intake area in m**2\n",
+ "V1 = 267 # Inlet velocity in m/s\n",
+ "w = (P1*1e3/(R*(T1+273)))*A1*V1 # mass flow rate\n",
+ "g = 1.4 # Heat capacity ratio\n",
+ "c1 = math.sqrt(g*R*(T1+273)*1000) # velocity\n",
+ "M1 = V1/c1 # Mach number\n",
+ "A1A_ = 1.0570 # A1/A* A* = A_\n",
+ "P1P01 = 0.68207 # pressure ratio\n",
+ "T1T01 = 0.89644# Temperature ratio\n",
+ "F1F_ = 1.0284# Impulse function ratio\n",
+ "A2A1 = 0.44/0.11 # Area ratio\n",
+ "A2A_ = A2A1*A1A_# Area ratio\n",
+ "M2 = 0.135 # Mach number\n",
+ "P2P02 = 0.987 # Pressure ratio\n",
+ "T2T02 = 0.996 # Temperature ratio\n",
+ "F2F_ = 3.46# Impulse function ratio\n",
+ "P2P1 = P2P02/P1P01 # Pressure ratio\n",
+ "T2T1 = T2T02/T1T01# Temperature ratio\n",
+ "F2F1 = F2F_/F1F_ # Impulse function ratio\n",
+ "P2 = P2P1*P1 # Outlet pressure\n",
+ "T2 = T2T1*(T1+273) # Outlet temperature\n",
+ "A2 = A2A1*A1 # Exit area\n",
+ "F1 = P1*A1*(1+g*M1**2) # Impulse function\n",
+ "F2 = F2F1*F1 # Impulse function\n",
+ "Tint = F2-F1 # Internal thrust\n",
+ "Text = P0*(A2-A1) # External thrust\n",
+ "NT = Tint - Text # Net thrust\n",
+ "\n",
+ "print \"\\n Example 17.2 \\n\"\n",
+ "print \"\\n Mass flow rate of air through diffuser is \",w ,\" Kg/s\"\n",
+ "print \"\\n Mach number of leaving air is \",M2\n",
+ "print \"\\n Temperature of leaving air is \",T2-273 ,\" degree celcius\"\n",
+ "print \"\\n Pressure of leaving air is \",P2 ,\" MPa \"\n",
+ "print \"\\n Net thrust is \",NT*1e3 ,\" kN\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex17.3:pg-718"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 17.3\n",
+ "\n",
+ "\n",
+ " When divergent section act as a nozzle\n",
+ "\n",
+ " Maximum flow rate of air is 1.06476372092 kg/s\n",
+ "\n",
+ " Static temperature is 183.204 K\n",
+ "\n",
+ " Static Pressure is 93.9 kPa\n",
+ "\n",
+ " Velocity at the exit from the nozzle is 596.077184351 m/s\n",
+ "\n",
+ "\n",
+ " When divergent section act as a diffuser\n",
+ "\n",
+ " Maximum flow rate of air is 1.06476372092 kg/s\n",
+ "\n",
+ " Static temperature is 353.232 K\n",
+ "\n",
+ " Static Pressure is 936.0 kPa\n",
+ "\n",
+ " Velocity at the exit from the nozzle is 116.03411731 m/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "M2 = 2.197 # Mach number\n",
+ "P2P0 = 0.0939 # pressure ratio\n",
+ "T2T0 = 0.5089 # Temperature ratio\n",
+ "P0 = 1 # Stagnation pressure in MPa \n",
+ "T0 = 360 # Stagnation temperature in K\n",
+ "g = 1.4 # Heat capacity ratio\n",
+ "R = 0.287 # Gas constant\n",
+ "P2 = P2P0*P0*1e3 # Static Pressure\n",
+ "T2 = T2T0*T0 # Static temperature\n",
+ "c2 = math.sqrt(g*R*T2*1000)\n",
+ "V2 = c2*M2 #velocity at the exit from the nozzle\n",
+ "# for air\n",
+ "P_P0 = 0.528 # pressure ratio\n",
+ "T_T0 = 0.833 # Temperature ratio\n",
+ "P_ = P_P0*P0*1e3 # Static Pressure\n",
+ "T_ = T_T0*T0 #Static temperature\n",
+ "rho_ = P_/(R*T_) # density\n",
+ "V_ = math.sqrt(g*R*T_*1000) # Velocity at the exit from the nozzle \n",
+ "At = 500e-06 # throat area\n",
+ "w = At*V_*rho_# Maximum flow rate of air\n",
+ "\n",
+ "print \"\\n Example 17.3\\n\"\n",
+ "print \"\\n When divergent section act as a nozzle\"\n",
+ "print \"\\n Maximum flow rate of air is \",w ,\" kg/s\"\n",
+ "print \"\\n Static temperature is \",T2 ,\" K\"\n",
+ "print \"\\n Static Pressure is \",P2 ,\" kPa\"\n",
+ "print \"\\n Velocity at the exit from the nozzle is \",V2 ,\" m/s\"\n",
+ "#The answers vary due to round off error\n",
+ "\n",
+ "# Part (b)\n",
+ "Mb = 0.308 # Mach number\n",
+ "P2P0b = 0.936 # Pressure ratio\n",
+ "T2T0b = 0.9812 # Temperature ratio\n",
+ "P2b = P2P0b*P0*1e3#Static Pressure \n",
+ "T2b = T2T0b*T0 # Static temperature\n",
+ "c2b = math.sqrt(g*R*T2b*1000) # Velocity \n",
+ "V2b = c2b*Mb #Velocity at the exit from the nozzle\n",
+ "print \"\\n\\n When divergent section act as a diffuser\"\n",
+ "print \"\\n Maximum flow rate of air is \",w ,\" kg/s\"\n",
+ "print \"\\n Static temperature is \",T2b ,\" K\"\n",
+ "print \"\\n Static Pressure is \",P2b ,\" kPa\"\n",
+ "print \"\\n Velocity at the exit from the nozzle is \",V2b ,\" m/s\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex17.4:pg-720"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 17.4\n",
+ "\n",
+ "\n",
+ " Mach number of the tunnel is 1.735\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "Px = 16.0 # pressure in kPa\n",
+ "Poy = 70.0 #pressure in kPa \n",
+ "Mx = 1.735 # Mach number\n",
+ "Pyx = 3.34 # Pressure ratio\n",
+ "rho_yx = 2.25 # Density ratio\n",
+ "Tyx = 1.483 # Temperature ratio\n",
+ "Poyox = 0.84 # pressure ratio\n",
+ "My = 0.631 # Mach number\n",
+ "g = 1.4 # Ratio of heat capacities\n",
+ "Tox = 573.0 # stagnation temperature in K \n",
+ "Toy = Tox # temperature equivalence\n",
+ "Tx = Tox/(1+((g-1)/2.0)*Mx**2) # temperature at x\n",
+ "Ty = Tyx*Tx # temperature at y\n",
+ "Pox = Poy/Poyox # total pressure \n",
+ "# From table\n",
+ "Mx = 1.735\n",
+ "\n",
+ "print \"\\n Example 17.4\\n\"\n",
+ "print \"\\n Mach number of the tunnel is \",Mx\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex17.5:pg-721"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 17.5\n",
+ "\n",
+ "\n",
+ " Exit Mach number is 0.402\n",
+ "\n",
+ " Exit pressure is 147.9260475 kPa\n",
+ "\n",
+ " Exit Stagnation pressure is 44.7195 kPa\n",
+ "\n",
+ " Entropy increase is 0.068726024552 kJ/kg K\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "Ax = 18.75 # cross sectional area in divergent part in m**2\n",
+ "A_ = 12.50 # throat area in m**2\n",
+ "AA_ = 1.5 # Area ratio\n",
+ "Pxox = 0.159 # pressure ratio from table\n",
+ "R = 0.287 # Gas constant\n",
+ "Pox = 0.21e03 # pressure in kPa\n",
+ "Px = Pxox*Pox # pressure calculation\n",
+ "# from the gas table on normal shock\n",
+ "Mx = 1.86 \n",
+ "My = 0.604 \n",
+ "Pyx = 3.87 \n",
+ "Poyx = 4.95 \n",
+ "Poyox = 0.786\n",
+ "Py = Pyx*Px\n",
+ "Poy = Poyx*Px\n",
+ "My = 0.604\n",
+ "Ay_ = 1.183\n",
+ "A2 = 25 \n",
+ "Ay = 18.75\n",
+ "A2_ = (A2/Ay)*Ay_\n",
+ "# From isentropic table \n",
+ "M2 = 0.402\n",
+ "P2oy = 0.895\n",
+ "P2 = P2oy*Poy\n",
+ "syx = -R*math.log(Poy/Pox) # sy-sx\n",
+ "\n",
+ "print \"\\n Example 17.5\\n\"\n",
+ "print \"\\n Exit Mach number is \",M2\n",
+ "print \"\\n Exit pressure is \",P2 ,\" kPa\"\n",
+ "print \"\\n Exit Stagnation pressure is \",Pox-Poy ,\" kPa\"\n",
+ "print \"\\n Entropy increase is \",syx ,\" kJ/kg K\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter18_7Yy7cvJ.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter18_7Yy7cvJ.ipynb
new file mode 100644
index 00000000..3c4fe6ba
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter18_7Yy7cvJ.ipynb
@@ -0,0 +1,706 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 18:Elements of Heat Transfer"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex18.1:pg-757"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 18.1\n",
+ "\n",
+ "\n",
+ " The rate of heat removal is 486.40484238 W\n",
+ "\n",
+ " Temperature at inside surface of brick is 20.2812224957 degree celcius\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "ho = 12.0 # Outside convective heat transfer coefficient in W/m**2K \n",
+ "x1 = 0.23# Thickness of brick in m\n",
+ "k1 = 0.98 # Thermal conductivity of brick in W/mK\n",
+ "x2 = 0.08 # Thickness of foam in m\n",
+ "k2 = 0.02# Thermal conductivity of foam in W/mK\n",
+ "x3 = 1.5# Thickness of wood in cm\n",
+ "k3 = 0.17# Thermal conductivity of wood in W/cmK\n",
+ "hi = 29.0# Inside convective heat transfer coefficient in W/m**2K \n",
+ "A = 90.0 # Total wall area in m**2\n",
+ "to = 22.0# outside air temperature in degree Celsius\n",
+ "ti = -2.0 # Inside air temperature in degree Celsius\n",
+ "print \"\\n Example 18.1\\n\"\n",
+ "U = (1/((1/ho)+(x1/k1)+(x2/k2)+(x3*1e-2/k3)+(1/hi)))# Overall heat transfer coefficient\n",
+ "Q = U*A*(to-ti) # Rate of heat transfer\n",
+ "R = (1/ho)+(x1/k1)\n",
+ "t2 = to-Q*R/A # Temperature at inside surface of brick\n",
+ "\n",
+ "print \"\\n The rate of heat removal is \",Q ,\" W\"\n",
+ "\n",
+ "print \"\\n Temperature at inside surface of brick is \",t2 ,\" degree celcius\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex18.2:pg-758"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 18.2\n",
+ "\n",
+ "\n",
+ " Heat transfer rate is 2.33519645654 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "r1 = 5.0 # Inner radius of steel pipe in cm\n",
+ "r2 = 10.0 # Extreme radius of inner insulation in cm\n",
+ "r3 = 13.0# Extreme radius of outer insulation in cm\n",
+ "K1 = 0.23 # Thermal conductivity of inner insulation in W/mK\n",
+ "K2 = 0.37 # Thermal conductivity of outer insulation in W/mK\n",
+ "hi = 58.0 # Inner heat transfer coefficient in W/m**2K\n",
+ "h0 = 12.0 # Inner heat transfer coefficient in W/m**2K\n",
+ "ti = 60.0 # Inner temperature in degree Celsius\n",
+ "to = 25.0 # Outer temperature in degree Celsius\n",
+ "L = 50.0 # Length of pipe in m\n",
+ "\n",
+ "print \"\\n Example 18.2\\n\"\n",
+ "Q =((2*math.pi*L*(ti-to))/((1/(hi*r1*1e-2))+(math.log(r2/r1)/(K1))+(math.log(r3/r2)/(K2))+(1/(h0*r3*1e-2))))\n",
+ "# Rate of heat transfer\n",
+ "print \"\\n Heat transfer rate is \",Q/1e3 ,\" kW\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex18.3:pg-759"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 18.3\n",
+ "\n",
+ "\n",
+ " Thermal conductivity of rod A is 57.4969670417 W/mK\n",
+ "\n",
+ " Thermal conductivity of rod B is 86.076212035 W/mK\n",
+ "\n",
+ " Thermal conductivity of rod C is 116.0 W/mK\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "to = 20 # Environment temperature in degree Celsius\n",
+ "t = 100# Temperature of steam path in degree Celsius\n",
+ "ta1 = 26.76 # Temperature at other end in degree Celsius for rod A \n",
+ "d = 10 # diameter of rod in mm\n",
+ "L = 0.25 # length of rod in m\n",
+ "h = 23 # heat transfer coefficient in W/m**2 K\n",
+ "tb1 = 32.00 # Temperature at other end in degree Celsius for rod B \n",
+ "tc1 = 36.93 # Temperature at other end in degree Celsius for rod C \n",
+ "\n",
+ "print \"\\n Example 18.3\\n\"\n",
+ "A = math.pi/4 * (d*1e-3)**2 #Area of rod\n",
+ "p = math.pi*d*1e-3 # perimeter of rod\n",
+ "# For rod A\n",
+ "a = (ta1-to)/(t-to) \n",
+ "ma = (math.acosh(1/a))/L\n",
+ "\n",
+ "Ka = (h*p)/(ma**2*A) # Thermal conductivity of rod A\n",
+ "print \"\\n Thermal conductivity of rod A is \",Ka ,\" W/mK\"\n",
+ "# For rod B\n",
+ "b = (tb1-to)/(t-to) \n",
+ "mb = (math.acosh(1/b))/L\n",
+ "\n",
+ "Kb = (h*p)/(mb**2*A) # Thermal conductivity of rod B\n",
+ "print \"\\n Thermal conductivity of rod B is \",Kb ,\" W/mK\"\n",
+ "c = (tc1-to)/(t-to) \n",
+ "mc = (math.acosh(1/c))/L\n",
+ "\n",
+ "Kc = (h*p)/(mc**2*A) # Thermal conductivity of rod A\n",
+ "print \"\\n Thermal conductivity of rod C is \",math. ceil(Kc) ,\" W/mK\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex18.4:pg-760"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 18.4\n",
+ "\n",
+ "\n",
+ " Midway temperature of rod is 88.7138777413 degree Celcius\n",
+ "\n",
+ " Heat loss rate is 88.0331604603 W\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "h = 17.4 # Convective heat transfer coefficient in W/m**2K\n",
+ "K = 52.2 # Thermal conductivity in W/mK\n",
+ "t = 120 # Heat reservoir wall temperature in degree celcius\n",
+ "t0 = 35 # Ambient temperature in degree celcius\n",
+ "L = 0.4 # Lenght of rod in m\n",
+ "b = .050 # width of rod in mm\n",
+ "H = .050 # Heigth of rod in mm\n",
+ "\n",
+ "print \"\\n Example 18.4\\n\"\n",
+ "l= L/2\n",
+ "A = b*H\n",
+ "m = math.sqrt(4*h*b/(K*b*H))\n",
+ "t1 = (t-t0)/math.cosh(m*l) + t0 # Midway temperature of rod\n",
+ "Q1 = 2*5.12*K*A*(t-t0)*math.tanh(m*l) # Heat loss rate \n",
+ "print \"\\n Midway temperature of rod is \",t1 ,\" degree Celcius\"\n",
+ "print \"\\n Heat loss rate is \",Q1 ,\"W\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex18.5:pg-760"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 18.5\n",
+ "\n",
+ "\n",
+ " Time to cool down to 2 degree celcius is 30.5933342864 min\n",
+ "\n",
+ " Temperature of peas after 10 minutes is 13.1714792663 degree celcius\n",
+ "\n",
+ " Temperature of peas after 30 minutes is 1.0393274697 degree celcius\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "d = 8.0 # Average diameter in mm\n",
+ "r = 750.0 # Density in Kg/m**3\n",
+ "t = 2.0 # Intermediate temperature in degree celcius\n",
+ "t_inf = 1.0 # Ambient temperature in degree celcius\n",
+ "t0 = 25.0 # Initial temperature in degree celcius\n",
+ "c = 3.35 # Specific heat in kJ/KgK\n",
+ "h = 5.8 # Heat transfer coeeficient in W/m**2K\n",
+ "T1 = 10.0 # time period in minutes\n",
+ "T2 = 30.0 # time period in minutes \n",
+ "t1 = 5.0 # Intermediate temperature in degree celcius\n",
+ "print \"\\n Example 18.5\\n\"\n",
+ "tau1 = c*1e3*math.log((t0-t_inf)/(t-t_inf))/(h*60) # Time to cool down to 2 degree celcius\n",
+ "tau2 = (t0-t_inf)*(math.exp(-(c*T1*60)/(c*1e3))) # Temperature of peas after 10 minutes\n",
+ "Y = math.exp(-1*(c*T2*60)/(c*1e3))\n",
+ "tau3 = (t0*Y-t1)/(Y-1)\n",
+ "\n",
+ "print \"\\n Time to cool down to 2 degree celcius is \",tau1 ,\" min\"\n",
+ "print \"\\n Temperature of peas after 10 minutes is \",tau2 ,\" degree celcius\"\n",
+ "print \"\\n Temperature of peas after 30 minutes is \",tau3 ,\" degree celcius\"\n",
+ "#The answers given in book are incorrect\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex18.6:pg-761"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 18.6\n",
+ "\n",
+ "\n",
+ " Surface area of heat exchanger is 53.1155468795 m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "mh = 1000 # mass flow rate of hot fluid in Kg/h\n",
+ "mc = 1000 # mass flow rate of cold fluid in Kg/h\n",
+ "ch = 2.09 # Specific heat capacity of hot fluid in kJ/kgK\n",
+ "cc = 4.187 #Specific heat capacity of cold fluid in kJ/kgK \n",
+ "th1 = 80# Inlet temperature of hot fluid in degree celcius\n",
+ "th2 = 40 # Exit temperature of hot fluid in degree Celsius\n",
+ "tc1 = 30 # Inlet temperature of cold fluid in degree Celsius\n",
+ "U = 24 # heat transfer coefficient in W/m**2K\n",
+ "\n",
+ "print \"\\n Example 18.6\\n\"\n",
+ "Q = mh*ch*(th1-th2)\n",
+ "tc2 = Q/(mc*cc) + tc1# outlet temperature of cold fluid\n",
+ "te = th2-tc1 # Exit end temperature difference in degree Celsius\n",
+ "ti = th1 - tc2 # Inlet end temperature difference in degree Celsius\n",
+ "t_lm = (ti-te)/(math.log(ti/te))\n",
+ "A = Q / (U*t_lm*3.6) # Surface are of heat exchanger\n",
+ "\n",
+ "print \"\\n Surface area of heat exchanger is \",A ,\" m**2\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex18.7:pg-762"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 18.7\n",
+ "\n",
+ "\n",
+ " Surface area of heat exchanger is 3.52948841744 m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "Hfg = 2257.0 # Latent heat at 100 degree Celsius\n",
+ "\n",
+ "ma = 500.0 # mass flow rate of air in Kg/h\n",
+ "ch = 1.005 # Specific heat capacity of hot air in kJ/kgK\n",
+ "ta1 = 260.0 # Inlet temperature of hot air in degree Celsius\n",
+ "ta2 = 150.0 # Inlet temperature of cold air in degree Celsius\n",
+ "tc1 = 100.0 # Inlet temperature of steam\n",
+ "tc2 = tc1 # Exit temperature of steam\n",
+ "U = 46.0 # heat transfer coefficient in W/m**2K\n",
+ "\n",
+ "print \"\\n Example 18.7\\n\"\n",
+ "Q = ma*ch*(ta1-ta2)\n",
+ "m = Q/Hfg # mass flow rate of steam\n",
+ "te = ta2-tc1 # Exit end temperature difference in degree Celsius\n",
+ "ti = ta1 - tc2 # Inlet end temperature difference in degree Celsius\n",
+ "t_lm = (ti-te)/(math.log(ti/te))\n",
+ "A = Q / (U*t_lm*3.6) # Surface are of heat exchanger\n",
+ "\n",
+ "print \"\\n Surface area of heat exchanger is \",A ,\" m**2\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex18.8:pg-763"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 18.8\n",
+ "\n",
+ "\n",
+ " Exit temperature of oil is 90.1251029717 degree celcius\n",
+ "\n",
+ " Rate of heat transfer is 1302.7384927 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "mh = 20.15 # mass flow rate of hot fluid in Kg/s\n",
+ "mc = 5.04 # mass flow rate of cold fluid in Kg/h\n",
+ "ch = 2.094 # Specific heat capacity of hot fluid in kJ/kgK\n",
+ "cc = 4.2 #Specific heat capacity of cold fluid in kJ/kgK \n",
+ "th1 = 121# Inlet temperature of hot fluid in degree Celsius\n",
+ "th2 = 40 # Exit temperature of hot fluid in degree Celsius\n",
+ "tc1 = 10 # Inlet temperature of cold fluid in degree Celsius\n",
+ "U = 0.34 # heat transfer coefficient in kW/m**2K\n",
+ "n = 200 # total number of tubes\n",
+ "l = 4.87 # length of tube in m\n",
+ "d = 1.97 # Outer diameter in cm\n",
+ "print \"\\n Example 18.8\\n\"\n",
+ "A = math.pi*n*d*1e-2*l # Total surface area\n",
+ "mc_oil = mh*ch\n",
+ "mc_water = mc*cc\n",
+ "c_min = mc_water\n",
+ "c_max =mc_oil\n",
+ " \n",
+ "if (mc_oil<mc_water):\n",
+ " c_min = mc_oil\n",
+ " c_max =mc_water\n",
+ "\n",
+ "R = c_min/c_max\n",
+ "NTU = U*A/c_min\n",
+ "e = (1-math.exp(-1*NTU*(1-R)))/(1-R*math.exp(-1*NTU*(1-R)))\n",
+ "t_larger = e*(th1-tc1)\n",
+ "t_water = t_larger \n",
+ "t_oil = t_water*mc_water/mc_oil\n",
+ "th2 = th1 - t_oil # Exit temperature of oil\n",
+ "Q = mh*ch*(th1-th2) # Rate of heat transfer\n",
+ "\n",
+ "print \"\\n Exit temperature of oil is \",th2 ,\" degree celcius\"\n",
+ "print \"\\n Rate of heat transfer is \",Q ,\" kW\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex18.9:pg-763"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 18.9\n",
+ "\n",
+ "\n",
+ " Heat transfer coefficient is 4074.68413756 W/m**2K\n",
+ "\n",
+ " Rate of heat transfer is 38.4029932568 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "u_m = 0.8 # mean velocity in m/s\n",
+ "D = 5 # Diameter in cm\n",
+ "v = 4.78e-7 # dynamic coefficient of viscosity\n",
+ "Pr = 2.98 # Prantl number\n",
+ "K = 0.66 # Thermal conductivity in W/mK\n",
+ "l = 3 # length of pipe in m\n",
+ "tw = 70 # Wall temperature\n",
+ "tf = 50 # mean water temperature\n",
+ "print \"\\n Example 18.9\\n\"\n",
+ "Re = u_m*D*1e-2/v # Reynold number\n",
+ "Nu = 0.023*(Re**0.8)*(Pr**0.4)\n",
+ "h = K*Nu/(D*1e-2) # Heat transfer coefficient\n",
+ "A = math.pi*D*1e-2*l # Surface area\n",
+ "Q = h*A*(tw-tf) # Rate of heat transfer\n",
+ "print \"\\n Heat transfer coefficient is \",h ,\" W/m**2K\"\n",
+ "print \"\\n Rate of heat transfer is \",Q/1e3 ,\" kW\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex18.10:pg-764"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 18.10\n",
+ "\n",
+ "\n",
+ " Rate of heat dissipation is 31.392 W\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "b = 10 # width of plate in cm\n",
+ "h = 15 # Height of plate in cm\n",
+ "hr = 8.72 # Radiative heat transfer coefficient in W/m**2K\n",
+ "tw = 140 # temperature of wall in degree Celsius\n",
+ "tf = 20 # Atmospheric temperature in degree Celsius\n",
+ "v = 2.109e-5 # Coefficient of dynamic viscosity in m**2/s\n",
+ "Pr = 0.692 # Prantl number\n",
+ "K = 0.0305 # Thermal conductivity in W/mK\n",
+ "L = 0.15 # characteristic length in m\n",
+ "g = 9.81 # Gravitational acceleration in m/s**2\n",
+ "\n",
+ "print \"\\n Example 18.10\\n\"\n",
+ "A = 2*b*1e-2*h*1e-2 # total area of plate\n",
+ "t_mean = (tw+tf)/2 +273\n",
+ "B = 1/t_mean\n",
+ "del_t = tw-tf\n",
+ "Gr = g*B*del_t*L**3/v**2 # Grashoff number\n",
+ "x = Gr*Pr\n",
+ "Nu = 0.59*(Gr*Pr)**0.25\n",
+ "hc = Nu*K/L\n",
+ "Q = (hc+hr)*A*del_t # Rate of heat dissipation\n",
+ "print \"\\n Rate of heat dissipation is \",Q ,\" W\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex18.11:pg-765"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 18.11\n",
+ "\n",
+ "\n",
+ " Time required for heating operation is 27.6219838873 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "d1 = 2.0 # Diameter of steel rod in cm\n",
+ "d2 = 16.0 # Diameter of cylindrical furnace in cm\n",
+ "e1 = 0.6 # emissivity of inner surface\n",
+ "e2 = 0.85 # emissivity of rod surface\n",
+ "T = 1093.0 # Inner surface temperature of furncae in degree celcius\n",
+ "Tr1 = 427.0 # Initial temperature of rod in degree celcius\n",
+ "Tr2 = 538.0 # Initial temperature of rod in degree celcius\n",
+ "sigma = 5.67e-8 # Constant\n",
+ "rho = 7845.0 # density in kg/ m**3\n",
+ "c = 0.67 # Specific heat capacity in kJ/kgK\n",
+ "print \"\\n Example 18.11\\n\"\n",
+ "A_ratio = d1/d2 # Surface area ratio of cylindrical bodies\n",
+ "F12 = (1/((1/e1)+(A_ratio*(1/e2 -1))))\n",
+ "A1 = math.pi*d1*1e-2*1 # Surface area of rod\n",
+ "T1 = Tr1+273\n",
+ "T2 = T +273\n",
+ "T3 = Tr2 +273\n",
+ "Qi = sigma*A1*F12*(T1**4-T2**4)\n",
+ "Qe = sigma*A1*F12*(T3**4-T2**4)\n",
+ "\n",
+ "Q_avg = abs((Qi+Qe)/2)\n",
+ "tau = rho*c*(1e-4)*math.pi*(Tr2-Tr1)/(Q_avg*(1e-3))\n",
+ "\n",
+ "# Time required for heating operation \n",
+ "print \"\\n Time required for heating operation is \",tau ,\" s\"\n",
+ "\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex18.12:pg-765"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 18.12\n",
+ "\n",
+ "\n",
+ " Net heat transfer between two cylinders is 7297.2729358 W/m length\n",
+ "\n",
+ " Example 18.12\n",
+ "\n",
+ "\n",
+ " Net heat transfer between two cylinders is 7297.2729358 W/m length\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "d1 = 10.0 # Diameter of inner cylinder in cm\n",
+ "d2 = 20.0 # Diameter of outer cylinder in cm\n",
+ "e1 = 0.65 # emissivity of inner surface\n",
+ "e2 = 0.4 # emissivity of outer surface\n",
+ "T1 = 1000.0 # Inner surface temperature in K\n",
+ "T2 = 500.0 # outer suface temperature in K\n",
+ "sigma = 5.67e-8 # Constant\n",
+ "print \"\\n Example 18.12\\n\"\n",
+ "A1 = math.pi*d1*1e-2\n",
+ "A2 = math.pi*d2*1e-2\n",
+ "R =(((1-e1)/(e1*A1))+((1-e2)/(e2*A2))+(1/(A1*1)))\n",
+ "Eb1 = sigma*T1**4\n",
+ "Eb2 = sigma*T2**4\n",
+ "Q = (Eb1-Eb2)/R # Net heat transfer between two cylinders\n",
+ "print \"\\n Net heat transfer between two cylinders is \",Q ,\" W/m length\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n",
+ "d1 = 10.0 # Diameter of inner cylinder in cm\n",
+ "d2 = 20.0 # Diameter of outer cylinder in cm\n",
+ "e1 = 0.65 # emissivity of inner surface\n",
+ "e2 = 0.4 # emissivity of outer surface\n",
+ "T1 = 1000.0 # Inner surface temperature in K\n",
+ "T2 = 500.0 # outer surface temperature in K\n",
+ "sigma = 5.67e-8 # Constant\n",
+ "print \"\\n Example 18.12\\n\"\n",
+ "A1 = math.pi*d1*1e-2\n",
+ "A2 = math.pi*d2*1e-2\n",
+ "R =(((1-e1)/(e1*A1))+((1-e2)/(e2*A2))+(1/(A1*1)))\n",
+ "Eb1 = sigma*T1**4\n",
+ "Eb2 = sigma*T2**4\n",
+ "Q = (Eb1-Eb2)/R # Net heat transfer between two cylinders\n",
+ "print \"\\n Net heat transfer between two cylinders is \",Q ,\" W/m length\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter19_GQTZX04.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter19_GQTZX04.ipynb
new file mode 100644
index 00000000..1f8e6f43
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter19_GQTZX04.ipynb
@@ -0,0 +1,1372 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 19: Gas Compressors"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.1:pg-818"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.1\n",
+ "\n",
+ "\n",
+ " Pressure ratio is 8.4764775804\n",
+ "\n",
+ " Indicated power is 11.2490101513 kW\n",
+ "\n",
+ " Shaft power is 14.0612626891 kW\n",
+ "\n",
+ " Mass flow rate is 0.0723071537289 kg/s\n",
+ "\n",
+ " Pressure ratio when second stage is added is 71.8506721711\n",
+ "\n",
+ " Volume derived per cycle is V2 0.000327741753347 m**3\n",
+ "\n",
+ " Second stage bore would be 52.7442736748 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T2 = 488.0\n",
+ "T1 = 298.0 \n",
+ "n = 1.3 \n",
+ "R =8314.0/44.0\n",
+ "rp = (T2/T1)**(n/(n-1))\n",
+ "\n",
+ "b = 0.12 # Bore of compressor\n",
+ "L = 0.15 # Stroke of compressor\n",
+ "V1 = (math.pi/4)*(b)**2*L \n",
+ "P1 = 120e03 # in kPa\n",
+ "W = ((n*P1*V1)/(n-1))*(((rp)**((n-1)/n))-1)\n",
+ "P = (W*1200*0.001)/60 \n",
+ "\n",
+ "V1_dot = V1*(1200.0/60.0)\n",
+ "m_dot = (P1*V1_dot)/(R*T1)\n",
+ "\n",
+ "rp_1 = rp**2\n",
+ "V2 = (1/rp)**(1/n)*V1\n",
+ "d = math.sqrt((V2*4)/(L*math.pi))\n",
+ "print \"\\n Example 19.1\\n\"\n",
+ "print \"\\n Pressure ratio is \",rp\n",
+ "print \"\\n Indicated power is \",P ,\" kW\"\n",
+ "print \"\\n Shaft power is \",P/0.8 ,\" kW\"\n",
+ "print \"\\n Mass flow rate is \",m_dot ,\" kg/s\"\n",
+ "print \"\\n Pressure ratio when second stage is added is \",rp_1\n",
+ "print \"\\n Volume derived per cycle is V2 \",V2 ,\" m**3\"\n",
+ "print \"\\n Second stage bore would be \",d*1000 ,\" mm\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.2:pg-819"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.2 \n",
+ " \n",
+ "\n",
+ " Volumetric efficiency of system is 73.7793963433 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "c = 0.05 # Clearance volume\n",
+ "p1 = 96.0 # Inlet ressure in bar\n",
+ "p2 = 725.0 # Outlet pressure in bar\n",
+ "pa = 101.3 # Atmospheric pressure\n",
+ "Ta = 292.0 # Atmospheric temperature in kelvin\n",
+ "T1 = 305.0 # Inlet temperature in Kelvin\n",
+ "n = 1.3 # polytropic index\n",
+ "print \"\\n Example 19.2 \\n \"\n",
+ "n_v = (1+c-c*((p2/p1)**(1/n)))*(p1/pa)*(Ta/T1)\n",
+ "print \"\\n Volumetric efficiency of system is \",n_v*100 ,\" percent\"\n",
+ "# Answer is not mentioned in book\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.3:pg-819"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.3\n",
+ "\n",
+ "\n",
+ " Indicated poer is 5.47565638255 kW\n",
+ "\n",
+ " Volumetric efficiency is 78.6098417845 percent\n",
+ "\n",
+ " Mass flow rate is 1.54145895718 kg/min\n",
+ "\n",
+ " Free air delivery is 1.25775746855 m**3/min\n",
+ "\n",
+ " Isothermal efficiency is 80.6428056306 percent\n",
+ "\n",
+ " Input power is 6.44194868535 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "P1 = 101.3e03 \n",
+ "P4 = P1 # in Pa\n",
+ "P2 = 8*P1 \n",
+ "P3 = P2\n",
+ "T1 = 288 \n",
+ "Vs = 2000\n",
+ "V3 = 100 \n",
+ "Vc = V3\n",
+ "V1 = Vs + Vc \n",
+ "n = 1.25 \n",
+ "R = 287\n",
+ "V4 = ((P3/P4)**(1/n))*V3\n",
+ "W = ((n*P1*(V1-V4)*1e-06)/(n-1))*(((P2/P1)**((n-1)/n))-1)\n",
+ "P = (W*800*0.001)/60 \n",
+ "\n",
+ "m = (P1*(V1-V4)*1e-06)/(R*T1)\n",
+ "m_dot = m*800\n",
+ "\n",
+ "FAD = (V1-V4)*1e-06*800\n",
+ "\n",
+ "Wt = P1*(V1-V4)*1e-06*math.log(P2/P1)\n",
+ "n_isothermal = (Wt*800*0.001)/(P*60)\n",
+ "\n",
+ "Pi = P/0.85\n",
+ "n_v =100*(V1-V4)/Vs\n",
+ "print \"\\n Example 19.3\\n\"\n",
+ "print \"\\n Indicated poer is \",P ,\" kW\"\n",
+ "print \"\\n Volumetric efficiency is \",n_v ,\" percent\"\n",
+ "print \"\\n Mass flow rate is \",m_dot ,\" kg/min\"\n",
+ "print \"\\n Free air delivery is \",FAD ,\" m**3/min\"\n",
+ "print \"\\n Isothermal efficiency is \",100*n_isothermal ,\" percent\"\n",
+ "print \"\\n Input power is \",Pi ,\" kW\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.4:pg-819"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.4\n",
+ "\n",
+ "\n",
+ " Power input is 9.55276123312 kW, \n",
+ " Volumetric efficiency is 55.4657309635 percent, \n",
+ " Bore of the cylinder is 0.184932327621 m, \n",
+ " Stroke of the cylinder is 0.277398491431 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "m = 3.0 # Mass flow rate in kg/min\n",
+ "p1 = 1.0 # Initial pressure in bar\n",
+ "T1 = 300.0 # Initial temperature in K\n",
+ "p3 = 6.0 # Pressure after compression in bar\n",
+ "p5 = 15.0 # Maximum pressure in bar\n",
+ "N = 300.0 # Rpm of compressure\n",
+ "n = 1.3 # Index of compression and expansion \n",
+ "r = 1.5 # Stroke to bore ratio\n",
+ "R = 287.0 # Gas constant of air\n",
+ "t = 15.0 # Temperature in degree centigrade\n",
+ "print \"\\n Example 19.4\\n\"\n",
+ "T = t+273\n",
+ "Wc = (n/(n-1))*(m/60)*(R*(1e-3)*T1)*(((p3/p1)**((n-1)/n))-1)\n",
+ "r1 = (p5/p1)**(1.0/n)# Where r1 = V1/Vc\n",
+ "r2 = r1-1 # Where r2 = Vs/Vc\n",
+ "r3 = (p3/p1)**(1.0/n)\n",
+ "n_vol = (r1-r3)*(T/T1)/r2\n",
+ "V = m*R*T/(2*(1e5)*N)\n",
+ "Vs = V/n_vol\n",
+ "d = (Vs*4/(math.pi*r))**(1.0/3.0)\n",
+ "l = r*d\n",
+ "print \"\\n Power input is \",Wc ,\" kW, \\n Volumetric efficiency is \",n_vol*100 ,\" percent, \\n Bore of the cylinder is \",d ,\" m, \\n Stroke of the cylinder is \",l ,\" m\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.5:pg-820"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.5\n",
+ "\n",
+ "\n",
+ " Power required to drive the unit is 17.7326053799 kW,\n",
+ " Isothermal efficiency is 65.8690064051 percent,\n",
+ " Mechanical efficiency is 98.5144743328 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "d = 15.0 # Diameter in cm\n",
+ "l = 18.0 # Stroke in cm\n",
+ "C = 0.04 # Ratio of clearance volume and sweft volume\n",
+ "p1 = 1.0 # Pressure in bar\n",
+ "t1 = 25.0 # Temperature in degree centigrade\n",
+ "p2 = 8.0# Pressure in bar\n",
+ "N = 1200.0 # Rpm of compressure \n",
+ "W = 18.0 # Actual power input in kW\n",
+ "m = 4.0 # Mass flow rate in kg/min\n",
+ "R = 0.287\n",
+ "print \"\\n Example 19.5\\n\"\n",
+ "T1 = t1+273\n",
+ "v = R*T1/(p1*100)\n",
+ "V = m*v\n",
+ "Vs = (math.pi/4)*((d*(1e-2))**2)*(l*1e-2)*N\n",
+ "n_vol = V/Vs\n",
+ "n = (math.log(p2/p1))/(math.log((1+C-n_vol)/C))\n",
+ "# The value of n given in the example is wrong\n",
+ "n = 1.573\n",
+ "T2 = T1*(p2/p1)**((n-1)/n)\n",
+ "Wc = (n/(n-1))*(m*R/60)*(T2-T1)\n",
+ "n_mech = Wc/W\n",
+ "W_isothermal = m*R*T1*math.log(p2/p1)/60\n",
+ "n_iso = W_isothermal/W\n",
+ "print \"\\n Power required to drive the unit is \",Wc ,\" kW,\\n Isothermal efficiency is \",n_iso*100 ,\" percent,\\n Mechanical efficiency is \",n_mech*100 ,\" percent\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.6:pg-820"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.6\n",
+ "\n",
+ "\n",
+ " Power required to drive the compressure is 181.333212391 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "d = 40.0 # Diameter in cm\n",
+ "l = 50.0 # Stroke in cm\n",
+ "D = 5.0 # Piston rod diameter in cm\n",
+ "C = 0.04 # Ratio of clearance volume and sweft volume\n",
+ "p1 = 1.0 # Pressure in bar\n",
+ "t1 = 15.0 # Temperature in degree centigrade\n",
+ "p2 = 7.5# Pressure in bar\n",
+ "N = 300.0 # Rpm of compressure \n",
+ "n_vol = 0.8 # Volumetric efficiency\n",
+ "n_mech = 0.95 # Mechanical efficiency\n",
+ "n_iso = .7 # Isothermal efficiency\n",
+ "R = 0.287\n",
+ "print \"\\n Example 19.6\\n\"\n",
+ "Vs = (math.pi/4)*((d*(1e-2))**2)*(l*(1e-2))\n",
+ "Vs_ = (math.pi/4)*(((d*(1e-2))**2)-(D*(1e-2))**2)*(l*1e-2)\n",
+ "Vs_min = (Vs+Vs_)*2*N\n",
+ "V1 = Vs_min*n_vol\n",
+ "W_iso = p1*V1*(math.log(p2/p1))\n",
+ "Win = W_iso/n_iso\n",
+ "Wc = Win/n_mech\n",
+ "print \"\\n Power required to drive the compressure is \",Wc ,\" kW\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.7:pg-820"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.7\n",
+ "\n",
+ "\n",
+ " Minimum work done is 215.324046 kJ/kg,\n",
+ " Heat rejected to intercooler is 87.0010719231 kJ/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "p1 = 1.0 # Pressure in bar\n",
+ "t1 = 27.0 # Temperature in degree centigrade\n",
+ "n = 1.3 # Index of the compression process\n",
+ "p3 = 9.0# Pressure in bar\n",
+ "R = 0.287\n",
+ "print \"\\n Example 19.7\\n\"\n",
+ "T1 = t1+273\n",
+ "p2 = math.sqrt(p1*p3)\n",
+ "Wc = ((2*n*R*T1)/(n-1))*(((p2/p1)**((n-1)/n))-1)\n",
+ "T2 = T1*((p2/p1)**((n-1)/n))\n",
+ "H = 1.005*(T2-T1)\n",
+ "print \"\\n Minimum work done is \",Wc ,\" kJ/kg,\\n Heat rejected to intercooler is \",H ,\" kJ/kg\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.8:pg-820"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.8\n",
+ "\n",
+ "\n",
+ " Minimum power required by the compressure is 49.3370051888 kW,\n",
+ " Bore of the compressure in low pressure side is 26.5961520268 cm,\n",
+ " Bore of the compressure in high pressure side is 8.92172168806 cm,\n",
+ " Stroke of the compressure is 36.0 cm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "V = 4.0 # Volume flow rate in m**3/min\n",
+ "p1 = 1.013 # Pressure in bar\n",
+ "t1 = 15.0 # Temperature in degree centigrade\n",
+ "N = 250.0 # Speed in RPM\n",
+ "p4 = 80.0# Delivery pressure in bar\n",
+ "v = 3.0 #Speed of piston in m/sec\n",
+ "n_mech = .75 # Mechanical efficiency \n",
+ "n_vol = .8 # Volumetric efficiency\n",
+ "n = 1.25 # Polytropic index\n",
+ "print \"\\n Example 19.8\\n\"\n",
+ "T1 = t1+273\n",
+ "p2 = math.sqrt(p1*p4)\n",
+ "W = (2*n/(n-1))*(p1*100/n_mech)*(V/60)*((p2/p1)**((n-1)/n) - 1)\n",
+ "L = v*60/(N*2)\n",
+ "Vs = V/N\n",
+ "D_LP = math.sqrt(Vs*V/(math.pi*L*n_vol))\n",
+ "D_HP = D_LP*math.sqrt(p1/p2)\n",
+ "print \"\\n Minimum power required by the compressure is \",W ,\" kW,\\n Bore of the compressure in low pressure side is \",D_LP*100 ,\" cm,\\n Bore of the compressure in high pressure side is \",D_HP*100 ,\" cm,\\n Stroke of the compressure is \",L*100 ,\" cm\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.9:pg-820"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.9\n",
+ "\n",
+ "\n",
+ " Compressor work = 107.662023 kJ/kg,\n",
+ " Total heat transfer to the surrounding = 125.119949539 kJ/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "p1 = 1.0 # Pressure in bar\n",
+ "T1 = 300.0 # Temperature in K\n",
+ "p4 = 9.0# Compressed pressure in bar\n",
+ "n = 1.3 # Polytropic index\n",
+ "R = 0.287 # Gas constant in kJ/kgK\n",
+ "cp = 1.042 # Heat capapcity in kJ/kgK\n",
+ "print \"\\n Example 19.9\\n\"\n",
+ "p2 = math.sqrt(p1*p4)\n",
+ "T2 =T1*((p2/p1)**((n-1)/n))\n",
+ "Wc = (2*n/(n-1))*R*1*(T2-T1)\n",
+ "Wc_ = Wc/2\n",
+ "Q = 1*cp*(T2-T1)\n",
+ "Q_ = cp*(T1-T2)+Wc_\n",
+ "H = Q+2*Q_\n",
+ "print \"\\n Compressor work = \",Wc_ ,\" kJ/kg,\\n Total heat transfer to the surrounding = \",H ,\" kJ/kg\"\n",
+ "#The answers given in the book contain calculation error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.10:pg-820"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.10\n",
+ "\n",
+ "\n",
+ " Diameter of cylinder = 18.484702902 24.5391705107 cm, \n",
+ " Storke of the cylinder = 24.5391705107 cm,\n",
+ " Isothermal efficiency = 83.4955018622 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "N = 300.0 # Speed in RPM\n",
+ "# Intake condition of compressor\n",
+ "p1 = 0.98 # Pressure in bar\n",
+ "T1 = 305.0 # Temperature in K\n",
+ "\n",
+ "p6 = 20.0# Delivery pressure in bar\n",
+ "p3 = 5.0 # Intermediate pressure in bar\n",
+ "C = .04 # Ratio of clearance volume to the stroke volume\n",
+ "v = 3.0 # Volume flow rate of compressure in m**3/min\n",
+ "p = 1.0 # pressure in bar\n",
+ "t = 25.0 # Temperautre in degree centigrade\n",
+ "n = 1.3 # Polytropic index\n",
+ "R = 0.287 # Gas constant in kJ/kgK\n",
+ "print \"\\n Example 19.10\\n\"\n",
+ "T = t+273\n",
+ "r0 = 1+C # Where r0 = v1/vs\n",
+ "r1 = C*(p3/p1)**(1/n)# Where r1 = v4/vs\n",
+ "r2=r0-r1#Where r2 is the ratio of volume of air taken at 0.98 bar,305 k and vs\n",
+ "r3 = r2*(T/T1)*p1/p # Where r3 is the ratio of volume of air taken at free air conditions and vs\n",
+ "n_vol = r3\n",
+ "m = p*(1e5)*(v/60)/(R*1000*T)\n",
+ "T2 = T1*((p3/p1)**((n-1)/n))\n",
+ "# For perfect intercooling\n",
+ "T5 = T1\n",
+ "p5 = p3\n",
+ "T6 = T5*((p6/p5)**((n-1)/n))\n",
+ "Wc = (n/(n-1))*m*R*((T2-T1)+(T6-T5))\n",
+ "m_a_s = m*60/N\n",
+ "v_fa_s = m_a_s *(R*1000)*T/(p*1e5)\n",
+ "d = ((v_fa_s/n_vol)*(4/math.pi))**(1.0/3.0)\n",
+ "l = d # As given in the question\n",
+ "P_iso = m*R*T1*(math.log(p6/p1))\n",
+ "n_iso = P_iso/Wc\n",
+ "print \"\\n Diameter of cylinder = \",Wc,d*100 ,\" cm, \\n Storke of the cylinder = \",l*100 ,\" cm,\\n Isothermal efficiency = \",n_iso*100 ,\" percent\"\n",
+ "#The answers given in the book contain calculation error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.11:pg-820"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.11\n",
+ "\n",
+ "\n",
+ " No of stages for min power input = 1.0 ,\n",
+ " Power required = 476.74544125 kW/kg air,\n",
+ " The power required for a single stage compressor = 476.74544125 kW,\n",
+ " Maximum temperature in any stage = 681.338601917 K\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "p1 = 1 # Intake pressure of compressor in bar\n",
+ "T1 = 298 # Intake temperature in K\n",
+ "p_d = 36 # Delivery pressure in bar\n",
+ "T2 = 390 # Maximum temperature in any stage in K\n",
+ "n = 1.3 # Polytropic index\n",
+ "R = 0.287\n",
+ "print \"\\n Example 19.11\\n\"\n",
+ "r = (T2/T1)**(n/(n-1))\n",
+ "N = math. ceil(r)\n",
+ "p2 = (p_d/p1)**(1/N)\n",
+ "p3 = (p_d/p1)**(2/N)\n",
+ "p4 = (p_d/p1)**(3/N)\n",
+ "Wc = (N*n*R*T1/(n-1))*((p_d/p1)**((n-1)/(N*n))-1)\n",
+ "Wc_ = (n/(n-1))*(1*R*T1)*((p_d/p1)**((n-1)/n)- 1)\n",
+ "T = T1*((p2/p1)**((n-1)/n))\n",
+ "print \"\\n No of stages for min power input = \",N ,\",\\n Power required = \",Wc ,\" kW/kg air,\\n The power required for a single stage compressor = \",Wc_ ,\" kW,\\n Maximum temperature in any stage = \",T ,\" K\"\n",
+ "#The answers given in the book contain round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.12:pg-820"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.12\n",
+ "\n",
+ "\n",
+ " Indicated output = 132.877965499 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "p1 = 700.0 # Intake pressure of compressor in kPa\n",
+ "t1 = 38.0 # Intake temperature in degree centigrade\n",
+ "c = 0.4 # Ratio of cutoff volume to stroke volume\n",
+ "p3 = 112.0 # Back pressure in kPa\n",
+ "r = 0.85 # Ratio of area of actual indicator diagram to the outlined in the question\n",
+ "n = 1.3 # Polytropic index\n",
+ "R = 0.287\n",
+ "m = 1.25 # Air mass in kg\n",
+ "print \"\\n Example 19.12\\n\"\n",
+ "T1 = t1+273\n",
+ "T2 = T1/((1/c)**(n-1))\n",
+ "p2 = p1*(c**n)\n",
+ "V2 = m*R*T2/p2\n",
+ "v2 = V2/m\n",
+ "A = R*T1 + R*(T1-T2)/(n-1) - p3*v2\n",
+ "Io = A*r*m\n",
+ "print \"\\n Indicated output = \",Io ,\" kJ\"\n",
+ "# The answer given in the book vary due to round off error\n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.13:pg-820"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.13\n",
+ "\n",
+ "\n",
+ " The intermediate pressure are - \n",
+ " p2 = 2.46621207433 bar,\n",
+ " p3 = 6.08220199557 bar,\n",
+ " The effective sweft volume = 0.0477129384264 m**3,\n",
+ " Temperature of air delivered per stroke at 15 bar = 85.3946742162 degree centigrade,\n",
+ " The work done per kg of air = 254.077921795 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "d = 450.0 # Bore of low pressure cylinder in mm\n",
+ "l = 300.0 # Stroke in mm\n",
+ "c = 0.05 # Ratio of clearance volume to sweft volume\n",
+ "p1 = 1.0 # Intake pressure in bar\n",
+ "t1 = 18.0 # Intake temperature in degree centigrade\n",
+ "p4 = 15.0 # Delivery pressure in bar\n",
+ "n = 1.3 # Compression and expansion index\n",
+ "R = 0.29 # Gas constant in kJ/kgK\n",
+ "print \"\\n Example 19.13\\n\"\n",
+ "T1 = t1+273\n",
+ "r = (p4/p1)**(1.0/3.0)\n",
+ "p2 = p1*r\n",
+ "p3 = p2*r\n",
+ "Vs = (math.pi/4)*((d*1e-3)**2)*(l*1e-3)\n",
+ "V11 = c*Vs\n",
+ "V1 = Vs +V11\n",
+ "V12 = V11*((r)**(1.0/n))\n",
+ "Vs_e = V1 - V12\n",
+ "T3 = T1\n",
+ "T5 = T3\n",
+ "T6 = T1*(r**((n-1)/n))\n",
+ "t6 = T6-273\n",
+ "V6_7 = (p1/p4)*(T6/T1)*(V1 - V12)\n",
+ "W = (3*n*R*T1/(n-1))*((p2/p1)**((n-1)/n)-1)\n",
+ "print \"\\n The intermediate pressure are - \\n p2 = \",p2 ,\" bar,\\n p3 = \",p3 ,\" bar,\\n The effective sweft volume = \",Vs ,\" m**3,\\n Temperature of air delivered per stroke at 15 bar = \",t6 ,\" degree centigrade,\\n The work done per kg of air = \",W ,\" kJ\"\n",
+ "# The answers given in the book vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.14:pg-820"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.14\n",
+ "\n",
+ "\n",
+ " Work input = 1.5195 kJ/rev,\n",
+ " Work input for a vane-type compressor = 1.34802979062 kJ/rev\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "p1 = 1.013 # Inlet pressure in bar\n",
+ "r = 1.5 # Pressure ratio\n",
+ "Vs = 0.03 # Induce volume of air in m**3/rev\n",
+ "gama = 1.4 \n",
+ "print \"\\n Example 19.14\\n\"\n",
+ "p2 = p1*r\n",
+ "W = (p2-p1)*Vs*100\n",
+ "pi = (p1+p2)/2\n",
+ "A_A = (gama/(gama-1))*(p1*Vs)*((pi/p1)**((gama-1)/gama)-1)*100\n",
+ "Vb = Vs *((p1/pi)**(1/gama))\n",
+ "A_B = (p2-pi)*Vb*100\n",
+ "Wr = A_A + A_B\n",
+ "print \"\\n Work input = \",W ,\" kJ/rev,\\n Work input for a vane-type compressor = \",Wr ,\" kJ/rev\"\n",
+ "# The answers given in the book vary due to round off error\n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.15:pg-820"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.15\n",
+ "\n",
+ "\n",
+ " Power required to drive the blower = 99.47 kW,\n",
+ " Power required = 77.9220893777 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "m = 1.0 # Mass flow rate in kg/s\n",
+ "r = 2.0 # Prssure ratio of blower \n",
+ "t1 = 70.0 # Inlet temperature in degree centigrade\n",
+ "p1 = 1.0 # Inlet pressure in bar\n",
+ "R = 0.29 # Gas constant in kJ/kgK\n",
+ "x = 0.7 # Reduction in pressure ratio and intake volume \n",
+ "gama = 1.4\n",
+ "print \"\\n Example 19.15\\n\"\n",
+ "T1 = t1+273\n",
+ "V = m*R*T1/(p1*100)\n",
+ "P = V*(p1*r-p1)*100\n",
+ "p2 = p1*((1/x)**(gama))\n",
+ "V2 = x*V\n",
+ "P_ = (gama/(gama-1))*(p1*100*V)*((p2/p1)**((gama-1)/gama)-1) + V2*(p1*r-p2)*100\n",
+ "\n",
+ "print \"\\n Power required to drive the blower = \",P ,\" kW,\\n Power required = \",P_ ,\" kW\"\n",
+ "# The answers given in the book vary due to round off error\n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.16:pg-820"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.16\n",
+ "\n",
+ "\n",
+ " Actual temperature at the end of first stage = 382.63704941 K,\n",
+ " Actual temperature at the end of second stage = 425.041961043 K,\n",
+ " The total compressor power = 965.01085424 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "r1 = 2.5 # Pressure ratio of compressor for first stage\n",
+ "r2 = 2.1 # Pressure ratio of compressor for second stage\n",
+ "m = 5.0 # Mass flow rate of air in kg/s \n",
+ "t1 = 10.0 # Inlet temperature in degree centigrade\n",
+ "p1 = 1.013 # Inlet pressure in bar\n",
+ "td = 50.0 # Temperature drop in intercooler in degree centigreade\n",
+ "n_iso = .85 # Isentropic efficiency\n",
+ "cp = 1.005 # Heat capacity of air in kJ/kgK\n",
+ "x = 0.7 # Reduction in pressure ratio and intake volume \n",
+ "gama = 1.4 # Ratio of heat capacities for air\n",
+ "print \"\\n Example 19.16\\n\"\n",
+ "T1 = t1+273\n",
+ "T2s = T1*((r1)**((gama-1)/gama))\n",
+ "T2 = T1 + (T2s-T1)/n_iso\n",
+ "T3 = T2 - td\n",
+ "T4s = T3*((r2)**((gama-1)/gama))\n",
+ "T4 = T3 + (T4s-T3)/n_iso\n",
+ "P = m*cp*((T2-T1)+(T4-T3))\n",
+ "print \"\\n Actual temperature at the end of first stage = \",T2 ,\" K,\\n Actual temperature at the end of second stage = \",T4 ,\" K,\\n The total compressor power = \",P ,\" kW\"\n",
+ "# The answers given in the book vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.17:pg-821"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.17\n",
+ "\n",
+ "\n",
+ " Power required to drive the compressor = 54.6039650117 kW,\n",
+ " Stagnatio temperature = 109.18614963 degree centigrade,\n",
+ " Stagnation pressure = 160.465577551 kPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "r = 2.5 # Static pressure ratio of supercharger \n",
+ "p1 = 0.6 # Static inlet pressure in bar\n",
+ "t1 = 5 # Static inlet temperature in degree centigrade\n",
+ "A_r = 13.0 # Air-fuel ratio\n",
+ "m = 0.04 # The rate of fuel consumed by the engine in kg/s\n",
+ "gama= 1.39 # For air-fuel mixture \n",
+ "cp = 1.005 # Heat capacity for air-fuel mixture in kJ/kgk\n",
+ "n_iso = .84 # Isentropic efficiency of compressor \n",
+ "v = 120.0 # Exit velocity from the compressor in m/s\n",
+ "print \"\\n Example 19.17\\n\"\n",
+ "T1 = t1+273\n",
+ "T2s = T1*((r)**((gama-1)/gama))\n",
+ "T2 = T1 +(T2s-T1)/n_iso\n",
+ "m_g = m*(A_r+1)\n",
+ "P = m_g*cp*(T2-T1)\n",
+ "T02 = T2 + (v**2)/(2*cp*1000)\n",
+ "t02 = T02-273\n",
+ "p02 = p1*r*((T02/T2)**(gama/(gama-1)))*100\n",
+ "print \"\\n Power required to drive the compressor = \",P ,\" kW,\\n Stagnatio temperature = \",t02 ,\" degree centigrade,\\n Stagnation pressure = \",p02 ,\" kPa\"\n",
+ "# The answers given in the book vary due to round off error\n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.18:pg-821"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.18\n",
+ "\n",
+ "\n",
+ " The temperature of air at outlet = 233.053979565 degree centigrade,\n",
+ " Power input = 300.644961473 kW,\n",
+ " Diameter of impeller = 0.916122726914 m, \n",
+ " Blade inlet angle = 0.245135262084 degree,\n",
+ " Diffuser inlet angle = 0.138096713577 degree \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "N = 10000 # Speed in RPM\n",
+ "V = 1.2 # Volume flow rate of free air in m**3/s\n",
+ "p1 = 1.0 # Inlet pressure in bar\n",
+ "t1 = 27.0 # Inlet temperature in degree centigrade\n",
+ "r = 5.0 # Pressure ratio\n",
+ "vf = 60.0 # Velocity flow rate in m/s\n",
+ "sigma = 0.9 # Slip factor\n",
+ "n_iso = 0.85 # Isentropic efficiency\n",
+ "gama = 1.4\n",
+ "R = 0.287\n",
+ "cp = 1.005\n",
+ "print \"\\n Example 19.18\\n\"\n",
+ "T1 = t1+273\n",
+ "T2s = T1*((r)**((gama-1)/gama))\n",
+ "T2 = T1 +(T2s-T1)/n_iso\n",
+ "m = p1*100*V/(R*288)\n",
+ "Wc = m*cp*(T2-T1)\n",
+ "Vb2 = (Wc*1000/(m*sigma))**(1.0/2.0)\n",
+ "D = Vb2*60/(math.pi*N)\n",
+ "Vb1 = Vb2/2\n",
+ "beta1 = math.atan(vf/Vb1)\n",
+ "alpha = math.atan(vf/(sigma*Vb2))\n",
+ "print \"\\n The temperature of air at outlet = \",T2-273 ,\" degree centigrade,\\n Power input = \",Wc ,\" kW,\\n Diameter of impeller = \",D ,\" m, \\n Blade inlet angle = \",beta1 ,\" degree,\\n Diffuser inlet angle = \",alpha ,\" degree \"\n",
+ "# The answers given in the book vary due to round off error\n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.19:pg-821"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " \n",
+ " Example 19.19\n",
+ "\n",
+ "\n",
+ " Total head pressure ratio = 1.00344817308 , \n",
+ " The required power at input shaft = 3.37798367776 kW,\n",
+ " Inlet angle at the root = 0.0 degree and 29.8821913183 minute,\n",
+ " Inlet angle at the tip = 0.0 degree and 49.6377044903 minute\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "N = 264 # Speed in RPS\n",
+ "sigma = 0.91 # Slip factor\n",
+ "d = 0.482 # Impeller diameter in m\n",
+ "D = 0.306 # Impeller eye diameter\n",
+ "D_ = 0.153 # Impeller root eye diameter in m\n",
+ "vf = 138 # Uniform axial inlet velocity in m/s\n",
+ "V = 1.2 # Volume flow rate of free air in m**3/s\n",
+ "m = 9.1 # Air mass flow rate in kg/s\n",
+ "T1 = 294 # Inlet air stagnation temperature in K\n",
+ "n_iso = 0.8 # Total head isentropic efficiency\n",
+ "n_mech = 0.98 # Mechanical efficiency\n",
+ "gama = 1.4 # Ratio of heat capacities\n",
+ "cp = 1.006 # Heat capacity in kJ/kgK\n",
+ "print \"\\n Example 19.19\\n\"\n",
+ "Wc = m*sigma*(2*math.pi*d*N/2)/1000\n",
+ "P_e = Wc/n_mech\n",
+ "delta_T = Wc/(m*cp)\n",
+ "delta_T_ideal = delta_T*n_iso\n",
+ "T2_i = delta_T_ideal + T1\n",
+ "r = (T2_i/T1)**(gama/(gama-1)) # Where r = p02/p01\n",
+ "Vb = 2*math.pi*N*D/2\n",
+ "V_er = (2*math.pi*N*D_/2)\n",
+ "beta1 = math.atan(vf/Vb)\n",
+ "beta2 = math.atan(vf/V_er)\n",
+ "beta1_ = (beta1 - math.floor(beta1))*60\n",
+ "beta2_ = (beta2 - math.floor(beta2))*60\n",
+ "print \"\\n Total head pressure ratio = \",r ,\", \\n The required power at input shaft = \",P_e ,\" kW,\\n Inlet angle at the root = \",math.floor(beta1) ,\" degree and \",beta1_ ,\" minute,\\n Inlet angle at the tip = \",math.floor(beta2) ,\" degree and \",beta2_ ,\" minute\"\n",
+ "# The answers given in the book for total head pressure ratio and required power at input shaft contain calculation error\n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.20:pg-821"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.20\n",
+ "\n",
+ "\n",
+ " Impeller tip diameter = 548.821948011 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "N = 16000.0 # Speed in RPM\n",
+ "t1 = 17.0 # Intake temperture of gas in degree centigrade\n",
+ "rp = 4.0 # Pressure ratio\n",
+ "sigma = 0.85# Slip factor\n",
+ "n_iso = 0.82 # Isentropic efficiency\n",
+ "alpha_wirl = 20.0 # Pre-wirl angle in degree\n",
+ "d1 = 200.0 # Mean diameter of impeller eye in mm\n",
+ "V1 = 120.0 #Absolute air velocity in m/s\n",
+ "gama = 1.4 # Ratio of heat capacities\n",
+ "cp = 1.005 # Heat capacity in kJ/kgK\n",
+ "print \"\\n Example 19.20\\n\"\n",
+ "T1 = t1 + 273\n",
+ "T2s = T1*((rp)**((gama-1)/gama))\n",
+ "delta_Ts = T2s-1\n",
+ "delta_T = delta_Ts/n_iso\n",
+ "Wc = 1 *cp*delta_T\n",
+ "Vb1 = (math.pi*d1*(1e-3)*N)/60\n",
+ "Vw1 = V1*math.sin(alpha_wirl)\n",
+ "Vb2 = 459.78 # By solving quadratic equation 172.81e3=0.85*Vb2**2-167.55*41.05\n",
+ "d2 = Vb2*60/(math.pi*N)\n",
+ "\n",
+ "print \"\\n Impeller tip diameter = \",d2*1000 ,\" mm\"\n",
+ "# The answer given in the book varies due to round off error\n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.21:pg-821"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 41,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.21\n",
+ "\n",
+ "\n",
+ " The delivery pressure = 6.07125291521 bar,\n",
+ " The no of stages = 9.0 ,\n",
+ " The internal efficiency = 0.84689822539 \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "m = 2.5 # Mass flow rate in kg/s\n",
+ "p1 = 1.0 # Inlet pressure in bar\n",
+ "T1 = 300.0 # Inlet temperature in bar\n",
+ "n_s = 0.88 # Stage efficiency\n",
+ "Wc = 600.0 # Power input in kW\n",
+ "delta_t = 21.0 # Temperature rise in first stage in degree centigrade\n",
+ "gama = 1.4 # Ratio of heat capacities \n",
+ "cp = 1.005 # Heat capacity in kJ/kgK\n",
+ "print \"\\n Example 19.21\\n\"\n",
+ "x = n_s*gama/(gama-1)# Where x = (n/(n-1))\n",
+ "T = Wc/(m*cp)+T1\n",
+ "p = p1*((T/T1)**(x))\n",
+ "T2 = T1 + n_s*delta_t\n",
+ "r = ((T2/T1)**(gama/(gama-1)))# Where r = p2/p1\n",
+ "N = math.log(p/p1)/math.log(r)\n",
+ "N_ = math. ceil(N)\n",
+ "Ts = T1*(p/p1)**((gama-1)/gama)\n",
+ "n_inter = (Ts-T1)/(T-T1)\n",
+ "print \"\\n The delivery pressure = \",p ,\" bar,\\n The no of stages = \",N_ ,\",\\n The internal efficiency = \",n_inter ,\" \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.22:pg-821"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 42,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.22\n",
+ "\n",
+ "\n",
+ " Fluid deflection angle = 0.206163966177 degree,\n",
+ " Power input = 41.8928434516 kJ/kg,\n",
+ " The degree of reaction = 66.0453433333 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "D = 0.5 # Mean diameter of impeller in m\n",
+ "N = 15000.0 # Speed in RPM\n",
+ "Vf = 230.0 # Velocity of flow in m/s\n",
+ "p1 = 1.0 # Inlet pressure in bar\n",
+ "T1 = 300.0 # Inlet temperature in K\n",
+ "Vw1 = 80.0 # Velocity of whirl at inlet in m/s\n",
+ "n_s = 0.88 # Stage efficiency\n",
+ "rp = 1.5 # Pressure ratio\n",
+ "gama = 1.4 \n",
+ "cp = 1.0005\n",
+ "print \"\\n Example 19.22\\n\"\n",
+ "Vb = (math.pi*D*N/60)\n",
+ "Ts = T1*((rp)**((gama-1)/gama))\n",
+ "T = T1 + (Ts-T1)/n_s\n",
+ "Wc = cp*(T-T1)\n",
+ "Vw2 = Vw1 + (Wc*1000)/(Vb)\n",
+ "beta1 = math.atan(Vf/(Vb-Vw1))\n",
+ "beta2 = math.atan(Vf/(Vb-Vw2))\n",
+ "theta = beta2-beta1\n",
+ "R = 1-((Vw1+Vw2)/(2*Vb))\n",
+ "\n",
+ "print \"\\n Fluid deflection angle = \",theta ,\" degree,\\n Power input = \",Wc ,\" kJ/kg,\\n The degree of reaction = \",R*100 ,\" percent\"\n",
+ "# The answers given in the book vary because of round off error\n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.23:pg-821"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 43,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.23\n",
+ "\n",
+ "\n",
+ " Blade angle at the tip = 1.02107077046 degree,\n",
+ " Blade angle at the hub = 2.71029118833 degree\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "v = 5.0 #olume flow rate in m**3/s\n",
+ "d = 1.0 #ean impeller diameter in m\n",
+ "D = 0.6 # Hub diameter in m\n",
+ "N = 600.0 #otational speed in RPM\n",
+ "h = 35.0 #heoratical head in mm\n",
+ "rho = 1.2 # Density of air in kg/m**3\n",
+ "rho_w = 1000.0 #ensity of water in kg/m**3\n",
+ "print \"\\n Example 19.23\\n\"\n",
+ "Vf = v*4/(math.pi*(d**2 - D**2))\n",
+ "Vb = (math.pi*d*N/60)\n",
+ "Vb_ = (math.pi*D*N/60)\n",
+ "H = h/rho\n",
+ "Vw2 = H*9.81/(Vb)\n",
+ "Vw2_ = H*9.81/(Vb_)\n",
+ "beta_tip = (Vf/(Vb_-Vw2))\n",
+ "beta_hub = (Vf/(Vb_-Vw2_))\n",
+ "print \"\\n Blade angle at the tip = \",beta_tip ,\" degree,\\n Blade angle at the hub = \",beta_hub ,\" degree\"\n",
+ "# The answers given in the book vary because of round off error\n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex19.24:pg-821"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 19.24\n",
+ "\n",
+ "\n",
+ " Speed of impeller = 6456.85894335 RPM,\n",
+ " Impeller width at inlet = -73.5259022616 cm,\n",
+ " Impeller width at outlet = 1.87680083777 cm,\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "N0 = 9000.0 # Rotational speed in RPM\n",
+ "Q = 6.0 # Volume flow rate in m**3/s\n",
+ "p1 = 1.0 # Initial pressure in bar\n",
+ "t1 = 25.0 # Initial temperature in degree centigrade\n",
+ "p2 = 2.2 # Compressed pressure in bar\n",
+ "n = 1.33 # Compression index\n",
+ "Vf = 75.0 # Velocity of flow in m/s\n",
+ "beta1 = 30.0 # Blade angle at inlet in degree\n",
+ "beta2 = 55.0 # Blade angle at outlet in degree\n",
+ "d = 0.75 # Diameter of impeller in m\n",
+ "cp = 1.005 \n",
+ "print \"\\n Example 19.24\\n\"\n",
+ "T1 = t1+273\n",
+ "T2 = T1*(p2/p1)**((n-1)/n)\n",
+ "Wc = cp*(T2-T1)\n",
+ "x = Wc # Where x = Vw2*Vb2\n",
+ "y = Vf/math.tan(beta2)# Where y = Vb2-Vw2(Equation 1)\n",
+ "z = (y**2 +4*x*1000)**(0.5) # Where z = Vw2+Vb2(Equation 2)\n",
+ "# By solving Equation 1 and Equation 2\n",
+ "Vb2 = (y+z)/2\n",
+ "Vw2 = ((z-y)/2)\n",
+ "N = Vb2*60/(math.pi*d)\n",
+ "Vb1 = Vf/math.tan(beta1)\n",
+ "D1 = Vb1*60/(math.pi*N)\n",
+ "b1 = Q/(math.pi*D1*Vf)\n",
+ "Q_ = Q* (1/p2)*(T2/T1)\n",
+ "b2 = Q_/(math.pi*d*Vf)\n",
+ "print \"\\n Speed of impeller = \",N ,\" RPM,\\n Impeller width at inlet = \",b1*100 ,\" cm,\\n Impeller width at outlet = \",b2*100 ,\" cm,\"\n",
+ "# The answers given in the book vary because of round off error\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter1_seG0iD4.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter1_seG0iD4.ipynb
new file mode 100644
index 00000000..40629382
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter1_seG0iD4.ipynb
@@ -0,0 +1,121 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 01:Introduction"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex1.1:pg-20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 1.1\n",
+ "\n",
+ "\n",
+ " Gas Pressure is 1.74 atm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given Data\n",
+ "d_r = 13640 # Density of mercury in kg/m^3\n",
+ "g = 9.79 # Acceleration due to gravity in m/s^2\n",
+ "z = 562e-03 # Difference in height in m\n",
+ "z0 = 761e-03 # Reading of barometer in m\n",
+ "P = (d_r*g*(z+z0))*(0.987/1e05) # Gas Pressure in atm\n",
+ "\n",
+ "print \"\\n Example 1.1\\n\"\n",
+ "print \"\\n Gas Pressure is \",round(P,2),\" atm\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex1.2:pg-21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 1.2\n",
+ "\n",
+ "\n",
+ " Inlet steam pressure is 1.5 MPa\n",
+ "\n",
+ " Condenser pressure is 8.27 kPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#Given Data\n",
+ "d_r = 13.6e03 # Density of mercury in kg/m^3\n",
+ "g = 9.81 # Acceleration due to gravity in m/s^2\n",
+ "z = 710e-03 # Steam flow pressure in m\n",
+ "z0 = 772e-03 # Reading of barometer in m\n",
+ "P = 1.4e06 # Gauge pressure of applied steam in Pa\n",
+ "P0 = d_r*g*z0 # Atmospheric pressure in Pa\n",
+ "Pi = P+P0 # Inlet steam pressure in Pa\n",
+ "Pc = d_r*g*(z0-z) # Condenser pressure in Pa\n",
+ "\n",
+ "print \"\\n Example 1.2\\n\"\n",
+ "print \"\\n Inlet steam pressure is\",round(Pi/1e6,2),\" MPa\"\n",
+ "print \"\\n Condenser pressure is\",round(Pc/1e3,2),\" kPa\"\n",
+ "#The answers vary due to round off error\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter20_7AIMdUg.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter20_7AIMdUg.ipynb
new file mode 100644
index 00000000..1d77e8e7
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter20_7AIMdUg.ipynb
@@ -0,0 +1,912 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 20:Internal Combustion Engines"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.2:pg-852"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.2\n",
+ "\n",
+ "\n",
+ " Diameter of cylinder = 6.20350490899 cm\n",
+ " Stroke of each cylinder = 9.30525736349 cm\n",
+ " Brake specific fuel consumption = 0.292207792208 kg/kWh\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "# Four cylinder engine\n",
+ "BP = 30.0 # Power developed by engine in kW\n",
+ "N = 2500.0 # Speed in rpm\n",
+ "P_m = 800.0 # Mean effective pressure for each cylinder in kN/m**2\n",
+ "n_m = 0.8 # Mechanical efficiency\n",
+ "r = 1.5 # Stroke to bore ratio\n",
+ "n_b = 0.28 # Brake thermal efficiency\n",
+ "c_v = 44.0 # Heating value of petrol in MJ/kg\n",
+ "print \"\\n Example 20.2\\n\"\n",
+ "IP = BP/n_m\n",
+ "d = ((IP*1000*60)/(P_m*1000*r*(math.pi/4)*N*4))**(1.0/3.0)\n",
+ "L = r*d\n",
+ "m_f = BP/(c_v*1000*n_b)\n",
+ "bsfc = m_f*3600/BP\n",
+ "print \"\\n Diameter of cylinder = \",d*10**2 ,\" cm\\n Stroke of each cylinder = \",L*100 ,\" cm\\n Brake specific fuel consumption = \",bsfc ,\" kg/kWh\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.1:pg-851"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.1\n",
+ "\n",
+ "\n",
+ " Fuel consumption of the engine = 6.73508593048 Kg/h\n",
+ " BMEP= 637.807536593 kN/m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "d = 6.5# Diametre in cm\n",
+ "L = 9.5 # Stroke in cm\n",
+ "T = 64.0 # Torque in Nm\n",
+ "N = 3000.0 # Speed in rpm\n",
+ "V_c = 63.0 # Clearance volume in cm**3\n",
+ "r = 0.5 # Brake efficiency ratio\n",
+ "c_v = 42.0 # Calorific value of gasoline in MJ/kg\n",
+ "print \"\\n Example 20.1\\n\"\n",
+ "V_s = (math.pi/4)*(d**2)*(L)\n",
+ "r_k = (V_s+V_c)/V_c\n",
+ "n_as = 1- (1.0/(r_k**(0.4)))\n",
+ "n_b = r*n_as\n",
+ "BP = (2*math.pi*T*N)/60000\n",
+ "m_f = (BP*3600)/(n_b*c_v*1000)# in kg/h\n",
+ "BMEP = BP*60*2/((math.pi/4)*4*(d**2)*L*N*10**(-6))\n",
+ "print \"\\n Fuel consumption of the engine = \",m_f ,\" Kg/h\\n BMEP=\",BMEP ,\" kN/m**2\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.3:pg-853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.3\n",
+ "\n",
+ "\n",
+ " Indicated power = 7.59218224618 kW\n",
+ " Indicate mean effective pressure = 386.666666667 kN/m**2\n",
+ " Fuel consumption per kWh on brake power output = 0.255681818182 Kg/kWh\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "F = 680.0 # Net brake load in N\n",
+ "N = 360.0 # \n",
+ "d = 10.0# Bore in cm\n",
+ "L = 15.0 # Stroke in cm\n",
+ "T = 58.0 # Torque in Nm\n",
+ "v = 300.0 # Speed in m/min\n",
+ "n_m = 0.8 # Mechanical efficiency\n",
+ "n_th = 0.4 # Indicated thermal efficiency\n",
+ "c_v = 44.0 # Calorific value of gasoline in MJ/kg\n",
+ "print \"\\n Example 20.3\\n\"\n",
+ "N = v/(2*L*(10**(-2)))\n",
+ "BP = (2*math.pi*T*N)/60000\n",
+ "IP = BP/n_m\n",
+ "p_m = (IP*60)/(L*(math.pi/4)*(d**2)*N*10**(-6))\n",
+ "m_f = (IP*3600)/(n_th*c_v*1000)\n",
+ "bsfc = m_f/BP\n",
+ "print \"\\n Indicated power = \",IP ,\" kW\\n Indicate mean effective pressure = \",p_m ,\" kN/m**2\\n Fuel consumption per kWh on brake power output = \",bsfc ,\" Kg/kWh\"\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.4:pg-853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.4\n",
+ "\n",
+ "\n",
+ " Indicated power = 18.080022801 kW\n",
+ " Brake power = 12.8176980266 kW\n",
+ "\n",
+ " Energy release by combustion of fuel is 68640.0 kJ \n",
+ " 1. Energy equivalent of ip is 21696.0273613 kJ ( 31.6084314704 percent)\n",
+ " 2. Energy carried away by cooling water is 16748.0 kJ ( 24.3997668998 percent),\n",
+ " 3. Energy carried away by exhaust gases is 19333.323828 kJ ( 28.1662643182 percent),\n",
+ " 4. Unaccounted energy loss (by difference) is 10862.6488107 kJ ( 15.8255373117 percent)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "T = 20.0 # Time in minute\n",
+ "F = 680.0 # Net brake load in N\n",
+ "N = 360.0 # Speed in rpm\n",
+ "mep = 3.0 # Mean effective pressure in bar\n",
+ "f = 1.56 # Fuel consumption in kg\n",
+ "m_w = 160.0 # Cooling water in kg\n",
+ "t = 57.0 # Water inlet temperature in degree centigrade\n",
+ "r = 30.0 # Air used per kg of fuel\n",
+ "t_r = 27.0 # Room temperature in degree centigrade\n",
+ "t_e = 310.0 # Exhaust gas temperature in degree centigrade\n",
+ "d = 210.0 # Bore in mm\n",
+ "L = 290.0 # Stroke in mm\n",
+ "D = 1.0 # Brake diameter in m\n",
+ "cv = 44.0 # Calorific value in MJ/kg\n",
+ "m_s = 1.3 # Steam formed per kg fuel in the exhaust in kg\n",
+ "s = 2.093 # Specific heat of steam in the exhaust in kJ/kgK\n",
+ "s_d = 1.01 # Specific heat of dry exhaust gases in kJ/kgK\n",
+ "print \"\\n Example 20.4\\n\"\n",
+ "i_p = mep*100*L*(10**-3)*(math.pi/4)*((d*(10**-3))**2)*N/60\n",
+ "b_p = (2*math.pi*(F*(D/2))*N)/60000\n",
+ "n_m = b_p / i_p\n",
+ "h = f*cv*1000\n",
+ "i_pe = i_p*T*60\n",
+ "e_w = m_w * 4.187*(t-32)\n",
+ "m_t = f*r + f\n",
+ "m_s_ = m_s*f\n",
+ "m_d = m_t - m_s_\n",
+ "e_d = m_d * s_d * (t_e-t_r)\n",
+ "e_s = m_s_*(4.187*(100-t_r) + 2257.9 +s*(t_e-100))\n",
+ "e_t = e_s + e_d\n",
+ "e_Un = h - (i_pe + e_w + e_t)\n",
+ "print \"\\n Indicated power = \",i_p ,\" kW\\n Brake power = \",b_p ,\" kW\"\n",
+ "print \"\\n Energy release by combustion of fuel is \",h ,\" kJ \\n 1. Energy equivalent of ip is \",i_pe ,\" kJ (\",(i_pe/h)*100 ,\" percent)\\n 2. Energy carried away by cooling water is \",e_w ,\" kJ (\",(e_w/h)*100 ,\" percent),\\n 3. Energy carried away by exhaust gases is \",e_t ,\" kJ (\",(e_t/h)*100 ,\" percent),\\n 4. Unaccounted energy loss (by difference) is \",e_Un ,\" kJ (\",(e_Un/h)*100 ,\" percent)\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.5:pg-853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.5\n",
+ "\n",
+ "\n",
+ " Indicated power = 15.1189146454 kW\n",
+ " Brake power = 11.178833859 kW\n",
+ " Mechanical efficiency = 73.9393939394 percent,\n",
+ " Indicated thermal efficiency = 29.1059319377 percent,\n",
+ " Brake thermal efficiency = 21.5207496751 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "F = 610.0 # Net brake load in N\n",
+ "N = 350.0 # Speed in rpm\n",
+ "d = 20.0 # Bore in cm\n",
+ "L = 30.0 # Stroke in cm\n",
+ "imep = 275.0 # Mean effective pressure in kN/m**2\n",
+ "D = 1.0 # Brake diameter in m\n",
+ "m_o = 4.25 # Oil consumption in kg/h\n",
+ "cv = 44.0 # Calorific value in MJ/kg\n",
+ "print \"\\n Example 20.5\\n\"\n",
+ "i_p = imep*1000*L*(10**-2)*(math.pi/4)*((d*(10**-2))**2)*N/60000\n",
+ "b_p = (2*math.pi*(F*(D/2))*N)/60000\n",
+ "n_m = b_p / i_p\n",
+ "n_th = i_p *3600/(m_o*cv*1000)\n",
+ "n_br = n_th*n_m\n",
+ "print \"\\n Indicated power = \",i_p ,\" kW\\n Brake power = \",b_p ,\" kW\\n Mechanical efficiency = \",n_m*100 ,\" percent,\\n Indicated thermal efficiency = \",n_th*100 ,\" percent,\\n Brake thermal efficiency = \",n_br*100 ,\" percent\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.6:pg-853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.6\n",
+ "\n",
+ "\n",
+ "Avg no of misfire = 3.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "no = 6.0 # No of cylinders\n",
+ "Vs = 1.75 # Stroke volume in litres\n",
+ "P = 26.25 # Power developed in kW\n",
+ "N = 506.0 # Speed in rpm\n",
+ "mep = 600.0 # Mean effectine pressure in kN/m**2\n",
+ "print \"\\n Example 20.6\\n\"\n",
+ "n = P*60000/(no*mep*1000*Vs*(10**-3))\n",
+ "n_e = N/2\n",
+ "n_m = n_e - n\n",
+ "print \"\\nAvg no of misfire = \",n_m\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.7:pg-853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.7\n",
+ "\n",
+ "\n",
+ "Saving in fuel = 1.81818181818 kg/h\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "Bp = 110 # Brake power in kW\n",
+ "n_m = 0.8 # Mechanical efficiency of the engine\n",
+ "m_f = 50 # Fuel required for engine in kg/h\n",
+ "r_f = 5 # Reduced engine friction in kW\n",
+ "print \"\\n Example 20.7\\n\"\n",
+ "Ip = Bp/n_m\n",
+ "Fp = Ip-Bp\n",
+ "Fp_n = Fp-r_f\n",
+ "Ip_new = Bp + Fp_n\n",
+ "m_f_new = Ip_new * m_f/ Ip\n",
+ "s_f = m_f- m_f_new\n",
+ "print \"\\nSaving in fuel = \",s_f ,\" kg/h\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.8:pg-853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.8\n",
+ "\n",
+ "\n",
+ " Mechanical efficiency = 82.6306913997 percent,\n",
+ " Relative efficiency on indicated power basis = 54.0966815927 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "Bp = 14.7 # Brake power when all cylinder operating in kW\n",
+ "Bp1 = 10.14 # Brake power with cylinder no. 1 cut out in kW\n",
+ "Bp2 = 10.3 # Brake power with cylinder no. 2 cut out in kW\n",
+ "Bp3 = 10.36 # Brake power with cylinder no. 3 cut out in kW\n",
+ "Bp4 = 10.21 # Brake power with cylinder no. 4 cut out in kW\n",
+ "m_f = 5.5 # Fuel consumption in kg/h\n",
+ "cv = 42 # Calorific value MJ/kg\n",
+ "d = 8 # Diameter of cylinder in cm\n",
+ "L = 10 # Stroke of cylinder in cm\n",
+ "Vc = 0.1 # Clearance volume in litre\n",
+ "print \"\\n Example 20.8\\n\"\n",
+ "Ip1 = Bp-Bp1\n",
+ "Ip2 = Bp-Bp2\n",
+ "Ip3 = Bp-Bp3\n",
+ "Ip4 = Bp-Bp4\n",
+ "Ip = Ip1+Ip2+Ip3+Ip4\n",
+ "n_m = Bp/Ip\n",
+ "Vs = (math.pi/4)*((d*(10**-2))**2)*(L*(10**-2))\n",
+ "r_k = (Vs+(Vc*(10**-3)))/(Vc*(10**-3))\n",
+ "n_ase = 1- (1/(r_k**(1.4-1)))\n",
+ "n_th = Ip*3600/(m_f*cv*1000)\n",
+ "R_e = n_th/n_ase\n",
+ "print \"\\n Mechanical efficiency = \",n_m*100,\" percent,\\n Relative efficiency on indicated power basis = \",R_e*100,\" percent\"\n",
+ "#The value of answer is different because of round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.9:pg-853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.9\n",
+ "\n",
+ "\n",
+ " Indicated thermal efficiency = 30.0275891939 percent,\n",
+ " Brake mean effective preassure = 825.889834193 kN/m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "Bp = 28.35 # Brake power in kW\n",
+ "N = 1500.0 # Speed in rpm\n",
+ "x = 20.0 # Rich percent of mixture\n",
+ "t = 15.5 # Temperature in degree centrigrde\n",
+ "p = 760 # Pressure in mm of mercury\n",
+ "f = 0.7 # Fraction of volume of air in th cylinder relative to swept volume\n",
+ "R = 14.8 # Theoratical Air fuel ratio\n",
+ "d = 82.0 # Diameter of cylinder in mm\n",
+ "L = 130.0 # Stroke of cylinder in mm\n",
+ "cv = 44.0 # Heating value of petrol in MJ/kg\n",
+ "n_m = 0.9 # Mechanical efficiency of the engine\n",
+ "print \"\\n Example 20.9\\n\"\n",
+ "Ip = Bp/n_m\n",
+ "p_ = 101.325 # In kN/m**2 as p = 760 mm mercury\n",
+ "v_a = f*(math.pi/4)*((d*(10**-3))**2)*(L*(10**-3))*(N/2)*4\n",
+ "m = p_*(v_a)/(0.287*(t+273))\n",
+ "m_f = (m/R)*(1+x/100)\n",
+ "n_th = Ip*3600/(m_f*cv*1000*60)\n",
+ "bmep = Bp*60/((math.pi/4)*((d*(10**-3))**2)*(L*10**-3)*(N/2)*4)\n",
+ "print \"\\n Indicated thermal efficiency = \",n_th*100 ,\" percent,\\n Brake mean effective preassure = \",bmep ,\" kN/m**2\"\n",
+ "#The value of answer is different because of round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.10:pg-853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.10\n",
+ "\n",
+ "\n",
+ " Minimum velocity of air required to start the flow = 8.77674536488 m/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "d = 25.0 # Throat diameter in mm\n",
+ "D = 1.2 # Main jet diameter in mm\n",
+ "c_d = 0.85 # Cofficient of discharge for the venturi \n",
+ "C_d = 0.65 # Cofficient of discharge for fuel jet\n",
+ "h = 6.0 # Height of the throat from gasoline surface in mm\n",
+ "p_1 = 1.0 # Ambient pressure in bar\n",
+ "T = 300.0 # Ambient temperature in K\n",
+ "Ro_f = 760.0 # Density in kg/m**3\n",
+ "print \"\\n Example 20.10\\n\"\n",
+ "delta_p = h*(10**-3)*Ro_f*9.81\n",
+ "p_2 = p_1-delta_p*(10**-5)\n",
+ "Ro_air = p_1*(10**5)/(287*T)\n",
+ "v = (2*delta_p/Ro_air)**(1.0/2.0)\n",
+ "print \"\\n Minimum velocity of air required to start the flow = \",v ,\" m/s\"\n",
+ "#The value of answer is different because of round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.11:pg-853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.11\n",
+ "\n",
+ "\n",
+ " Mechanical efficiency = 86.0215053763 percent,\n",
+ " Brake mean effective pressure = 24.4461992589 bar\n",
+ " Air standard ratio = 58.4417930454 percent,\n",
+ " Brake thermal efficiency is 46.5 percent,\n",
+ " Relative efficiency = 79.5663472609 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "Bp = 40.0 # Brake power when all cylinder operating in kW\n",
+ "N = 2000.0 # Speed in rpm\n",
+ "Bp1 = 32.2 # Brake power with cylinder no. 1 cut out in kW\n",
+ "Bp2 = 32.0 # Brake power with cylinder no. 2 cut out in kW\n",
+ "Bp3 = 32.5 # Brake power with cylinder no. 3 cut out in kW\n",
+ "Bp4 = 32.4 # Brake power with cylinder no. 4 cut out in kW\n",
+ "Bp5 = 32.1 # Brake power with cylinder no. 5 cut out in kW\n",
+ "Bp6 = 32.3 # Brake power with cylinder no. 6 cut out in kW\n",
+ "d = 100.0 # Diameter of cylinder in mm\n",
+ "L = 125.0 # Stroke of cylinder in mm\n",
+ "Vc = 0.000123 # Clearance volume in m**3\n",
+ "m_f = 9.0 # Fuel consumption in kg/h\n",
+ "cv = 40.0 # Heating value in MJ/kg\n",
+ "print \"\\n Example 20.11\\n\"\n",
+ "Ip1 = Bp-Bp1\n",
+ "Ip2 = Bp-Bp2\n",
+ "Ip3 = Bp-Bp3\n",
+ "Ip4 = Bp-Bp4\n",
+ "Ip5 = Bp-Bp5\n",
+ "Ip6 = Bp-Bp6\n",
+ "Ip = Ip1+Ip2+Ip3+Ip4+Ip5+Ip6\n",
+ "n_m = Bp/Ip\n",
+ "bmep = Bp*2*60/(L*(10**-3)*((d*(10**-3))**2)*(math.pi/4)*N)\n",
+ "Vs = (math.pi/4)*((d*(10**-3))**2)*(L*(10**-3))\n",
+ "r_k = (Vs+Vc)/Vc\n",
+ "n_ase = 1- (1/(r_k**(1.4-1)))\n",
+ "n_th = Ip*3600/(m_f*cv*1000)\n",
+ "R_e = n_th/n_ase\n",
+ "print \"\\n Mechanical efficiency = \",n_m*100 ,\" percent,\\n Brake mean effective pressure = \",bmep*(10**-2) ,\" bar\\n Air standard ratio = \",n_ase*100 ,\" percent,\\n Brake thermal efficiency is \",n_th*100 ,\" percent,\\n Relative efficiency = \",R_e*100 ,\" percent\"\n",
+ "#The value of answer for air standard efficiency is different because of round off error\n",
+ "# Answer given in the book for bmep is 3.055 bar which is wrong.\n",
+ "# Answer given in the book for brake thermal efficiency is 40 percent which is wrong.\n",
+ "# Answer given in the book for relative efficiency is 68.6 percent which is wrong.\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.12:pg-853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.12\n",
+ "\n",
+ "\n",
+ " Power lost as a percentage of the power produced by the turbine = 23.5485226573 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "p1 = 0.95 # Pressure in bar\n",
+ "t1 = 25 # Temperature in degree centigrade\n",
+ "p2 = 2 # Delivery pressure in bar\n",
+ "r = 18 # Air fuel ratio\n",
+ "t3 = 600 # Temperature of gasses leaving the engine in degree centigrade\n",
+ "p3 = 1.8 # Pressure of gasses leaving the engine in bar\n",
+ "p4 = 1.04 # Pressure at the inlet of turbine in bar\n",
+ "n_c = 0.75 # Efficiency of compresor\n",
+ "n_t = 0.85 # Efficiency of turbine\n",
+ "Cp = 1.005 # Heat capacity of air in kJ/kgK\n",
+ "Cp_ = 1.15 # Heat capacity of gasses in kJ/kgK\n",
+ "gama = 1.4 # Adiabatic index for air\n",
+ "print \"\\n Example 20.12\\n\"\n",
+ "T2_s = (t1+273)*(p2/p1)**((gama-1)/gama)\n",
+ "T2 = (t1+273)+((T2_s-(t1+273))/n_c)\n",
+ "Wc = Cp*(T2-(t1+273))\n",
+ "T4_s = (t3+273)*((p4/p3)**((gama-1)/gama))\n",
+ "T4 = (t3+273)-((t3+273)-T4_s)*n_t\n",
+ "Wt = (1+(1/r))*Cp_*((t3+273)-T4)\n",
+ "n = (Wt-Wc)/Wt\n",
+ "print \"\\n Power lost as a percentage of the power produced by the turbine = \",n*100 ,\" percent\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.13:pg-853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.13\n",
+ "\n",
+ "\n",
+ " Total orifice area per injector = 0.521323450963 mm**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "Bp = 250.0 # Power developed by the engine in kW\n",
+ "n = 6.0 # No of cylinders \n",
+ "N = 2000.0 # Speed in rpm\n",
+ "bsfc = 0.2 # Specific fuel consumption in kg/kWh\n",
+ "P = 35.0 # Pressure at the begining of the injection in bar\n",
+ "p_max = 55.0 # Maximum cylinder pressure in bar\n",
+ "p = 180.0 # Expected pressure for injection in bar\n",
+ "P_max = 520.0 # Maximum pressure at the injection in bar\n",
+ "c_d = 0.78 # Cofficient of discharge\n",
+ "s = 0.85 # Specific gravity of fuel oil\n",
+ "p_atm = 1.0 # Atmospheric pressure in bar\n",
+ "theta = 18.0 # Crank angle in degree\n",
+ "print \"\\n Example 20.13\\n\"\n",
+ "Bp_cy = Bp/n\n",
+ "m_f = Bp_cy*bsfc/60 # in kg/min\n",
+ "f_c = m_f*(2/N)\n",
+ "T = theta/(360*(N/60))\n",
+ "delta_p = p-P\n",
+ "delta_p_ = P_max-p_max\n",
+ "avg_delta_p = (delta_p+delta_p_)/2\n",
+ "v = c_d*math.sqrt((2*(avg_delta_p)*(10**5))/(s*1000))\n",
+ "V = m_f*(10**-3)/(s*1000)\n",
+ "A = V/(v*T)\n",
+ "print \"\\n Total orifice area per injector = \",A*10**6 ,\" mm**2\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.14:pg-853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.14\n",
+ "\n",
+ "\n",
+ " Thermal efficiency = 19.8935818353 percemt,\n",
+ " Gas consumption per kWh on indicated power basis = 1.04109744938 m**3/kWh\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "n=1.3 # Polytropic index\n",
+ "p1 = 140.0 # Pressure at point one in kN/m**2\n",
+ "p2 = 360.0 # Pressure at point two in kN/m**2\n",
+ "r_e = 0.4 # Relative efficiency\n",
+ "cv = 18840 # Calorific value in kJ/m**2\n",
+ "print \"\\n Example 20.14\\n\"\n",
+ "r = (((p2/p1)**(1/n))-1)/((0.75-0.25*((p2/p1)**(1.0/n))))\n",
+ "r_k = r+1\n",
+ "n_ase = 1.0-(1.0/((r_k)**(0.4)))\n",
+ "n_th = r_e*n_ase\n",
+ "V_f = n_th*cv/3600\n",
+ "print \"\\n Thermal efficiency = \",n_th*100 ,\" percemt,\\n Gas consumption per kWh on indicated power basis = \",V_f ,\" m**3/kWh\"\n",
+ "#The value of answer is different because of round off error\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.15:pg-853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.15\n",
+ "\n",
+ "\n",
+ " Mechanical efficiency = 80.2324301595 percemt\n",
+ "\n",
+ " Energy Balance\n",
+ "\n",
+ " Input Output\n",
+ "\n",
+ " Heat supplied by fuel 816.666666667 kW -\n",
+ "\n",
+ " Useful work(BP) - 245.0 kW\n",
+ "\n",
+ " Heat carried by cooling water - 251.778266667 kW\n",
+ "\n",
+ " Heat carried by steam - 64.26 kW\n",
+ "\n",
+ " Heat carried by cooling oil - 42.0 kW\n",
+ "\n",
+ " Heat carried by dry exhaust gas - 166.946877778 kW\n",
+ "\n",
+ " Heat transferred to surroundings - 46.6815222222 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "d = 180.0 # Bore in mm\n",
+ "L = 200.0 # Stroke in mm\n",
+ "Bp = 245.0 # Brake power in kW\n",
+ "N = 1500.0 # Speed in rpm\n",
+ "mep = 8.0 # Mean effective pressure in bar\n",
+ "m_f = 70.0 # Fuel consumption in kg/h\n",
+ "cv = 42.0 # Heating value of fuel in MJ/kg\n",
+ "m_h = 0.12 # Fraction of hydrogen content by mass\n",
+ "m_a = 26.0 # Air consumption in kg/min\n",
+ "m_w = 82.0 # Mass of cooling water in kg/min\n",
+ "delta_t = 44 # Cooling water temperature rise in degree centigrade\n",
+ "m_o = 50.0 # Cooling oil circulated through the engine in kg/min\n",
+ "delta_T = 24 # Cooling oil temperature rise in degree centigrade\n",
+ "s_o = 2.1 # Specific heat of cooling oil in kJ/kgK\n",
+ "t = 30.0 # Room temperature in degree centigrade\n",
+ "t_e = 400.0 # Exhaust gas temperature on degree centigrade\n",
+ "c_p_de = 1.045 # Heat capacity of dry exhaust gas in kJ/kgK\n",
+ "p = 0.035 # Partial pressure of steam in exhaust gas in bar\n",
+ "print \"\\n Example 20.15\\n\"\n",
+ "h = m_f*cv*1000/3600\n",
+ "Ip = mep*(10**5)*L*(10**-3)*(math.pi/4)*((d*(10**-3))**2)*N*6/(2*60000)\n",
+ "n_m = Bp/Ip\n",
+ "h_w = (m_w/60)*(4.187*delta_t)\n",
+ "h_o = (m_o/60)*(s_o*delta_T)\n",
+ "m_e = m_f/60 + m_a\n",
+ "m_v = m_h*9*(m_f/60)\n",
+ "m_de = (m_e-m_v)/60\n",
+ "H = 3060 # From the steam table the enthalpy of steam at the exhaust contion(0.035 bar) in kJ/kg\n",
+ "h_s = (m_v/60)*H\n",
+ "h_de = (m_de)*(c_p_de)*(t_e-t)\n",
+ "h_su = h - (Bp+h_w+h_s+h_o+h_de)\n",
+ "print \"\\n Mechanical efficiency = \",n_m*100 ,\" percemt\"\n",
+ "print \"\\n Energy Balance\"\n",
+ "print \"\\n Input Output\"\n",
+ "print \"\\n Heat supplied by fuel \",h ,\" kW -\"\n",
+ "print \"\\n Useful work(BP) - \",Bp ,\" kW\"\n",
+ "print \"\\n Heat carried by cooling water - \",h_w ,\" kW\"\n",
+ "print \"\\n Heat carried by steam - \",h_s ,\" kW\"\n",
+ "print \"\\n Heat carried by cooling oil - \",h_o ,\" kW\"\n",
+ "print \"\\n Heat carried by dry exhaust gas - \",h_de ,\" kW\"\n",
+ "print \"\\n Heat transferred to surroundings - \",h_su ,\" kW\"\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex20.16:pg-853"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 20.16\n",
+ "\n",
+ "\n",
+ " Fuel consumption = 7.13500385939 kg/h,\n",
+ " Brake mean effective pressure = 29.5555555556 bar\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "N = 3000 # Speed in rpm\n",
+ "T = 66.5 # Torque in Nm\n",
+ "d = 60 # Bore in mm\n",
+ "L = 100 # Stroke in mm\n",
+ "Vc = 60 # Clearance volume in cc\n",
+ "r_e = 0.5 # Relative efficiency\n",
+ "cv = 42 # Calorific value in MJ/kg\n",
+ "print \"\\n Example 20.16\\n\"\n",
+ "Vs = (math.pi/4)*((60*(10**-3))**2)*(L*(10**-3))\n",
+ "r_k = (Vs+(Vc*(10**-6)))/(Vc*(10**-6))\n",
+ "n_ase = 1-(1/(r_k**(0.4)))\n",
+ "n_br = n_ase*r_e\n",
+ "Bp = (2*(math.pi)*T*N)/(60000)\n",
+ "m_f = Bp*3600/(cv*1000*n_br)\n",
+ "bmep = Bp*60000/(Vs*(N/2))\n",
+ "print \"\\n Fuel consumption = \",m_f ,\" kg/h,\\n Brake mean effective pressure = \",bmep*(10**-5) ,\" bar\"\n",
+ "#The answer given in the book for bmep has calculation error\n",
+ "# The answer has round off error for fuel consumption"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter21_ingIztX.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter21_ingIztX.ipynb
new file mode 100644
index 00000000..99e27030
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter21_ingIztX.ipynb
@@ -0,0 +1,528 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 21: Gas Turbines And Propulsion Systems"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex21.1:pg-885"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 21.1\n",
+ "\n",
+ "\n",
+ " Power output = 581.68934348 kJ/kg,\n",
+ " The overall efficiency = 25.8717426718 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "r_c = 3.5 # Compression ratio\n",
+ "n_c = 0.85 # Efficiency of compressor\n",
+ "p1 = 1 # Pressure in bar\n",
+ "t1 = 300 # Temperature in K\n",
+ "t3 = 310 # Temperature at the exit of the intercooler in K\n",
+ "r_c_ = 3.5 # Compression ratio for high pressure compressor\n",
+ "n_c_ = 0.85 # Efficiency of H.P. compressor\n",
+ "e = 0.8 # Effectiveness of regenerator\n",
+ "n_t = 0.88 # Efficiency of H.P. tubine\n",
+ "t6 = 1100 # Temperature in H.P. tubine in K\n",
+ "t8 = 1050 # Temperature at the entrance of L.P. turbine in K\n",
+ "n_t_ = 0.88 # Efficiency of L.P. turbine\n",
+ "Cp = 1.005 # Heat capacity of air in kJ/kgK\n",
+ "Cp_ = 1.15 # Heat capacity of gases in kJ/kgK\n",
+ "gama = 1.4 # Heat capacity ratio for air\n",
+ "gama_ = 1.33 # Heat capacity ratio for gases\n",
+ "print \"\\n Example 21.1\\n\"\n",
+ "p2 = r_c*p1\n",
+ "p4 = p2*r_c_\n",
+ "t2_s = t1*((r_c)**((gama-1)/gama))\n",
+ "t2 = t1+((t2_s-t1)/n_c)\n",
+ "t4_s = t3*((r_c_)**((gama-1)/gama))\n",
+ "t4 = t3+((t4_s-t3)/n_c_)\n",
+ "Wc = Cp*((t2-t1)+(t4-t3))\n",
+ "t7 = t6 - (Wc/Cp_)\n",
+ "t7_s = t6 - (t6-t7)/n_t\n",
+ "r_p = (t6/t7_s)**(gama_/(gama_-1))\n",
+ "p7 = p4/r_p\n",
+ "t9_s = t8/((p7/p1)**((gama_-1)/gama_))\n",
+ "t9 = t8-(t8-t9_s)*n_t_\n",
+ "Wt_LP = Cp_*(t8-t9)\n",
+ "W_T = Wt_LP+Wc\n",
+ "Rw = Wt_LP/W_T\n",
+ "Q1 = (Cp_*t6-Cp*t4)+Cp_*(t8-t7)\n",
+ "n_plant = Wt_LP/Q1\n",
+ "print \"\\n Power output = \",W_T ,\" kJ/kg,\\n The overall efficiency = \",n_plant*100 ,\" percent\"\n",
+ "#The answers given in the book have round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex21.2:pg-886"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 21.2\n",
+ "\n",
+ "\n",
+ " Flow velocity = -43.4235444397 m/s,\n",
+ " The blade angle at the root = -1.43579153344 degree,and at the tip = 1.21859133292 degree,\n",
+ " The degree of reaction at the root = 63.9551441794 percent, and at the tip = 26.0409057706 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "v_bm = 360 # Blade velocity at the mean diameter of a gas turbine stage in m/s\n",
+ "beta1 = 20 # Blade angle at inlet in degree\n",
+ "beta2 = 52 # Blade angle at exit in degree\n",
+ "r = 0.5 # Degree of reaction\n",
+ "Dm = 0.45 # Mean diameter of blade in m\n",
+ "h = 0.08 # Mean height of blade in m\n",
+ "print \"\\n Example 21.2\\n\"\n",
+ "v_f = v_bm/((math.tan(beta2))-math.tan(beta1))\n",
+ "r_r = (Dm/2)-h/2\n",
+ "r_t = Dm/2 +h/2\n",
+ "delta_v_wm = v_f*((math.tan(beta1))+(math.tan(beta2)))\n",
+ "v_br = v_bm*(r_r/(Dm/2))\n",
+ "delta_v_wr = delta_v_wm*v_bm/v_br\n",
+ "\n",
+ "v_bt = (r_t/(Dm/2))*v_bm\n",
+ "v_w_1m = v_f*(math.tan(beta2))\n",
+ "v_w_1t = v_w_1m*(Dm/2)/r_t\n",
+ "delta_v_wt = v_f*((math.tan(beta1))+(math.tan(beta2)))*v_bm/v_bt\n",
+ "v_w_1r = v_w_1m*((Dm/2)/r_r)\n",
+ "alpha_1r = math.atan(v_w_1r/v_f)\n",
+ "alpha_2r = math.atan((delta_v_wr-v_w_1r)/v_f)\n",
+ "beta_1r = math.atan((v_w_1r-v_br)/v_f)\n",
+ "beta_2r = math.atan((v_br+v_f*(math.tan(alpha_2r)))/v_f)\n",
+ "alpha_1t = math.atan(v_w_1t/v_f)\n",
+ "alpha_2t = math.atan((delta_v_wt-v_w_1t)/v_f)\n",
+ "beta_1t = math.atan((v_w_1t-v_bt)/v_f)\n",
+ "beta_2t = math.atan((v_bt+(v_f*math.tan(alpha_2t)))/v_f)\n",
+ "Rt = v_f*((math.tan(beta_2t))-(math.tan(beta_1t)))/(2*v_bt)\n",
+ "Rr = v_f*((math.tan(beta_2r))-(math.tan(beta_1r)))/(2*v_br)\n",
+ "print \"\\n Flow velocity = \",v_f ,\" m/s,\\n The blade angle at the root = \",alpha_1r ,\" degree,and at the tip = \",alpha_2r ,\" degree,\\n The degree of reaction at the root = \",Rt*100 ,\" percent, and at the tip = \",Rr*100 ,\" percent\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex21.3:pg-887"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 21.3\n",
+ "\n",
+ "\n",
+ " The blade angle at the inlet = 0.513725711568 degree,and at the exit = 1.1075454267 degree,\n",
+ " The overall efficiency of the turbine = 87.5152054946 percent\n",
+ " The stage efficiency = 85.2048267464 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "p1 = 8 # Pressure of entrance in bar\n",
+ "t1 = 1125 # Temperature of entrance in K\n",
+ "p2 = 1.5 # Pressure of exit in bar\n",
+ "n = 11 # No of stages\n",
+ "Vf = 110 # Axial velocity of flow in m/s\n",
+ "n_p = 0.85 # Polytropic efficiency \n",
+ "Vb = 140 # Mean velocity in m/s\n",
+ "gama = 1.33 # Heat capacity ratio for gases\n",
+ "Cp = 1.15 # Heat capacity of gases in kJ/kgK\n",
+ "r = 0.5 # Fraction of reaction\n",
+ "print \"\\n Example 21.3\\n\"\n",
+ "t2 = t1*((p2/p1)**((gama-1)*n_p/gama))\n",
+ "t2_s = t1*((p2/p1)**((gama-1)/gama))\n",
+ "n_s = (t1-t2)/(t1-t2_s)\n",
+ "Wt = Cp*(t1-t2)\n",
+ "Wt_s = Wt/n\n",
+ "V_w1 = (((Wt_s*1000)/Vb) + Vb)/2\n",
+ "alpha1 = math.atan(Vf/V_w1)\n",
+ "alpha2 = alpha1\n",
+ "beta1 = math.atan(Vf/(V_w1-Vb))\n",
+ "h_s = Wt_s\n",
+ "t_s = h_s/Cp\n",
+ "t1_ = t1-t_s\n",
+ "t1_s = t1*((t1_/t1)**(gama/((gama-1)*n_p)))**((gama-1)/gama)\n",
+ "n_st = (t1-t1_)/(t1-t1_s)\n",
+ "print \"\\n The blade angle at the inlet = \",alpha1 ,\" degree,and at the exit = \",beta1 ,\" degree,\\n The overall efficiency of the turbine = \",n_s*100 ,\" percent\\n The stage efficiency = \",n_st*100 ,\" percent\"\n",
+ "# The answers given in the book contain round off error."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex21.4:pg-889"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 21.4\n",
+ "\n",
+ "\n",
+ " Total thrust developed = 6675.46374954 N,\n",
+ " The specific fuel consumption = 0.0236198761133 kg/kNs\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "v = 800.0 # Speed of aircraft in km/h\n",
+ "h = 10700.0 # Height of aircraft in m\n",
+ "p0 = 0.24 # Pressure in bar\n",
+ "t0 = -50.0 # Temperature in degree centigrade\n",
+ "r_p = 10.0 # Compressor pressure ratio\n",
+ "t03 = 1093.0 # Max cycle temperature in K\n",
+ "n_ed = 0.9 # Entry duct efficiency\n",
+ "n_c = 0.9 # Isentropic efficiency of compressure\n",
+ "p_ = 0.14 # Stagnation pressure loss in combustion chamber in bar\n",
+ "cv = 43.3 # Calorific value of fuel in MJ/kg\n",
+ "n_C = 0.98 # Combustion efficiency\n",
+ "n_t = 0.92 # Isentropic efficiency of turbine\n",
+ "n_m = 0.98 # Mechanical efficiency of drive\n",
+ "n_j = 0.92 # Jet pipe efficiency\n",
+ "a = 0.08 # Nozzle outlet area in m**2\n",
+ "Cp = 1.005 # Heat capacity of air in kJ/kgK\n",
+ "gama = 1.4 # Ratio of heat capacities for air\n",
+ "Cp_ = 1.15 # Heat capacity for gases in kJ/kgK\n",
+ "gama_ = 1.333 # Ratio of heat capacities for gases\n",
+ "print \"\\n Example 21.4\\n\"\n",
+ "KE = (1/2)*(v*5/18)**2\n",
+ "tr = KE/(1000*Cp)\n",
+ "t01 = tr + (273+t0)\n",
+ "t01_s = (t0+273)+(n_ed*(t01-(t0+273)))\n",
+ "p01 = p0*((t01_s/(t0+273))**(gama/(gama-1)))\n",
+ "t02_s = t01*((r_p)**((gama-1)/gama))\n",
+ "t02 = (t01) + (t02_s-t01)/n_c\n",
+ "p02 = p01*r_p\n",
+ "p03 = p02-p_\n",
+ "t04 = t03 - (Cp*(t02-t01)/(Cp_*n_m))\n",
+ "t04_s = t03-(t03-t04)/n_t\n",
+ "p04 = p03/((t03/t04_s)**(gama_/(gama_-1)))\n",
+ "p_cr = p04*((2/(gama_+1))**(gama_/(gama_-1)))\n",
+ "t05 = t04*(2/(gama_+1))\n",
+ "t05_s = t04-((t04-t05)/n_j)\n",
+ "p05 = p04/((t04/t05_s)**(gama_/(gama_-1)))\n",
+ "R = Cp_*(gama_-1)/gama_\n",
+ "v5 = R*t05/(p05*100)\n",
+ "Vj = math.sqrt(gama_*R*1000*t05)\n",
+ "m = a*Vj/v5\n",
+ "Mt = m*(Vj-v*(5/18))\n",
+ "Pt = (p05-p0)*a*10**5\n",
+ "Tt = Mt+Pt\n",
+ "Q1 = m*(t03-t02)*Cp_\n",
+ "m_f = Q1/(cv*1000*n_C)\n",
+ "m_sf = m_f*1000/Tt\n",
+ "print \"\\n Total thrust developed = \",Tt ,\" N,\\n The specific fuel consumption = \",m_sf ,\" kg/kNs\"\n",
+ "# The answers given in the book contain round off error."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex21.5:pg-889"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 21.5\n",
+ "\n",
+ "\n",
+ " Propulsive power = 9.1580625 MW,\n",
+ " Thrust power = 4402.35949174 kW,\n",
+ " Propulsive efficiency = 48.070860968 percent\n",
+ " Thermal efficiency = 36.63225 percent,\n",
+ " Overall efficiency = 17.609437967 percent \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "v = 850.0 # Speed of turbojet in km/h\n",
+ "m = 50.0 # Air mass flow rate in kg/s\n",
+ "s = 200.0 # Entropy drop across the nozzle in kJ/kg\n",
+ "n_n = 0.9 # Nozzle efficiency\n",
+ "r = 80.0 # Air fuel ratio\n",
+ "cv = 40.0 # Heating value of fuel in MJ/kg\n",
+ "Cp = 1005.0 # Heat capacity of air in J/kgK\n",
+ "print \"\\n Example 21.5\\n\"\n",
+ "Vo = v*(5.0/18)\n",
+ "m_f = m/r\n",
+ "Ve = math.sqrt(2*Cp*s*n_n)\n",
+ "T = (m+m_f)*Ve-m*Vo\n",
+ "TP = T*Vo\n",
+ "PP = (1.0/2.0)*(m+m_f)*(Ve**2)-(1/2)*(m*Vo**2)\n",
+ "n_p = TP/PP\n",
+ "n_t = PP/(m_f*cv*1000000)\n",
+ "n = n_t*n_p\n",
+ "print \"\\n Propulsive power = \",PP*(10**-6) ,\" MW,\\n Thrust power = \",TP*(10**-3) ,\" kW,\\n Propulsive efficiency = \",n_p*100 ,\" percent\\n Thermal efficiency = \",n_t*100 ,\" percent,\\n Overall efficiency = \",n*100 ,\" percent \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex21.6:pg-890"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 21.6\n",
+ "\n",
+ "\n",
+ " Air-fuel ratio = 60.9221650764 ,\n",
+ " Thrust power of the propeller = 4144.33833875 kJ/s ,\n",
+ " Thrust by the propeller = 26.523765368 kN,\n",
+ " Mass flow rate of air flowing through the compressor = 27.4358227 kg/s,\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "p1 = 0.56 # Ambient pressure in bar\n",
+ "t1 = 260.0 # Ambient temperature in K\n",
+ "r_p = 6.0 # Pressure ratio of compressor\n",
+ "n_c = 0.85 # Efficiency of compressor\n",
+ "v = 360.0 # Speed of aircraft in km/h\n",
+ "d = 3.0 # Propeller diameter in m\n",
+ "n_p = 0.8 # Propeller efficiency\n",
+ "n_g = 0.95 # Gear reduction efficiency\n",
+ "r_e = 5.0 # Expansion ratio\n",
+ "n_t = 0.88 # Turbine efficiency\n",
+ "t3 = 1100.0 # Temperature at the entrance of turbine in K\n",
+ "n_n = 0.9 # Nozzle efficiency\n",
+ "cv = 40.0 # Calorific value in MJ/kg\n",
+ "print \"\\n Example 21.6\\n\"\n",
+ "gama = 1.4 # Heat capacities ratio for air\n",
+ "Vo = v*(5.0/18)\n",
+ "p2 = p1*r_p\n",
+ "t2_s = t1*((r_p)**(0.286))\n",
+ "t2 = t1+((t2_s-t1)/n_c)\n",
+ "Cp = 1.005 # The value of heat capacity of air as given in the book in kJ/kgK\n",
+ "Wc = Cp*(t2-t1)\n",
+ "m_f = (t3-t2)/((cv*1000/Cp)-t3)\n",
+ "m_a = 1.0/m_f\n",
+ "p3=p2\n",
+ "p4 = p3/r_e\n",
+ "t4_s = t3/((r_e)**(0.286))\n",
+ "t4 = t3-((t3-t4_s)*n_t)\n",
+ "Wt = (1+m_f)*(t3-t4)*Cp\n",
+ "Pp = Wt-Wc\n",
+ "p5 = p1\n",
+ "t5_s = t4/((p4/p5)**((gama-1)/gama))\n",
+ "Vj = math.sqrt(2*Cp*1000*(t4-t5_s)*n_n)\n",
+ "Ft = (1+m_f)*Vj-1*Vo\n",
+ "V = Vo/n_p\n",
+ "V4 = 2*V-Vo\n",
+ "Q = (math.pi/4)*(d**2)*V\n",
+ "Pt = (1/2.0)*(p1*(10**5)/(287*t1))*Q*((V4**2)-(Vo**2))/1000\n",
+ "PT = Pt/n_g\n",
+ "ma_c = PT/Pp\n",
+ "Fp = Pt*n_p/V\n",
+ "print \"\\n Air-fuel ratio = \",m_a ,\",\\n Thrust power of the propeller = \",Pt ,\" kJ/s ,\\n Thrust by the propeller = \",Fp ,\" kN,\\n Mass flow rate of air flowing through the compressor = \",ma_c ,\" kg/s,\"\n",
+ "# The answers are given in the book contain calculation error."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex21.7:pg-890"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 21.7\n",
+ "\n",
+ "\n",
+ " Velocity attain by the rocket in 70 seconds = 1064.23747471 m/s ,\n",
+ " The maximum height that the rocket will attain = 86.1455071297 km\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "from scipy import integrate \n",
+ "# Given that\n",
+ "m = 15000.0 # Initial mass of rocket in kg\n",
+ "m_b = 125.0 # Burning rate of propellent in kg/s\n",
+ "v = 2000.0 # Relative velocity of gases with respect to the rocket in m/s\n",
+ "T = 70.0 # Time in second\n",
+ "print \"\\n Example 21.7\\n\"\n",
+ "V = (-v*math.log(1-(m_b*T/m)))-(9.81*T)\n",
+ "h1,err = integrate.quad(lambda t:-v*math.log(1-(m_b*t/m))-9.81*t,0,T)\n",
+ "h2 = (V**2)/(2*9.81)\n",
+ "hmax = h2 + h1\n",
+ "print \"\\n Velocity attain by the rocket in 70 seconds = \",V ,\" m/s ,\\n The maximum height that the rocket will attain = \",hmax*0.001 ,\" km\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex21.8:pg-890"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 21.8\n",
+ "\n",
+ "\n",
+ " Thrust produced = 218.178625017 kN,\n",
+ " Specific impulse = 3482.18007048 Ns/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "Pc = 2.4 # Pressure in combustion chamber in MPa\n",
+ "Tc = 3170 # Temperature in combustion chamber in K\n",
+ "Pj = 55 # Atomospheric pressure in kPa\n",
+ "Pe = 85 # Pressure at the exit of nozzle in kPa\n",
+ "At = 0.06 # Area at the nozzle throat in m**2\n",
+ "n_n = 0.91 # Nozzle efficiency\n",
+ "Cd = 0.98 # Cofficient of discharge\n",
+ "gama = 1.25 # Heat capacities ratio for gases\n",
+ "R = 0.693 # Value of gas constant in kJ/kgK\n",
+ "theta = 12 # Half angle of divergence in degree\n",
+ "print \"\\n Example 21.8\\n\"\n",
+ "Vj = math.sqrt((2*gama*R*1000*Tc/(gama-1))*(1-(Pj/(Pc*1000))**((gama-1)/gama)))\n",
+ "Vj_act = ((1+math.cos(12))/2)*Vj*math.sqrt(n_n)\n",
+ "m = At*Pc*(10**6)*((gama/(R*1000*Tc))*(2/(gama+1))**((gama+1)/(gama-1)))**(1.0/2)\n",
+ "m_act = Cd*m\n",
+ "Ae = m/(Pe*Vj)\n",
+ "Ft = m*Vj+Ae*(Pe-Pj)*1000\n",
+ "SIm = Ft/m_act\n",
+ "print \"\\n Thrust produced = \",Ft*0.001 ,\" kN,\\n Specific impulse = \",SIm ,\" Ns/kg\"\n",
+ "# The answers are given in the book contain claculation error.\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter22_yljf4OR.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter22_yljf4OR.ipynb
new file mode 100644
index 00000000..228b303a
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter22_yljf4OR.ipynb
@@ -0,0 +1,497 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 22: Transport Processes in Gas"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex22.1:pg-911"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 22.1 \n",
+ "\n",
+ "\n",
+ " Mean free path = math.exp m,\n",
+ " The fraction of molecules have free path longer than 2*lambda = 13.5335283237 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "p = 1.013e5 # Pressure in Pa\n",
+ "t = 300 # Temperature in K\n",
+ "d = 3.5 # Effective diameter of oxygen molecule in Angstrom \n",
+ "r = 2 # Ratio of free path of molecules with the lambda\n",
+ "print \"\\n Example 22.1 \\n\"\n",
+ "sigma = math.pi*(d*(10**-10))**2\n",
+ "n = p/(t*1.38*(10**-23))\n",
+ "R = math.exp(-r)\n",
+ "print \"\\n Mean free path = math.exp m,\\n The fraction of molecules have free path longer than 2*lambda = \",R*100, \" percent\"\n",
+ "# Answer given in the book contain round off error for mean free path."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex22.2:pg-912"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 22.2 \n",
+ "\n",
+ "\n",
+ " Pressure of the gas = 134.236067593 Pa,\n",
+ " No of collisions made by a molecule per meter of path = math.exp 38022.8136882\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "lambda1 = (2.63e-5) # Mean free path of the molecules of the gas in m\n",
+ "t = 25 # Temperature in degree centigrade\n",
+ "r = 2.56e-10 # Radius of the molecules in m\n",
+ "print \"\\n Example 22.2 \\n\"\n",
+ "sigma = 4*math.pi*r**2\n",
+ "n = 0.707/(sigma*lambda1)\n",
+ "p = n*(t+273)*(1.38*10**-23)\n",
+ "N = 1.0/lambda1\n",
+ "print \"\\n Pressure of the gas = \",p,\" Pa,\\n No of collisions made by a molecule per meter of path = math.exp\",N\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex22.3:pg-912"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 22.3 \n",
+ "\n",
+ "\n",
+ " The no of free paths which are longer than, \n",
+ " 10 cm = 3679.0 ,\n",
+ " 20 cm = 1354.0 ,\n",
+ " 50 cm = 68.0 ,\n",
+ "\n",
+ " The no of free paths which are between,\n",
+ " 5 cm and 10 cm = -2387.0 ,\n",
+ " 9.5 cm and 10.5 cm = -369.0 ,\n",
+ " 9.9 cm and 10.1 cm = -74.0 ,\n",
+ "\n",
+ " The no of free paths which are exactly 10 cm = -0.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Given that\n",
+ "import math\n",
+ "from scipy import integrate \n",
+ "lambda1 = 10.0 # Mean free path of the gas in cm\n",
+ "N0 = 10000.0 # No of free paths\n",
+ "x1 = 10.0 # In cm\n",
+ "x2 = 20.0 # In cm\n",
+ "x3 = 50.0 # In cm\n",
+ "x4 = 5.0 # In cm\n",
+ "x5 = 9.5 # In cm\n",
+ "x6 = 10.5 # In cm\n",
+ "x7 = 9.9 # In cm\n",
+ "x8 = 10.1 # In cm\n",
+ "print \"\\n Example 22.3 \\n\"\n",
+ "# For x>10 cm\n",
+ "N1 = N0*(math.exp(-1))\n",
+ "# For x>20 cm\n",
+ "N2 = N0*(math.exp(-2))\n",
+ "# For x>50 cm\n",
+ "N3 = N0*(math.exp(-5))\n",
+ "def f(x): \n",
+ " y = (-N0/lambda1)*(math.exp((-x)/lambda1)),\n",
+ " return y\n",
+ "# For 5>x>10 cm\n",
+ "N4,er = integrate.quad( lambda x: (-N0/lambda1)*(math.exp((-x)/lambda1)),x4,x1)\n",
+ "# For 9.5>x>10.5 cm\n",
+ "N5,e = integrate.quad( lambda x: (-N0/lambda1)*(math.exp((-x)/lambda1)),x5,x6)\n",
+ "# For 9.9>x>10.1 cm\n",
+ "N6,eor = integrate.quad( lambda x: (-N0/lambda1)*(math.exp((-x)/lambda1)),x7,x8)\n",
+ "# For x=10 cm\n",
+ "N7,eer = integrate.quad( lambda x: (-N0/lambda1)*(math.exp((-x)/lambda1)),x1,x1)\n",
+ "print \"\\n The no of free paths which are longer than, \\n 10 cm = \",math. ceil(N1) ,\",\\n 20 cm = \",math. ceil(N2) ,\",\\n 50 cm = \",math. ceil(N3) ,\",\\n\\n The no of free paths which are between,\\n 5 cm and 10 cm = \",math.floor(N4) ,\",\\n 9.5 cm and 10.5 cm = \",math.floor(N5) ,\",\\n 9.9 cm and 10.1 cm = \",math.floor(N6) ,\",\\n\\n The no of free paths which are exactly 10 cm = \",N7 \n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex22.4:pg-913"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 22.4 \n",
+ "\n",
+ "\n",
+ " Coefficient of viscosity = math.exp Ns/m**2 2.051171875e-05\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "p = 1.0 # Pressure in atm\n",
+ "t = 300.0 # Temperature in K\n",
+ "print \"\\n Example 22.4 \\n\"\n",
+ "# From previous example, we have\n",
+ "m = 5.31e-26 # In kg/molecule\n",
+ "v = 445.0 # In m/s\n",
+ "sigma = 3.84e-19 # In m**2\n",
+ "# Therefore\n",
+ "mu = (1.0/3.0)*(m*v/sigma)\n",
+ "print \"\\n Coefficient of viscosity = math.exp Ns/m**2\",mu"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex22.5:pg-913"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 22.5 \n",
+ "\n",
+ "\n",
+ " Thermal conductivity = 0.0 W/mK,\n",
+ " If the gas has Maxwellian velocity distribution,\n",
+ " Thermal conductivity = 5.98958333333e-05 W/mK\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "p = 1.0 # Pressure in atm\n",
+ "t = 300.0 # Temperature in K\n",
+ "F = 5.0 # For oxygen gas degree of freedom\n",
+ "print \"\\n Example 22.5 \\n\"\n",
+ "v = 445.0 # In m/s as given in the book\n",
+ "m = 5.31e-26 # Mass of oxygen molecule in kg\n",
+ "sigma = 3.84e-19 # As given in the book in m**2\n",
+ "k = (1/6)*(v*F*(1.38*10**-23))/sigma\n",
+ "# If the gas has Maxwellian velocity distribution,\n",
+ "k_ = (1.0/3.0)*(F*(1.38*10**-23)/sigma)*((1.38*10**-23)*t/(math.pi*m))**(1/2)\n",
+ "print \"\\n Thermal conductivity = \",k ,\" W/mK,\\n If the gas has Maxwellian velocity distribution,\\n Thermal conductivity = \",k_ ,\" W/mK\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex22.6:pg-914"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 22.6 \n",
+ "\n",
+ "\n",
+ " Pressure in the cathode ray tube = 0.142844028924 Pa\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "F = .90 # Fraction of electrons leaving the cathode ray reach the anode without making a collision\n",
+ "x = 0.2 # Distance between cathode ray and anode in m\n",
+ "d = 3.6e-10 # Diameter of ion in m\n",
+ "t = 2000.0 # Temperature of electron in K\n",
+ "print \"\\n Example 22.6 \\n\"\n",
+ "lambda1 = x/(math.log(1/F))\n",
+ "sigma = math.pi*(d**2)\n",
+ "n = 4/(sigma*lambda1)\n",
+ "p = n*(1.38*10**-23)*(t)\n",
+ "print \"\\n Pressure in the cathode ray tube = \",p ,\" Pa\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex22.7:pg-914"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 22.7 \n",
+ "\n",
+ "\n",
+ " No of collisions per sec are made by one molecule with the other molecule = 9962400.07749 \n",
+ "The no of molecules strike the flask per sq. cm = 6.11714975845e+20 \n",
+ " No of molecules in the flask = 2.44685990338e+22\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "V = 1.0 # Volume of the flask in litre\n",
+ "p = 1.0 # Pressure in atm\n",
+ "t = 300.0 # Temperature in K\n",
+ "r = 1.8e-10 # Radius of oxygen gas molecule in m\n",
+ "m = 5.31e-26 # Mass of oxygen molecule in kg\n",
+ "print \"\\n Example 22.7 \\n\"\n",
+ "n = (p*(1.013e5))/((1.38e-23)*(t)*1000)\n",
+ "sigma = 4*math.pi*(r**2)\n",
+ "v = ((8*(1.38e-23)*t)/(math.pi*m))**(1/2)\n",
+ "z = sigma*n*v*1000\n",
+ "N = (1.0/4.0)*(n*0.1*v)\n",
+ "print \"\\n No of collisions per sec are made by one molecule with the other molecule =\", z,\"\\nThe no of molecules strike the flask per sq. cm =\",N,\"\\n No of molecules in the flask =\",n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex22.8:pg-915"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 22.8 \n",
+ "\n",
+ "\n",
+ " Time = 1.00003111262 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "lambda1 = 2.0 # Mean free path in cm\n",
+ "T = 300.0 # Temperature in K\n",
+ "r = 0.5 # As half of the molecules did not make any collision\n",
+ "print \"\\n Example 22.8 \\n\"\n",
+ "x = lambda1*(math.log(1/r))\n",
+ "v = 445.58 # For oxygen at 300K in m/s\n",
+ "t = x/(v*100)\n",
+ "print \"\\n Time =\", math.exp(t), \"s\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex22.9:pg-915"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 22.9 \n",
+ "\n",
+ "\n",
+ " Pressure = 1.03636998072 N/m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "f = 0.9 # Fraction of electrons leaving the cathode ray and reaching the anode without making any collision\n",
+ "x = 20.0 # Distance between cathode ray tube and anode in cm\n",
+ "sigma = 4.07e-19 # Collision cross section of molecules in m**2\n",
+ "T = 2000 # Temperature in K\n",
+ "print \"\\n Example 22.9 \\n\"\n",
+ "lambda1 = (x*0.01)/(math.log(1.0/f))\n",
+ "n = 1/(sigma*lambda1)\n",
+ "p = n*(1.38e-23)*T\n",
+ "print \"\\n Pressure =\", math.exp(p), \"N/m**2\"\n",
+ "# The answer given in the book contains round off error.\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex22.10:pg-916"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " \n",
+ " Example 22.10 \n",
+ "\n",
+ "\n",
+ " Initial concentration gradient of reactive molecules = 0.0 molecules/m**4, \n",
+ " The no of reactive molecules per sec cross a cross section at the mid point of the tube from left to right = 0.9 molecules/m**2,\n",
+ " The no of reactive molecules per sec cross a cross section at the mid point of the tube from right to left = 2.71828182846 molecule/m**2,\n",
+ " Initial net rate of diffusion = 0.0112863158384 g/m**2-s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "l = 2.0 # Length of tube in m\n",
+ "a = 1e-4 # Cross section of the tube in m**2\n",
+ "p = 1.0 # Pressure in atm\n",
+ "t = 0 # Temperature in degree centigrade\n",
+ "r = 0.5 # Fraction of the carbon atoms which are radioactive C14\n",
+ "sigma = 4e-19 # Collision cross section area in m**2\n",
+ "print \"\\n Example 22.10 \\n\"\n",
+ "n = (p*1.01325e+5)/((1.38e-23)*(t+273))\n",
+ "C_g = -n/l\n",
+ "m = (46/6.023)*10**-26 # In kg/molecule\n",
+ "v = (2.55*(1.38e-23)*(t+273)/m)**(1/2.0)\n",
+ "lambda1 = (1.0/(sigma*n))\n",
+ "gama = (1.0/4)*(v*n) - (1/6.0)*(v*lambda1*(C_g))\n",
+ "gama_ = (1/4.0)*(v*n) + (1.0/6.0)*(v*lambda1*(C_g))\n",
+ "x = (1.0/4)*(v*n)\n",
+ "y = (1.0/6)*(v*lambda1*(C_g))\n",
+ "d = (1.0/6)*(v*lambda1*(-1*C_g))*2*(m)\n",
+ "a=x+y\n",
+ "b=x-y\n",
+ "print \"\\n Initial concentration gradient of reactive molecules =\",math.exp (C_g),\" molecules/m**4, \\n The no of reactive molecules per sec cross a cross section at the mid point of the tube from left to right =\",f , \"molecules/m**2,\\n The no of reactive molecules per sec cross a cross section at the mid point of the tube from right to left =\",math.e ,\" molecule/m**2,\\n Initial net rate of diffusion = \",d*1000 ,\"g/m**2-s\"\n",
+ "# The answer for lambda given in the book conatains calculation error\n",
+ "# The answers contains calculation error\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter2_exrY10K.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter2_exrY10K.ipynb
new file mode 100644
index 00000000..175230ce
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter2_exrY10K.ipynb
@@ -0,0 +1,113 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 02:Temperature"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex2.1:pg-33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 2.1\n",
+ "\n",
+ " The straight bore thermometer reading will be 47.62 degree Celsius.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "d = 1 # Assumption\n",
+ "l = 1 # Assumption\n",
+ "A_ACDB = (math.pi/4)*(1/3.0)*((1.05*d)**2)*10.5*l - (math.pi/4)*(1/3.0)*d**2*10*l # Area of ABCD\n",
+ "A_AEFB = (math.pi/4)*(1/3.0)*((1.1*d)**2)*11*l - (math.pi/4)*(1/3.0)*d**2*10*l # Area of AEFB\n",
+ "t = 100*(A_ACDB/A_AEFB)\n",
+ "print \"\\n Example 2.1\"\n",
+ "print \"\\n The straight bore thermometer reading will be \",round(t,2),\" degree Celsius.\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex2.2:pg-35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 2.2\n",
+ "\n",
+ " Reading of thermocouple at t = 50 degree Celsius will be 58.33 degree Celsius.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy.polynomial.polynomial\n",
+ "\n",
+ "#t = numpy.polynomial(0,'t')\n",
+ "def f1(t):\n",
+ " e=(0.2*t)-((5e-4)*t**2)\n",
+ " return e# e.m.f. as a function of temperature in mV\n",
+ "e0 = f1(0)#horner(e, 0) # e.m.f. at t = 0 degree\n",
+ "e100 = f1(100) # e.m.f. at t = 100 degree\n",
+ "e50 = f1(50) # e.m.f. at t = 50 degree\n",
+ "r = (100/e100)*e50 # Reading of thermocouple at t = 50degree\n",
+ "print \"\\n Example 2.2\"\n",
+ "print \"\\n Reading of thermocouple at t = 50 degree Celsius will be \",round(r,2),\" degree Celsius.\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter3_4zPOo0N.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter3_4zPOo0N.ipynb
new file mode 100644
index 00000000..dc342cb8
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter3_4zPOo0N.ipynb
@@ -0,0 +1,370 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 03:Work and Heat Transfer"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex3.1:pg-54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 3.1\n",
+ "\n",
+ " The amount of work done upon the atmosphere by the balloon is 50.6625 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "dV = 0.5 # Change in volume in m**3\n",
+ "P = 101.325e03 # Atmospheric pressure in N/m**2\n",
+ "Wd = P*dV # Work done in J\n",
+ "print \"\\n Example 3.1\"\n",
+ "print \"\\n The amount of work done upon the atmosphere by the balloon is \",Wd/1e3,\" kJ\",\n",
+ "#The answers vary due to round off error\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex3.2:pg-55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 3.2\n",
+ "\n",
+ " The displacement work done by the air is 60.795 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "dV = 0.6 # Volumetric change in m**3\n",
+ "\n",
+ "P = 101.325e03 # Atmospheric pressure in N/m**2\n",
+ "\n",
+ "Wd = P*dV # Work done in J\n",
+ "\n",
+ "print \"\\n Example 3.2\"\n",
+ "\n",
+ "print \"\\n The displacement work done by the air is \",Wd/1e3 ,\" kJ\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex3.3:pg-55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 3.3\n",
+ "\n",
+ " The net work transfer for the system is -57.19 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "\n",
+ "T = 1.275 # Torque acting against the fluid in mN\n",
+ "\n",
+ "N = 10000 # Number of revolutions\n",
+ "\n",
+ "W1 = 2*math.pi*T*1e-3*N # Work done by stirring device upon the system\n",
+ "\n",
+ "P = 101.325e03 # Atmospheric pressure in kN/m**2\n",
+ "\n",
+ "d = 0.6 # Piston diameter in m\n",
+ "\n",
+ "A = (math.pi/4)*(d)**2 # Piston area in m\n",
+ "\n",
+ "L = 0.80 # Displacement of diameter in m\n",
+ "\n",
+ "W2 = (P*A*L)/1000 # Work done by the system on the surroundings i KJ\n",
+ "\n",
+ "W = -W1+W2 # net work transfer for the system\n",
+ "print \"\\n Example 3.3\"\n",
+ "print \"\\n The net work transfer for the system is \",round(W,2) ,\" kJ\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex3.4:pg-56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 3.4\n",
+ "\n",
+ " The rate of work transfer from gas to the piston is 24383.7855401 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "\n",
+ "ad = 5.5e-04 # Area of indicator diagram in m**2\n",
+ "\n",
+ "ld = 0.06 # Length of diagram in m\n",
+ "\n",
+ "k = 147 # Spring value in MPa/m\n",
+ "\n",
+ "w = 150 # Speed of engine in revolution per minute\n",
+ "\n",
+ "L = 1.2 # Stroke of piston in m\n",
+ "\n",
+ "d = 0.8 # Diameter of the cylinder in m\n",
+ "\n",
+ "A = (math.pi/4)*(0.8**2) # Area of cylinder\n",
+ "\n",
+ "Pm = (ad/ld)*k # Effective pressure in MPa\n",
+ "\n",
+ "W1 = Pm*L*A*w # Work done in 1 minute MJ\n",
+ "\n",
+ "W = (12*W1)/60 # The rate of work transfer gas to the piston in MJ/s\n",
+ "\n",
+ "\n",
+ "\n",
+ "print \"\\n Example 3.4\"\n",
+ "\n",
+ "print \"\\n The rate of work transfer from gas to the piston is \",W*1e3 ,\" kW\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex3.5:pg-57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 3.5\n",
+ "\n",
+ " Rating of furnace would be 2.17163371599 *1e3 kW\n",
+ "\n",
+ " Diameter of furnace is 1.0 m\n",
+ "\n",
+ " Length of furnace is 2.0 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#Given that\n",
+ "\n",
+ "m = 5 # mass flow rate in tones/h\n",
+ "\n",
+ "Ti = 15 # Initial temperature in degree Celsius\n",
+ "\n",
+ "tp = 1535 # Phase change temperature in degree Celsius\n",
+ "\n",
+ "Tf = 1650 # Final temperature in degree Celsius\n",
+ "\n",
+ "Lh = 270 # Latent heat of iron in kJ/Kg\n",
+ "\n",
+ "ml = 29.93 # Specific heat of iron in liquid phase in kJ/Kg\n",
+ "\n",
+ "ma = 56 # Atomic weight of iron\n",
+ "\n",
+ "sh = 0.502 # Specific heat of iron in solid phase in kJ/Kg\n",
+ "\n",
+ "d = 6900 # Density of molten metal in kg/m**3\n",
+ "\n",
+ "n=0.7 # furnace efficiency\n",
+ "\n",
+ "l_d_ratio = 2 # length to diameter ratio\n",
+ "\n",
+ "print \"\\n Example 3.5\"\n",
+ "\n",
+ "h1 = sh*(tp-Ti) # Heat required to raise temperature\n",
+ "\n",
+ "h2 = Lh # Heat consumed in phase change\n",
+ "\n",
+ "h3 = ml*(Tf-tp)/ma # Heat consumed in raising temperature of molten mass\n",
+ "\n",
+ "h = h1+h2+h3 # Heat required per unit mass\n",
+ "\n",
+ "Hi = h*m*1e3 # Ideal heat requirement\n",
+ "\n",
+ "H = Hi/(n*3600) # Actual heat requirement\n",
+ "\n",
+ "V = (3*m)/d # Volume required in m**3\n",
+ "\n",
+ "d = (4*V/(math.pi*l_d_ratio))**(1/3) # Diameter of furnace \n",
+ "\n",
+ "l = d*l_d_ratio # Length of furnace\n",
+ "\n",
+ "print \"\\n Rating of furnace would be \",H/1e3 ,\" *1e3 kW\"\n",
+ "\n",
+ "print \"\\n Diameter of furnace is \",d ,\" m\"\n",
+ "\n",
+ "print \"\\n Length of furnace is \",l ,\" m\"\n",
+ "\n",
+ "#The answer provided in the textbook is wrong\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex3.6:pg-57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 3.6\n",
+ "\n",
+ " Rate at which aluminium can be melted is 5.39 tonnes/h\n",
+ "\n",
+ " Mass of aluminium that can be held in furnace is 5.232 tonnes\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "\n",
+ "SH = 0.9 # Specific heat of aluminium in solid state in kJ/kgK \n",
+ "\n",
+ "L = 390 # Latent heat in kJ/kg\n",
+ "\n",
+ "aw = 27 # Atomic weight\n",
+ "\n",
+ "D = 2400 # Density in molten state in kg/m**3\n",
+ "\n",
+ "Tf = 700 # Final temperature in degree Celsius\n",
+ "\n",
+ "Tm = 660 # Melting point of aluminium in degree Celsius\n",
+ "\n",
+ "Ti = 15 # Initial temperature in degree Celsius\n",
+ "\n",
+ "HR = SH*(Tm-Ti)+L+(29.93/27)*(Tf-Tm) # Heat requirement\n",
+ "\n",
+ "HS = HR/0.7 # Heat supplied\n",
+ "\n",
+ "RM = 2.17e3*3600/HS # From the data of problem 3.7\n",
+ "\n",
+ "V = 2.18 # Volume in m**3\n",
+ "\n",
+ "M = V*D\n",
+ "\n",
+ "print \"\\n Example 3.6\"\n",
+ "\n",
+ "print \"\\n Rate at which aluminium can be melted is \",round(RM/1e3,2) ,\" tonnes/h\"\n",
+ "\n",
+ "print \"\\n Mass of aluminium that can be held in furnace is \",M/1e3 ,\"tonnes\"\n",
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter4_UHVlvXM.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter4_UHVlvXM.ipynb
new file mode 100644
index 00000000..e60349d2
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter4_UHVlvXM.ipynb
@@ -0,0 +1,343 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 04:First Law of Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex4.1:pg-72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 4.1\n",
+ "\n",
+ " The internal energy of the gas decrease by 21.85 kJ in the process.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "V1 = 0.3 # Initial volume in m**3\n",
+ "V2 = 0.15 # Final volume in m**3\n",
+ "P = 0.105 # Initial Pressure in MPa\n",
+ "Q = -37.6 # Heat transferred in kJ\n",
+ "W = P*(V2-V1)*1e6 # Work done\n",
+ "U = Q*1e3-W # Internal energy change\n",
+ "print \"\\n Example 4.1\"\n",
+ "print \"\\n The internal energy of the gas decrease by \",abs(U)/1e3,\" kJ in the process.\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex4.2:pg-73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 4.2\n",
+ "\n",
+ " The heat flow into the system along the path adb is 62.5 kJ\n",
+ "\n",
+ " The heat liberated along the path b-a is -73 kJ\n",
+ "\n",
+ " The heat absorbed in the path ad and db are 52.5 kJ nd 10.0 kJ respectively.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "Qacb = 84 # Heat transfer along the path acb in kJ \n",
+ "Wacb = 32 # Work done along the path acb in kJ\n",
+ "Uba = Qacb-Wacb # Ub-Ua\n",
+ "# Part (a)\n",
+ "Wadb = 10.5 # Work done along the path adb in kJ\n",
+ "Qadb = Uba+Wadb # Heat flow into the system along the path adb\n",
+ "print \"\\n Example 4.2\"\n",
+ "print \"\\n The heat flow into the system along the path adb is \",Qadb ,\" kJ\"\n",
+ "# Part (b)\n",
+ "Wb_a = -21 # work done along the path ba in kJ\n",
+ "Uab = - Uba # Change in internal energy along the path ab in kJ\n",
+ "Qb_a = Uab+Wb_a # Heat liberated along the path b-a\n",
+ "print \"\\n The heat liberated along the path b-a is \",Qb_a,\" kJ\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "# Part (c)\n",
+ "Wdb = 0 # Constant volume\n",
+ "Wad = 10.5 # work done along the path ad in kJ\n",
+ "Wadb = Wdb-Wad # work done along the path adb in kJ\n",
+ "Ud = 42\n",
+ "Ua = 0\n",
+ "Qad = Ud-Ua+Wad # Heat flow into the system along the path ad in kJ\n",
+ "Qdb = Qadb-Qad #Heat flow into the system along the path db in kJ\n",
+ "\n",
+ "print \"\\n The heat absorbed in the path ad and db are \",Qad ,\" kJ nd \",Qdb ,\" kJ respectively.\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex4.3:pg-73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 4.3\n",
+ "The completed table is: [[0, 2170, -2170], [21000, 0, 21000], [-2100, 34500, -36600], [-35900, -53670, 17770]]\n",
+ "\n",
+ " Net rate of work output is -284 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Process a-b\n",
+ "Qab = 0 # Heat transfer along the path ab in kJ/ min\n",
+ "Wab = 2170 # Work transfer along the path ab in kJ/min\n",
+ "Eab = Qab-Wab # Change in internal energy along the path ab in kJ/min\n",
+ "# Process b-c\n",
+ "\n",
+ "Qbc = 21000 # Heat transfer along the path bc in kJ/ min\n",
+ "Wbc = 0 # Work transfer along the path bc in kJ/min\n",
+ "Ebc = Qbc-Wbc # Change in internal energy along the path bc in kJ/min\n",
+ "\n",
+ "# Process c-d\n",
+ "\n",
+ "Qcd = -2100 # Heat transfer along the path cd in kJ/ min\n",
+ "Ecd = -36600 # Change in internal energy along the path cd in kJ/min\n",
+ "Wcd = Qcd-Ecd # Work transfer along the path cd in kJ/min\n",
+ "\n",
+ "# Process d-a\n",
+ "\n",
+ "Q = -17000 # Total heat transfer in kJ/min\n",
+ "Qda = Q-Qab-Qbc-Qcd # Heat transfer along the path da in kJ/ min \n",
+ "Eda = -Eab-Ebc-Ecd # Change in internal energy along the path da in kJ/min \n",
+ "Wda = Qda-Eda # Work transfer along the path da in kJ/min\n",
+ "\n",
+ "print \"\\n Example 4.3\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "M = [[Qab, Wab, Eab] , [Qbc, Wbc, Ebc], [Qcd, Wcd, Ecd], [Qda, Wda, Eda]]\n",
+ "print\"The completed table is:\",M \n",
+ "W = Qab+Qbc+Qcd+Qda \n",
+ "print \"\\n Net rate of work output is \",W/60 ,\" kW\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex4.4:pg-75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 4.4\n",
+ "\n",
+ " Part A:\n",
+ "\n",
+ " For the quasi static process is: \n",
+ " \n",
+ "Q: 37.2676405731 kJ\n",
+ "\n",
+ " dU: -92.1338891945 kJ\n",
+ "\n",
+ " W: 129.4 kJ \n",
+ "\n",
+ " Part B:\n",
+ "\n",
+ " Work transfer for the process is 122.13 kJ.\n",
+ "\n",
+ "\n",
+ " Part C:\n",
+ "\n",
+ " Wb is not equal to integral(p*dv) since the process is not quasi static.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Part (a)\n",
+ "\n",
+ "m = 3 # mass of substance in kg\n",
+ "V1 = 0.22 # Initial volume of system in m**3\n",
+ "P1 = 500 # Initial pressure of system in kPa\n",
+ "P2 = 100 # Final pressure of system in kPa \n",
+ "V2 = V1*(P1/P2)**(1/1.2) # Final volume of system\n",
+ "dU = 3.56*(P2*V2-P1*V1) # Change in internal energy of substance in kJ/kg\n",
+ "n = 1.2 # polytropic index\n",
+ "W = (P2*V2-P1*V1)/(1-n) # work done in process\n",
+ "Q = dU+W # Heat addition in process\n",
+ "\n",
+ "print \"\\n Example 4.4\"\n",
+ "print \"\\n Part A:\"\n",
+ "print \"\\n For the quasi static process is: \\n \"\n",
+ "print \"Q: \",Q ,\"kJ\"\n",
+ "print \"\\n dU: \",dU ,\"kJ\"\n",
+ "print \"\\n W: \",round(W,2) ,\"kJ\",\n",
+ "\n",
+ "#The provided in the textbook is wrong\n",
+ "\n",
+ "# Part (b)\n",
+ "\n",
+ "print \"\\n\\n Part B:\"\n",
+ "Qb = 30 # heat transfer in kJ\n",
+ "Wb = Qb-dU # Work done in kJ\n",
+ "print \"\\n Work transfer for the process is \",round(Wb,2) ,\"kJ.\" \n",
+ "#The answers vary due to round off error\n",
+ "# Part (c)\n",
+ "\n",
+ "print \"\\n\\n Part C:\"\n",
+ "print \"\\n Wb is not equal to integral(p*dv) since the process is not quasi static.\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex4.5:pg-76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 4.5\n",
+ "\n",
+ " The work done by the system is 8.55 kJ\n",
+ "\n",
+ " The heat flow into the system is 68.085 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "from scipy.integrate import quad\n",
+ "V1 = 0.03 # initial volume in m**3\n",
+ "\n",
+ "P1 = 170.0 # Initial pressure in kPa\n",
+ "\n",
+ "P2 = 400.0 # Final pressure in kPa\n",
+ "\n",
+ "V2 = 0.06 # Final volume in m**3\n",
+ "\n",
+ "U = 3.15*(P2*V2-P1*V1) # internal energy in kJ\n",
+ "\n",
+ "b = np.matrix([P1, P2])\n",
+ "\n",
+ "B=b.transpose()\n",
+ "\n",
+ "A = np.matrix([[1,V1],[1,V2]]) \n",
+ "\n",
+ "x = A.getI()*B \n",
+ "\n",
+ "a = x[0] ; b = x[1] \n",
+ "\n",
+ "def pressure(V): \n",
+ " P = a+b*V\n",
+ " return P\n",
+ "\n",
+ " endfunction \n",
+ "\n",
+ "W, err = quad(pressure, V1, V2)\n",
+ " \n",
+ "#W = integrate(pressure,V1,V2) \n",
+ " \n",
+ "Q = U+W # heat flow into the system in kJ\n",
+ " \n",
+ "print \"\\n Example 4.5\"\n",
+ " \n",
+ "print \"\\n The work done by the system is \",W ,\" kJ\"\n",
+ " \n",
+ "print \"\\n The heat flow into the system is \",Q ,\" kJ\"\n",
+ " \n",
+ " "
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter5_He9TCwH.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter5_He9TCwH.ipynb
new file mode 100644
index 00000000..ce4f45c9
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter5_He9TCwH.ipynb
@@ -0,0 +1,465 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 05:First law applied to Flow Processes"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex5.1:pg-97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 5.1\n",
+ "\n",
+ " The rate of work input is 116.0 kW\n",
+ "\n",
+ " The ratio of the inlet pipe diameter and outet pipe diameter is 0.0 \n"
+ ]
+ }
+ ],
+ "source": [
+ "# Part(a)\n",
+ "import math\n",
+ "V1 = 0.95 # Inlet volume flow rate in m**3/kg\n",
+ "\n",
+ "P1 = 100 # Pressure at inlet in kPa\n",
+ "\n",
+ "v1 = 7 # velocity of flow at inlet in m/s\n",
+ "\n",
+ "V2 = 0.19 # Exit volume flow rate in m**3/kg\n",
+ "\n",
+ "P2 = 700 # Pressure at exit in kPa \n",
+ "\n",
+ "v2 = 5 # velocity of flow at exit in m/s\n",
+ "\n",
+ "w = 0.5 # mass flow rate in kg/s\n",
+ "\n",
+ "u21 = 90 # change in internal energy in kJ/kg\n",
+ "\n",
+ "Q = -58 # Heat transfer in kW\n",
+ "\n",
+ "W = - w*( u21 + (P2*V2-P1*V1) + ((v2**2-v1**2)/2) ) + Q # W = dW/dt \n",
+ "\n",
+ "print \"\\n Example 5.1\"\n",
+ "\n",
+ "print \"\\n The rate of work input is \",abs(W) ,\" kW\"\n",
+ "\n",
+ "#The answers given in textbook is wrong\n",
+ "\n",
+ "# Part (b)\n",
+ "\n",
+ "A = (v2/v1)*(V1/V2) # A = A1/A2\n",
+ "\n",
+ "d_ratio = math.sqrt(A) # d = d1/d2\n",
+ "\n",
+ "print \"\\n The ratio of the inlet pipe diameter and outet pipe diameter is \",d_ratio ,\" \"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex5.2:pg-98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 5.2\n",
+ "\n",
+ " The internal energy decreases by 20.0 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "V1 = 0.37 # volume flow rate at inlet in m**3/kg\n",
+ "\n",
+ "P1 = 600# Inlet pressure in kPa\n",
+ "\n",
+ "v1 = 16 # Inlet velocity of flow in m/s\n",
+ "\n",
+ "V2 = 0.62 # volume flow rate at exit in m**3/kg \n",
+ "\n",
+ "P2 = 100# Exit pressure in kPa\n",
+ "\n",
+ "v2 = 270 # Exit velocity of flow in m/s\n",
+ "\n",
+ "Z1 = 32 # Height of inlet port from datum in m\n",
+ "\n",
+ "Z2 = 0 #Height of exit port from datum in m\n",
+ "\n",
+ "g = 9.81 # Acceleration due to gravity\n",
+ "\n",
+ "Q = -9 # Heat transfer in kJ/kg\n",
+ "\n",
+ "W = 135 # Work transfer in kJ/kg\n",
+ "\n",
+ "U12 = (P2*V2-P1*V1) + ((v2**2-v1**2)/2000) + (Z2-Z1)*g*1e-3 + W - Q # Change in internal energy in kJ\n",
+ "\n",
+ "\n",
+ "\n",
+ "print \"\\n Example 5.2\"\n",
+ "\n",
+ "print \"\\n The internal energy decreases by \",round(U12) ,\" kJ\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex5.3:pg-99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 5.3\n",
+ "\n",
+ " The steam flow rate is 53.5854836932 Kg/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "P1 = 4 # Boiler pressure in MPa\n",
+ "\n",
+ "t1 = 400 # Exit temperature at boiler in degree Celsius\n",
+ "\n",
+ "h1 = 3213 # Enthalpy at boiler exit in kJ/kg\n",
+ "\n",
+ "V1 = 0.073 # specific volume at boiler exit in m**3/kg\n",
+ "\n",
+ "P2 = 3.5 # Pressure at turbine end in MPa\n",
+ "\n",
+ "t2 = 392 # Turbine exit temperature in degree Celsius\n",
+ "\n",
+ "h2 = 3202 # Enthalpy at turbine exit in kJ/kg\n",
+ "\n",
+ "V2 = 0.084 # specific volume at turbine exit in m**3/kg\n",
+ "\n",
+ "Q = -8.5 # Heat loss from pipeline in kJ/kg\n",
+ "\n",
+ "v1 = math.sqrt((2*(h1-h2+Q)*1e3)/(1.15**2-1)) # velocity of flow in m/s\n",
+ "\n",
+ "A1 = (math.pi/4)*0.2**2 # Area of pipe in m**2\n",
+ "\n",
+ "w = (A1*v1)/V1 # steam flow rate in Kg/s\n",
+ "\n",
+ "\n",
+ "\n",
+ "print \"\\n Example 5.3\"\n",
+ "\n",
+ "print \"\\n The steam flow rate is \",w ,\" Kg/s\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex5.4:pg-100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 5.4\n",
+ "\n",
+ " The amount of heat that should be supplied is 703.880549402 Kg/h\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "h1 = 313.93 # Enthalpy of water at heater inlet in kJ/kg\n",
+ "\n",
+ "h2 = 2676 # Enthalpy of hot water at temperature 100.2 degree Celsius\n",
+ "\n",
+ "h3 = 419 #Enthalpy of water at heater inlet in kJ/kg\n",
+ "\n",
+ "w1 = 4.2 # mass flow rate in kg/s\n",
+ "\n",
+ "\n",
+ "\n",
+ "print \"\\n Example 5.4\"\n",
+ "\n",
+ "w2 = w1*(h3-h1)/(h2-h3)# Steam rate \n",
+ "\n",
+ "print \"\\n The amount of heat that should be supplied is \",w2*3600 ,\" Kg/h\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex5.5:pg-100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 5.5\n",
+ "\n",
+ " The rate of heat transfer to the air in the heat exchanger is 1577.85 kJ/s\n",
+ "\n",
+ " The power output from the turbine assuming no heat loss is 298 kW\n",
+ "\n",
+ " The velocity at the exit of the nozzle is 552.358579186 m/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "t1 = 15 # Heat exchanger inlet temperature in degree Celsius\n",
+ "\n",
+ "t2 = 800 # Heat exchanger exit temperature in degree Celsius\n",
+ "\n",
+ "t3 = 650 # Turbine exit temperature in degree Celsius\n",
+ "\n",
+ "t4 = 500 # Nozzle exit temperature in degree Celsius\n",
+ "\n",
+ "v1 = 30 # Velocity of steam at heat exchanger inlet in m/s\n",
+ "\n",
+ "v2 = 30# Velocity of steam at turbine inlet in m/s\n",
+ "\n",
+ "v3 = 60 # Velocity of steam at nozzle inlet in m/s\n",
+ "\n",
+ "w = 2 # mass flow rate in kg/s\n",
+ "\n",
+ "cp = 1005 # Specific heat capacity of air in kJ/kgK\n",
+ "\n",
+ "\n",
+ "\n",
+ "print \"\\n Example 5.5\"\n",
+ "\n",
+ "Q1_2 = w*cp*(t2-t1) # rate of heat transfer\n",
+ "\n",
+ "print \"\\n The rate of heat transfer to the air in the heat exchanger is \",Q1_2/1e3 ,\" kJ/s\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "W_T = w*( ((v2**2-v3**2)/2) + cp*(t2-t3)) # power output from the turbine\n",
+ "\n",
+ "print \"\\n The power output from the turbine assuming no heat loss is \",W_T/1000 ,\" kW\"\n",
+ "\n",
+ "v4 = math.sqrt( (v3**2) + (2*cp*(t3-t4)) ) # velocity at the exit of the nozzle\n",
+ "\n",
+ "print \"\\n The velocity at the exit of the nozzle is \",v4 ,\" m/s\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex5.6:pg-102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 5.6\n",
+ "\n",
+ " Velocity of exhaust gas is 541.409855832 m/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "ha = 260 # Enthalpy of air in kJ/kg\n",
+ "\n",
+ "hg = 912 # Enthalpy of gas in kJ/kg\n",
+ "\n",
+ "Va = 270 # Velocity of air in m/s\n",
+ "\n",
+ "wf = 0.0190 # mass of fuel in Kg\n",
+ "\n",
+ "wa = 1 # mass of air in Kg\n",
+ "\n",
+ "Ef = 44500 # Chemical energy of fuel in kJ/kg\n",
+ "\n",
+ "Q = 21 # Heat loss from the engine in kJ/kg\n",
+ "\n",
+ "\n",
+ "\n",
+ "print \"\\n Example 5.6\"\n",
+ "\n",
+ "Eg = 0.05*wf*Ef/(1+wf) # As 5% of chemical energy is not released in reaction\n",
+ "\n",
+ "wg = wa+wf # mass of flue gas\n",
+ "\n",
+ "Vg = math.sqrt(2000*(((ha+(Va**2*0.001)/2+(wf*Ef)-Q)/(1+wf))-hg-Eg)) \n",
+ "\n",
+ "\n",
+ "\n",
+ "print \"\\n Velocity of exhaust gas is \",Vg ,\" m/s\"\n",
+ "\n",
+ "#Answer given in textbook is wrong\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex5.8:pg-103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 5.8\n",
+ "\n",
+ " The rate at which air flows out of the tank is 0.85 kg/h\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "\n",
+ "V = 0.12 # Volume of tank in m**3\n",
+ "\n",
+ "p = 1 # Pressure in MPa\n",
+ "\n",
+ "T = 150 # Temperature in degree centigrade\n",
+ "\n",
+ "P = 0.1 # Power to peddle wheel in kW\n",
+ "\n",
+ "print \"\\n Example 5.8\"\n",
+ "\n",
+ "u0 = 0.718*273 # Internal energy at 0 degree Celsius\n",
+ "\n",
+ "# Function for internal energy of gas\n",
+ "\n",
+ "def f1(t):\n",
+ " u = u0+(0.718*t)\n",
+ " pv = 0.287*(273+t)\n",
+ " return (u,pv)\n",
+ " \n",
+ "U,PV=f1(T)\n",
+ " \n",
+ " \n",
+ "hp = U+PV # At 150 degree centigrade\n",
+ "m_a = P/hp\n",
+ " \n",
+ "print \"\\n The rate at which air flows out of the tank is \",round(m_a*3600,2) ,\" kg/h\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter6_569mm1H.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter6_569mm1H.ipynb
new file mode 100644
index 00000000..169d80e5
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter6_569mm1H.ipynb
@@ -0,0 +1,365 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 06:Second Law of Thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex6.1:pg-138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 6.1\n",
+ "\n",
+ " Least rate of heat rejection is 0 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T1 = 800 # Source temperature in degree Celsius\n",
+ "\n",
+ "T2 = 30 # Sink temperature in degree Celsius\n",
+ "\n",
+ "e_max = 1-((T2+273)/(T1+273)) # maximum possible efficiency \n",
+ "\n",
+ "Wnet = 1 # in kW\n",
+ "\n",
+ "Q1 = Wnet/e_max # Least rate of heat required in kJ/s\n",
+ "\n",
+ "Q2 = Q1-Wnet # Least rate of heat rejection kJ/s\n",
+ "\n",
+ "\n",
+ "\n",
+ "print \"\\n Example 6.1\"\n",
+ "\n",
+ "print \"\\n Least rate of heat rejection is \",Q2,\" kW\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex6.2:pg-139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 6.2\n",
+ "\n",
+ " Least Power necessary to pump the heat out is 0.31 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T1 = -15 # Source temperature in degree Celsius\n",
+ "\n",
+ "T2 = 30 # Sink temperature in degree Celsius\n",
+ "\n",
+ "Q2 = 1.75 # in kJ/sec\n",
+ "\n",
+ "print \"\\n Example 6.2\"\n",
+ "\n",
+ "W= Q2*((T2+273)-(T1+273))/(T1+273) # Least Power necessary to pump the heat out\n",
+ "\n",
+ "print \"\\n Least Power necessary to pump the heat out is \",round(W,2),\"kW\"\n",
+ " \n",
+ " #The answers vary due to round off error\n",
+ " \n",
+ " "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex6.3:pg-140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 6.3\n",
+ "\n",
+ "\n",
+ " Part A:\n",
+ "\n",
+ " The heat transfer to refrigerant is 0.0 kJ\n",
+ "\n",
+ " The heat rejection to the 40 degree reservoir is 8200.0 kJ\n",
+ "\n",
+ "\n",
+ " Part B:\n",
+ "\n",
+ " The heat transfer to refrigerant is 1200.0 kJ\n",
+ "\n",
+ " The heat rejection to the 40 degree reservoir is 2344.0 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#Given \n",
+ "\n",
+ "T1 = 600 # Source temperature of heat engine in degree Celsius\n",
+ "\n",
+ "T2 = 40 # Sink temperature of heat engine in degree Celsius \n",
+ "\n",
+ "T3 = -20 # Source temperature of refrigerator in degree Celsius\n",
+ "\n",
+ "Q1 = 2000 # Heat transfer to heat engine in kJ\n",
+ "\n",
+ "W = 360 # Net work output of plant in kJ\n",
+ "\n",
+ "# Part (a)\n",
+ "\n",
+ "e_max = 1.0-((T2+273)/(T1+273)) # maximum efficiency \n",
+ "\n",
+ "W1 = e_max*Q1 # maximum work output \n",
+ "\n",
+ "COP = (T3+273)/((T2-273)-(T3-273)) # coefficient of performance of refrigerator\n",
+ "\n",
+ "W2 = W1-W # work done to drive refrigerator \n",
+ "\n",
+ "Q4 = COP*W2 # Heat extracted by refrigerator\n",
+ "\n",
+ "Q3 = Q4+W2 # Heat rejected by refrigerator\n",
+ "\n",
+ "Q2 = Q1-W1 # Heat rejected by heat engine\n",
+ "\n",
+ "Qt = Q2+Q3 # combined heat rejection by heat engine and refrigerator \n",
+ "\n",
+ "print \"\\n Example 6.3\"\n",
+ "\n",
+ "print \"\\n\\n Part A:\"\n",
+ "\n",
+ "print \"\\n The heat transfer to refrigerant is \",round(Q2,3) ,\" kJ\"\n",
+ "\n",
+ "print \"\\n The heat rejection to the 40 degree reservoir is \",round(Qt,3) ,\" kJ\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "# Part (b)\n",
+ "\n",
+ "print \"\\n\\n Part B:\"\n",
+ "\n",
+ "e_max_ = 0.4*e_max # maximum efficiency\n",
+ "\n",
+ "W1_ = e_max_*Q1 # maximum work output \n",
+ "\n",
+ "W2_ = W1_-W # work done to drive refrigerator \n",
+ "\n",
+ "COP_ = 0.4*COP # coefficient of performance of refrigerator\n",
+ "\n",
+ "Q4_ = COP_*W2_ # Heat extracted by refrigerator\n",
+ "\n",
+ "Q3_ = Q4_+W2_ # Heat rejected by refrigerator\n",
+ "\n",
+ "Q2_ = Q1-W1_ # Heat rejected by heat engine\n",
+ "\n",
+ "QT = Q2_+Q3_# combined heat rejection by heat engine and refrigerator \n",
+ "\n",
+ "print \"\\n The heat transfer to refrigerant is \",round(Q2_,3) ,\" kJ\"\n",
+ "\n",
+ "print \"\\n The heat rejection to the 40 degree reservoir is \",round(QT,3) ,\" kJ\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex6.5:pg-142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 6.5\n",
+ "\n",
+ " The multiplication factor is 6\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T1 = 473 # Boiler temperature in K\n",
+ "\n",
+ "T2 = 293 # Home temperature in K\n",
+ "\n",
+ "T3 = 273 # Outside temperature in K\n",
+ "\n",
+ "print \"\\n Example 6.5\"\n",
+ "\n",
+ "MF = (T2*(T1-T3))/(T1*(T2-T3)) \n",
+ "\n",
+ "print \"\\n The multiplication factor is \",MF \n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex6.6:pg-144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 6.6\n",
+ "\n",
+ " Minimum area required for the collector plate is 10.0 m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T1 = 90.0 # Operating temperature of power plant in degree Celsius \n",
+ "\n",
+ "T2 = 20.0 # Atmospheric temperature in degree Celsius\n",
+ "\n",
+ "W = 1.0 # Power production from power plant in kW\n",
+ "\n",
+ "E = 1880 # Capability of energy collection in kJ/m**2 h\n",
+ "\n",
+ "\n",
+ "\n",
+ "print \"\\n Example 6.6\"\n",
+ "\n",
+ "e_max = 1.0-((T2+273.0)/(T1+273.0)) # maximum efficiency\n",
+ "\n",
+ "Qmin = W/e_max # Minimum heat requirement per second\n",
+ "\n",
+ "Qmin_ = Qmin*3600.0 # Minimum heat requirement per hour\n",
+ "\n",
+ "Amin = Qmin_/E # Minimum area requirement\n",
+ "\n",
+ "print \"\\n Minimum area required for the collector plate is \",math. ceil(Amin) ,\" m**2\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex6.7:pg-144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 6.7\n",
+ "\n",
+ " Area of the panel 0.167221895617 m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T1 = 1000 # Temperature of hot reservoir in K\n",
+ "\n",
+ "W = 1000 # Power requirement in kW\n",
+ "\n",
+ "K = 5.67e-08 # constant \n",
+ "\n",
+ "print \"\\n Example 6.7\"\n",
+ "\n",
+ "Amin = (256*W)/(27*K*T1**4) # minimum area required\n",
+ "\n",
+ "print \"\\n Area of the panel \",Amin ,\" m**2\"\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter7_uRawaHX.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter7_uRawaHX.ipynb
new file mode 100644
index 00000000..a84c6d65
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter7_uRawaHX.ipynb
@@ -0,0 +1,453 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 07: Entropy"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex7.1:pg-191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 7.1\n",
+ "\n",
+ " Change in entropy of the water is 0.0271 kJ/K\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "import math\n",
+ "T1 = 37.0 # Final water temperature in degree Celsius \n",
+ "T2 = 35.0 # Initial water temperature in degree Celsius \n",
+ "m = 1.0 # Mass of water in kg\n",
+ "cv = 4.187 # Specific heat capacity of water in kJ/kgK\n",
+ "print \"\\n Example 7.1\"\n",
+ "S = m*cv*math.log((T1+273)/(T2+273)) # Change in entropy of the water\n",
+ "print \"\\n Change in entropy of the water is \",round(S,4) ,\" kJ/K\"\n",
+ "#The answer provided in the textbook is wrong\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex7.2:pg-192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 7.2\n",
+ "\n",
+ " The entropy change of the universe is -1.12252010724 kJ/K\n",
+ "\n",
+ " The entropy change of the universe is -1.20940246848 kJ/K\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Part (a)\n",
+ "T1 = 273 # Initial temperature of water in Kelvin\n",
+ "T2 = 373 # Temperature of heat reservoir in Kelvin\n",
+ "m = 1 # Mass of water in kg\n",
+ "cv = 4.187 # Specific heat capacity of water\n",
+ "\n",
+ "print \"\\n Example 7.2\"\n",
+ "Ss = m*cv*math.log(T2/T1) # entropy change of water\n",
+ "Q = m*cv*(T2-T1) # Heat transfer \n",
+ "Sr = -(Q/T2) # Entropy change of universe\n",
+ "S = Ss+Sr # Total entropy change\n",
+ "\n",
+ "print \"\\n The entropy change of the universe is \",S ,\" kJ/K\"\n",
+ "\n",
+ "# Part (b)\n",
+ "T3 = 323 # Temperature of intermediate reservoir in K\n",
+ "Sw = m*cv*(math.log(T3/T1)+math.log(T2/T3)) # entropy change of water\n",
+ "Sr1 = -m*cv*(T3-T1)/T3 # Entropy change of universe\n",
+ "Sr2 = -m*cv*(T2-T3)/T2 # Entropy change of universe\n",
+ "Su = Sw+Sr1+Sr2 # Total entropy change\n",
+ "print \"\\n The entropy change of the universe is \",Su ,\" kJ/K\"\n",
+ "#The answers vary due to round off error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex7.3:pg-193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 7.3\n",
+ "\n",
+ " The entropy change of the universe is -0.238182312568 kJ/K\n",
+ "\n",
+ " The minimum work required is -69.7874175824 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "m = 1 # Mass of ice in kg\n",
+ "\n",
+ "T1 = -5 # Initial temperature of ice in degree Celsius\n",
+ "\n",
+ "T2 = 20# Atmospheric temperature in degree Celsius\n",
+ "\n",
+ "T0 = 0# Phase change temperature of ice in degree Celsius\n",
+ "\n",
+ "cp = 2.093 # Specific heat capacity of ice in kJ/kgK\n",
+ "\n",
+ "cv = 4.187 # Specific heat capacity of water in kJ/kgK\n",
+ "\n",
+ "lf = 333.3 # Latent heat of fusion in kJ/kgK\n",
+ "\n",
+ "\n",
+ "\n",
+ "print \"\\n Example 7.3\"\n",
+ "\n",
+ "Q = m*cp*(T0-T1)+1*333.3+m*cv*(T2-T0) # Net heat transfer\n",
+ "\n",
+ "Sa = -Q/(T2+273) # Entropy change of surrounding\n",
+ "\n",
+ "Ss1 = m*cp*math.log((T0+273)/(T1+273)) # entropy change during \n",
+ "\n",
+ "Ss2 = lf/(T0+273) # Entropy change during phase change\n",
+ "\n",
+ "Ss3 = m*cv*math.log((T2+273)/(T0+273)) # entropy change of water\n",
+ "\n",
+ "St = Ss1+Ss2+Ss3 # total entropy change of ice to convert into water at atmospheric temperature\n",
+ "\n",
+ "Su = St+Sa # Net entropy change of universe\n",
+ "\n",
+ "print \"\\n The entropy change of the universe is \",Su ,\" kJ/K\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "#The answer provided in the textbook is wrong\n",
+ "\n",
+ "# Part (b)\n",
+ "\n",
+ "S = St # Entropy change of system\n",
+ "\n",
+ "Wmin = (T2+273)*(S)-Q # minimum work required\n",
+ "\n",
+ "print \"\\n The minimum work required is \",Wmin ,\" kJ\"\n",
+ "\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex7.7:pg-200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 7.7\n",
+ "\n",
+ " Change in enthalpy is 223.48 kJ\n",
+ "\n",
+ " Change in internal energy is 171.91 kJ\n",
+ "\n",
+ " The change in entropy and heat transfer are is 0 kJ\n",
+ "\n",
+ " The work transfer during the process is -171.91 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "P1 = 0.5 # Initial pressure in MPa\n",
+ "\n",
+ "V1 = 0.2 # Initial volume in m**3\n",
+ "\n",
+ "V2 = 0.05 # Final volume in m**3\n",
+ "\n",
+ "n = 1.3 # Polytropic index\n",
+ "\n",
+ "\n",
+ "\n",
+ "from scipy import integrate \n",
+ "\n",
+ "print \"\\n Example 7.7\"\n",
+ "\n",
+ "P2 = P1*(V1/V2)**n \n",
+ "\n",
+ "def f(p):\n",
+ " y = ((P1*V1**n)/p)**(1/n) \n",
+ " return y\n",
+ " \n",
+ "\n",
+ " \n",
+ "H, err = integrate.quad(f,P1,P2) # H = H2-H1\n",
+ "\n",
+ "U = H-(P2*V2-P1*V1) \n",
+ " \n",
+ "W12 = -U \n",
+ " \n",
+ "print \"\\n Change in enthalpy is \",round(H*1e3,2),\" kJ\"\n",
+ " \n",
+ "print \"\\n Change in internal energy is \",round(U*1000,2),\" kJ\"\n",
+ " \n",
+ "print \"\\n The change in entropy and heat transfer are is \",0 ,\" kJ\"\n",
+ " \n",
+ "print \"\\n The work transfer during the process is \",round(W12*1000,2) ,\" kJ\"\n",
+ " \n",
+ " #The answers vary due to round off error\n",
+ " \n",
+ " "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex7.8:pg-201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 7.8\n",
+ "\n",
+ " Change in the entropy of the universe is -1.2785104723 kJ/Kg K\n",
+ "\n",
+ " As the change in entropy of the universe in the process A-B is negative \n",
+ " so the flow must be from B-A\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "import math\n",
+ "from scipy import integrate \n",
+ "\n",
+ "\n",
+ "Pa = 130.0 # Pressure at station A in kPa\n",
+ "\n",
+ "Pb = 100.0# Pressure at station B in kPa\n",
+ "\n",
+ "Ta = 50.0 # Temperature at station A in degree Celsius\n",
+ "\n",
+ "Tb = 13.0# Temperature at station B in degree Celsius\n",
+ "\n",
+ "cp = 1.005 # Specific heat capacity of air in kJ/kgK\n",
+ "\n",
+ "x= lambda t:cp/t\n",
+ "y= lambda p:0.287/p\n",
+ "\n",
+ "print \"\\n Example 7.8\"\n",
+ "\n",
+ "Sb,error = integrate.quad(x,Ta,Tb)#-\n",
+ "Sa,eror=integrate.quad(y,Pa,Pb) \n",
+ "\n",
+ "Ss=Sb-Sa\n",
+ "Ssur=0 \n",
+ "Su = Ss+Ssur\n",
+ "\n",
+ "print \"\\n Change in the entropy of the universe is \",Su ,\" kJ/Kg K\"\n",
+ "\n",
+ "#The answers given in the book is wrong\n",
+ "\n",
+ "print \"\\n As the change in entropy of the universe in the process A-B is negative \\n so the flow must be from B-A\"\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex7.9:pg-202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 7.9\n",
+ "\n",
+ " The entropy generated during the process is 0.785677602261 kW/K\n",
+ "\n",
+ " As the entropy generated is positive so such device is possible\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T1 = 300.0 # Inlet temperature of air in K\n",
+ "\n",
+ "T2 = 330.0 # Exit temperature of first air stream in K\n",
+ "\n",
+ "T3 = 270.0 # Exit temperature of second air stream in K\n",
+ "\n",
+ "P1 = 4.0 # Pressure of inlet air stream in bar\n",
+ "\n",
+ "P2 =1.0 # Pressure of first exit air stream in bar\n",
+ "\n",
+ "P3 =1.0 # Pressure of second exit air stream in bar\n",
+ "\n",
+ "cp = 1.0005 # Specific heat capacity of air in kJ/kgK\n",
+ "\n",
+ "R = 0.287 # Gas constant\n",
+ "\n",
+ "\n",
+ "\n",
+ "print \"\\n Example 7.9\"\n",
+ "\n",
+ "S21 = cp*math.log(T2/T1)-R*math.log(P2/P1) # Entropy generation\n",
+ "\n",
+ "S31 = cp*math.log(T3/T1)-R*math.log(P3/P1) # Entropy generation\n",
+ "\n",
+ "Sgen = (1.0*S21) + (1.0*S31) # Total entropy generation\n",
+ "\n",
+ "print \"\\n The entropy generated during the process is \",Sgen ,\" kW/K\"\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n",
+ "\n",
+ "\n",
+ "print \"\\n As the entropy generated is positive so such device is possible\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex7.10:pg-203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 7.10\n",
+ "\n",
+ " The rate of heat transfer through the wall is 1164.84375 W\n",
+ "\n",
+ " The rate of entropy through the wall is 0.213013632873 W/K\n",
+ "\n",
+ " The rate of total entropy generation with this heat transfer process is 0.352982954545 W/K\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "A = 5*7 # Area of wall in m**2\n",
+ "k = 0.71# Thermal conductivity in W/mK \n",
+ "L = 0.32 # Thickness of wall in m\n",
+ "Ti = 21 # Room temperature in degree Celsius \n",
+ "To = 6 # Surrounding temperature in degree Celsius\n",
+ "print \"\\n Example 7.10\"\n",
+ "Q = k*A*(Ti-To)/L # Heat transfer\n",
+ "Sgen_wall = Q/(To+273) - Q/(Ti+273) # Entropy generation in wall\n",
+ "print \"\\n The rate of heat transfer through the wall is \",Q ,\" W\"\n",
+ "print \"\\n The rate of entropy through the wall is \",Sgen_wall ,\" W/K\"\n",
+ "Tr = 27 # Inner surface temperature of wall in degree Celsius \n",
+ "Ts = 2 # Outer surface temperature of wall in degree Celsius \n",
+ "Sgen_total = Q/(Ts+273)-Q/(Tr+273) # Total entropy generation in process \n",
+ "print \"\\n The rate of total entropy generation with this heat transfer process is \",Sgen_total ,\" W/K\"\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter8_KEcrcQP.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter8_KEcrcQP.ipynb
new file mode 100644
index 00000000..b0366774
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter8_KEcrcQP.ipynb
@@ -0,0 +1,1023 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 08: Available energy Availability and irreversibility"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.1:pg-249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.1\n",
+ "\n",
+ " The fraction of energy that becomes unavailable due to irreversible heat transfer is 0.260038240918\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T0 = 35.0 # Heat rejection temperature in degree Celsius \n",
+ "T1 = 420 # Vapor condensation temperature in degree Celsius \n",
+ "T1_ = 250 # water vapor temperature in degree Celsius \n",
+ "print \"\\n Example 8.1\"\n",
+ "f = ((T0+273)*((T1+273)-(T1_+273)))/((T1_+273)*((T1+273)-(T0+273)))# fraction of energy lost\n",
+ "print \"\\n The fraction of energy that becomes unavailable due to irreversible heat transfer is \",f \n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.2:pg-250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.2\n",
+ "\n",
+ " Total change in entropy is 2.03990232306 kJ/K\n",
+ "\n",
+ " Increase in unavailable energy is 618.090403887 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "from scipy import integrate\n",
+ "import math\n",
+ "\n",
+ "lhw = 1858.5 # Latent heat of water in kJ/kg\n",
+ "Tew = 220 # Water evaporation temperature in degree Celsius\n",
+ " \n",
+ "Tig = 1100 # Initial temperature of the gas in degree Celsius\n",
+ "Tfg = 550 # Final temperature of the gas in degree Celsius\n",
+ "T0 = 303 # Atmospheric temperature in degree Celsius\n",
+ "Tg2 = 823 \n",
+ "Tg1 = 1373\n",
+ "print \"\\n Example 8.2\"\n",
+ "Sw = lhw/(Tew+273) # Entropy generation in water\n",
+ "Sg,error = integrate.quad(lambda T:3.38/T,Tg1,Tg2)\n",
+ "St = Sg+Sw \n",
+ "print \"\\n Total change in entropy is \",St ,\" kJ/K\"\n",
+ "\n",
+ "print \"\\n Increase in unavailable energy is \",T0*St ,\" kJ\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.4:pg-253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.4\n",
+ "\n",
+ " The decrease in the available energy is 281.816890623 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "from scipy import integrate\n",
+ "Ts_ = 15 # Ambient temperature in degree Celsius\n",
+ "Tw1_ = 95 # Temperature of water sample 1 in degree Celsius\n",
+ "Tw2_ = 35# Temperature of water sample 2 in degree Celsius\n",
+ "m1 = 25 # Mass of water sample 1 in kg\n",
+ "m2 = 35 # Mass of water sample 2 in kg\n",
+ "cp = 4.2 # Specific heat capacity of water in kJ/kgK\n",
+ "print \"\\n Example 8.4\"\n",
+ "Ts = Ts_+273# Ambient temperature in K\n",
+ "Tw1 = Tw1_+273 # Temperature of water sample 1 in K\n",
+ "Tw2 = Tw2_+273# Temperature of water sample 2 in K\n",
+ "AE25,er = integrate.quad(lambda T:m1*cp*(1-(Ts/T)),Ts,Tw1)\n",
+ "AE35,er2 = integrate.quad(lambda T:m2*cp*(1-(Ts/T)),Ts,Tw2)\n",
+ "AEt = AE25 + AE35\n",
+ "Tm = (m1*Tw1+m2*Tw2)/(m1+m2) # Temperature after mixing\n",
+ "AE60,er3 = integrate.quad(lambda T:(m1+m2)*cp*(1-(Ts/T)),Ts,Tm)\n",
+ "AE = AEt - AE60\n",
+ "print \"\\n The decrease in the available energy is \",AE ,\" kJ\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.5:pg-254"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.5\n",
+ "\n",
+ " The final RPM of the flywheel would be 222.168786807 RPM\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "from scipy import integrate\n",
+ "N1 = 3000 # Speed of rotation of flywheel in RPM\n",
+ "I = 0.54 # Moment of inertia of flywheel in kgm**2\n",
+ "ti_ = 15 # Temperature of insulated system in degree Celsius \n",
+ "m = 2 # Water equivalent of shaft \n",
+ "print \"\\n Example 8.5\"\n",
+ "w1 = (2*math.pi*N1)/60 # Angular velocity of rotation in rad/s\n",
+ "Ei = 0.5*I*w1**2 # rotational kinetic energy\n",
+ "dt = Ei/(1000*2*4.187) # temperature change\n",
+ "ti = ti_+273# Temperature of insulated system in Kelvin\n",
+ "tf = ti+dt # final temperature\n",
+ "AE,er = integrate.quad(lambda T: m*4.187*(1-(ti/T)),ti,tf)\n",
+ "UE = Ei/1000 - AE # Unavailable enrgy\n",
+ "w2 = math.sqrt(AE*1000*2/I) # Angular speed in rad/s \n",
+ "N2 = (w2*60)/(2*math.pi) # Speed of rotation in RPM\n",
+ "print \"\\n The final RPM of the flywheel would be \",N2 ,\" RPM\"\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.6:pg-255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.6\n",
+ "\n",
+ " The maximum work is 122.957271378 kJ\n",
+ "\n",
+ " Change in availability is 82.4328713783 kJ\n",
+ "\n",
+ " Irreversibility is 15.2572713783 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "from scipy import integrate\n",
+ "T1_ = 80.0 # Initial temperature of air in degree Celsius \n",
+ "T2_ = 5.0 # Final temperature of air in degree Celsius \n",
+ "V2 = 2.0 # Assumed final volume\n",
+ "V1 = 1.0 # Assumed initial volume\n",
+ "P0 = 100.0 # Final pressure of air in kPa\n",
+ "P1 = 500.0 # Initial pressure of air in kPa\n",
+ "R = 0.287 # Gas constant\n",
+ "cv = 0.718 # Specific heat capacity at constant volume for gas in kJ/kg K\n",
+ "m = 2.0 # Mass of gas in kg\n",
+ "print \"\\n Example 8.6\"\n",
+ "T1= T1_+273 # Initial temperature of air in K \n",
+ "T2 = T2_+273 # Final temperature of air in K \n",
+ "S= integrate.quad(lambda T:(m*cv)/T,T1,T2)[0] + integrate.quad(lambda V: (m*R)/V,V1,V2)[0] # Entropy change\n",
+ "U = m*cv*(T1-T2)# Change in internal energy\n",
+ "Wmax = U-(T2*(-S)) # Maximum possible work\n",
+ "V1_ = (m*R*T1)/P1 # volume calculation\n",
+ "CA = Wmax-P0*(V1_) # Change in availability\n",
+ "I = T2*S # Irreversibility\n",
+ "print \"\\n The maximum work is \",Wmax ,\" kJ\"\n",
+ "print \"\\n Change in availability is \",CA ,\" kJ\"\n",
+ "print \"\\n Irreversibility is \",I ,\" kJ\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.7:pg-256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.7\n",
+ "\n",
+ " The decrease in availability is 260.756521108 kJ/kg\n",
+ "\n",
+ " The maximum work is 260.756521108 kJ/kg\n",
+ "\n",
+ " The irreversibility is 49.6565211082 kJ/kg\n",
+ "\n",
+ " Alternatively, The irreversibility is 49.6565211082 kJ/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "P1 = 500.0 # Initial pressure of steam in kPa\n",
+ "P2 = 100.0# Final pressure of steam in kPa\n",
+ "T1_ = 520.0 #Initial temperature of steam in degree Celsius\n",
+ "T2_ = 300.0 #Final temperature of steam in degree Celsius\n",
+ "cp = 1.005 # Specific heat capacity of steam in kJ/kgK\n",
+ "t0 = 20.0 # Atmospheric temperature in degree Celsius \n",
+ "R = 0.287 # Gas constant\n",
+ "Q = -10.0 # Heat loss to surrounding in kJ/kg\n",
+ "print \"\\n Example 8.7\"\n",
+ "T1 = T1_+273 #Initial temperature of steam in degree Celsius\n",
+ "T2 = T2_+273 #Final temperature of steam in degree Celsius\n",
+ "S21 = (R*math.log(P2/P1))-(cp*math.log(T2/T1))\n",
+ "T0 = t0+273\n",
+ "CA = cp*(T1-T2)-T0*S21 # Change in availability\n",
+ "Wmax = CA # Maximum possible work\n",
+ "W = cp*(T1-T2)+Q # net work\n",
+ "I = Wmax-W # Irreversibility\n",
+ "# Altenatively\n",
+ "Ssystem = -Q/T0\n",
+ "Ssurr = -S21\n",
+ "I1 = T0*(Ssystem+Ssurr)\n",
+ "print \"\\n The decrease in availability is \",CA ,\" kJ/kg\"\n",
+ "print \"\\n The maximum work is \",Wmax ,\" kJ/kg\"\n",
+ "print \"\\n The irreversibility is \",I ,\" kJ/kg\"\n",
+ "print \"\\n Alternatively, The irreversibility is \",I1 ,\" kJ/kg\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.8:pg-258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.8\n",
+ "\n",
+ " The initial and final availbility of the products are 85.9672398469 kJ/Kg and 39.6826771757 kJ/Kg respectively\n",
+ "\n",
+ " The irreversibility of the process is 319.369801955 kW\n",
+ "\n",
+ " Total power generated by the heat engine is 472.671938045 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T0 = 300.0 # Atmospheric temperature in K\n",
+ "Tg1_ = 300.0 # Higher temperature of combustion product in degree Celcius\n",
+ "Tg2_ = 200.0 # Lower temperature of combustion product in degree Celcius\n",
+ "Ta1 = 40.0 # Initial air temperature in K\n",
+ "cpg = 1.09 # Specific heat capacity of combustion gas in kJ/kgK\n",
+ "cpa = 1.005# Specific heat capacity of air in kJ/kgK\n",
+ "mg = 12.5 # mass flow rate of product in kg/s\n",
+ "ma = 11.15# mass flow rate of air in kg/s\n",
+ "\n",
+ "print \"\\n Example 8.8\"\n",
+ "Tg1 = Tg1_+273 # Higher temperature of combustion product in K\n",
+ "Tg2 = Tg2_+273 # Lower temperature of combustion product in K\n",
+ "f1 = cpg*(Tg1-T0)-T0*cpg*(math.log(Tg1/T0)) # Initial availability of product\n",
+ "f2 = cpg*(Tg2-T0)-T0*cpg*(math.log(Tg2/T0)) # Final availabilty of product\n",
+ "print \"\\n The initial and final availbility of the products are \",f1 ,\" kJ/Kg and \",f2 ,\" kJ/Kg respectively\"\n",
+ "#The answer provided in the textbook is wrong\n",
+ "\n",
+ "# Part (b)\n",
+ "Dfg = f1-f2 # Decrease in availability of products\n",
+ "Ta2 = (Ta1+273) + (mg/ma)*(cpg/cpa)*(Tg1-Tg2) # Exit temperature of air\n",
+ "Ifa = cpa*(Ta2-(Ta1+273))-T0*cpa*(math.log(Ta2/(Ta1+273))) # Increase in availability of air\n",
+ "I = mg*Dfg-ma*Ifa # Irreversibility \n",
+ "print \"\\n The irreversibility of the process is \",I ,\" kW\"\n",
+ "##The answer provided in the textbook contains round off error\n",
+ "\n",
+ "# Part (c)\n",
+ "Ta2_ = (Ta1+273)*(Tg1/Tg2)**((12.5*1.09)/(11.5*1.005))\n",
+ "Q1 = mg*cpg*(Tg1-Tg2) # Heat supply rate from gas to working fluid\n",
+ "Q2 = ma*cpa*(Ta2_-(Ta1+273))# Heat rejection rate from the working fluid in heat engine\n",
+ "W = Q1-Q2 # Power developed by heat engine\n",
+ "print \"\\n Total power generated by the heat engine is \",W ,\" kW\"\n",
+ "#The answer provided in the textbook contains round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.9:pg-260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.9\n",
+ "\n",
+ " The irreversibility rate is 15.8201795694 kW\n",
+ "\n",
+ " The irreversibility rate at lower temperature is 3.03317755354 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T2 = 790.0 # Final temperature of gas in degree Celsius\n",
+ "T1 = 800.0 # Initial temperature of gas in degree Celsius\n",
+ "m = 2.0 # Mass flow rate in kg/s\n",
+ "cp = 1.1 # Specific heat capacity in kJ/KgK\n",
+ "T0 = 300.0 # Ambient temperature in K\n",
+ "\n",
+ "print \"\\n Example 8.9\"\n",
+ "I = m*cp*(((T1+273)-(T2+273))-T0*(math.log((T1+273)/(T2+273)))) # irreversibility rate\n",
+ "print \"\\n The irreversibility rate is \",I ,\" kW\"\n",
+ "\n",
+ "# At lower temperature\n",
+ "T1_ = 80.0 # Initial temperature of gas in degree Celsius\n",
+ "T2_ = 70.0 # Initial temperature of gas in degree Celsius\n",
+ "I_ = m*cp*(((T1_+273)-(T2_+273))-T0*(math.log((T1_+273)/(T2_+273)))) # irreversibility rate\n",
+ "print \"\\n The irreversibility rate at lower temperature is \",I_ ,\" kW\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.10:pg-261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.10\n",
+ "\n",
+ " The rate of energy loss because of the pressure drop due to friction 25.83 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "m = 3 # Mass flow rate in kg/s\n",
+ "R = 0.287 # Gas constant\n",
+ "T0 = 300 # Ambient temperature in K\n",
+ "k = 0.10 # Fractional pressure drop\n",
+ "print \"\\n Example 8.10\"\n",
+ "Sgen = m*R*k # Entropy generation\n",
+ "I = Sgen*T0 # Irreversibility Calculation\n",
+ "print \"\\n The rate of energy loss because of the pressure drop due to friction \",I ,\" kW\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.11:pg-261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.11\n",
+ "\n",
+ " The rate of entropy generation is 0.0446035560498 kW/K\n",
+ "\n",
+ " The rate of energy loss due to mixing is 13.3810668149 kW\n",
+ "\n",
+ " The rate of energy loss due to mixing is 13.3810668149 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "m1 = 2.0 # Flow rate of water in kg/s\n",
+ "m2 = 1.0 # Flow rate of another stream in kg/s\n",
+ "T1 = 90.0 # Temperature of water in degree Celsius\n",
+ "T2 = 30.0# Temperature of another stream in degree Celsius\n",
+ "T0 =300.0 # Ambient temperature in K\n",
+ "cp = 4.187 # Specific heat capacity of water in kJ/kgK\n",
+ "\n",
+ "print \"\\n Example 8.11\"\n",
+ "m = m1+m2 # Net mass flow rate\n",
+ "x = m1/m # mass fraction\n",
+ "t = (T2+273)/(T1+273) # Temperature ratio\n",
+ "Sgen = m*cp*math.log((x+t*(1-x))/(t**(1-x))) # Entropy generation\n",
+ "I = T0*Sgen # Irreversibility production\n",
+ "# Alternatively\n",
+ "T = (m1*T1+m2*T2)/(m1+m2) # equilibrium temperature\n",
+ "Sgen1 = m1*cp*math.log((T+273)/(T1+273))+m2*cp*math.log((T+273)/(T2+273))# Entropy generation\n",
+ "I1 = T0*Sgen1 # Irreversibility production\n",
+ "print \"\\n The rate of entropy generation is \",Sgen ,\" kW/K\"\n",
+ "print \"\\n The rate of energy loss due to mixing is \",I ,\" kW\"\n",
+ "print \"\\n The rate of energy loss due to mixing is \",I1 ,\" kW\" # Calculation from alternative way\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.12:pg-262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.12\n",
+ " \n",
+ "\n",
+ " PART (A)\n",
+ "\n",
+ " The first law efficiency is 96.0 percent\n",
+ "\n",
+ " The second law efficiency is 79.0588235294 percent\n",
+ " \n",
+ "\n",
+ " PART (B)\n",
+ "\n",
+ " The first law efficiency is 90.0 percent\n",
+ "\n",
+ " The second law efficiency is 42.3529411765 percent\n",
+ " \n",
+ "\n",
+ " PART (C)\n",
+ "\n",
+ " The first law efficiency is 60.0 percent\n",
+ "\n",
+ " The second law efficiency is 4.41176470588 percent\n",
+ " \n",
+ "\n",
+ " PART (D)\n",
+ "\n",
+ " The First law efficiency for all the three cases would remain same and here is 90.0 percent\n",
+ "\n",
+ " The Second law efficiency of part (a) is 74.1176470588 percent\n",
+ "\n",
+ " The Second law efficiency of part (b) is 42.3529411765 percent\n",
+ "\n",
+ " The Second law efficiency of part (c) is 6.61764705882 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "Qr = 500.0 # Heat release in kW\n",
+ "Tr = 2000.0 # Fuel burning temperature in K \n",
+ "T0 = 300.0 # Ambient temperature in K\n",
+ "# Part (a)\n",
+ "print \"\\n Example 8.12\"\n",
+ "Qa = 480.0 # Energy absorption by furnace in kW\n",
+ "Ta = 1000.0 # Furnace temperature in K \n",
+ "n1a = (Qa/Qr) # first law efficiency\n",
+ "n2a = n1a*(1.0-(T0/Ta))/(1.0-(T0/Tr)) #second law efficiency\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "print \" \\n\\n PART (A)\"\n",
+ "print \"\\n The first law efficiency is \",n1a*100 ,\" percent\" \n",
+ "print \"\\n The second law efficiency is \",n2a*100 ,\" percent\"\n",
+ "\n",
+ "# Part (b)\n",
+ "Qb = 450.0 # Energy absorption in steam generation in kW\n",
+ "Tb = 500.0# steam generation temperature in K \n",
+ "n1b = (Qb/Qr)# first law efficiency\n",
+ "n2b = n1b*(1.0-(T0/Tb))/(1.0-(T0/Tr))#second law efficiency\n",
+ "print \" \\n\\n PART (B)\"\n",
+ "print \"\\n The first law efficiency is \",n1b*100 ,\" percent\" \n",
+ "print \"\\n The second law efficiency is \",n2b*100 ,\" percent\"\n",
+ "# Part (c)\n",
+ "Qc = 300.0 # Energy absorption in chemical process in kW\n",
+ "Tc = 320.0 # chemical process temperature in K \n",
+ "n1c = (Qc/Qr) # first law efficiency\n",
+ "n2c = n1c*(1.0-(T0/Tc))/(1.0-(T0/Tr))#second law efficiency\n",
+ "print \" \\n\\n PART (C)\"\n",
+ "print \"\\n The first law efficiency is \",n1c*100 ,\" percent\"\n",
+ "print \"\\n The second law efficiency is \",n2c*100 ,\" percent\" \n",
+ "# Part (d)\n",
+ "Qd = 450.0 \n",
+ "n1d = (Qd/Qr)\n",
+ "n2a_= n1d*(1.0-(T0/Ta))/(1.0-(T0/Tr))\n",
+ "n2b_= n1d*(1.0-(T0/Tb))/(1.0-(T0/Tr))\n",
+ "n2c_= n1d*(1.0-(T0/Tc))/(1.0-(T0/Tr))\n",
+ "print \" \\n\\n PART (D)\"\n",
+ "print \"\\n The First law efficiency for all the three cases would remain same and here is \",n1d*100 ,\" percent\" #The answer provided in the textbook is wrong\n",
+ "\n",
+ "print \"\\n The Second law efficiency of part (a) is \",n2a_*100 ,\" percent\"\n",
+ "\n",
+ "print \"\\n The Second law efficiency of part (b) is \",n2b_*100 ,\" percent\"\n",
+ "\n",
+ "print \"\\n The Second law efficiency of part (c) is \",n2c_*100 ,\" percent\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.14:pg-265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.14\n",
+ "\n",
+ " The power input is -235.675 kW\n",
+ " \n",
+ " The second law efficiency of the compressor is 85.5494233193 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "cp = 1.005 # Specific heat capacity of air in kJ/kgK \n",
+ "T2 = 160.0 # Compressed air temperature in degree Celsius\n",
+ "T1 = 25.0 # Ambient temperature\n",
+ "T0 = 25.0 # Ambient temperature\n",
+ "R = 0.287 # Gas constant\n",
+ "P2 = 8.0 # Pressure ratio\n",
+ "P1 = 1.0 # Initial pressure of gas in bar\n",
+ "Q = -100.0 # Heat loss to surrounding in kW\n",
+ "m = 1.0 # Mass flow rate in kg/s\n",
+ "\n",
+ "print \"\\n Example 8.14\"\n",
+ "W = Q + m*cp*((T1+273)-(T2+273)) # power input\n",
+ "AF = cp*((T2+273)- (T1+273))-(T0+273)*((cp*math.log((T2+273)/(T1+273))-(R*math.log(P2/P1)))) # Availability\n",
+ "e = AF/-W # efficiency \n",
+ "print \"\\n The power input is \",W ,\" kW\"\n",
+ "print \" \\n The second law efficiency of the compressor is \",e*100 ,\" percent\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.15:pg-265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.15\n",
+ "\n",
+ " The exergy of the complete vacuum is 100.0 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Since vacuum has zero mass\n",
+ "U = 0 # Initial internal energy in kJ/kg\n",
+ "H0 = 0 # Initial enthalpy in kJ/kg\n",
+ "S = 0 # Initial entropy in kJ/kgK\n",
+ "# If the vacuum has reduced to dead state\n",
+ "U0 = 0 # Final internal energy in kJ/kg\n",
+ "H0 = 0 # Final enthalpy in kJ/kg\n",
+ "S0 = 0 # Final entropy in kJ/kgK\n",
+ "V0 = 0 # Final volume in m**3\n",
+ "P0 = 1.0 # Pressure in bar\n",
+ "V = 1.0 # Volume of space in m**3\n",
+ "fi = P0*1e5*V\n",
+ "\n",
+ "print \"\\n Example 8.15\"\n",
+ "print \"\\n The exergy of the complete vacuum is \",fi/1e3 ,\" kJ\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.16:pg-266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.16\n",
+ "\n",
+ " Exergy produced is 34.6210270729 MJ or 9.61695196469 kWh\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "m = 1000.0 # Mass of fish in kg \n",
+ "T0 = 300.0 # Ambient temperature in K\n",
+ "P0 = 1.0 # Ambient pressure in bar\n",
+ "T1 = 300.0 # Initial temperature of fish in K\n",
+ "T2_ = -20.0 # Final temperature of fish in degree Celsius\n",
+ "Tf_ = -2.2 # Freezing point temperature of fish in degree Celsius\n",
+ "Cb = 1.7 # Specific heat of fish below freezing point in kJ/kg\n",
+ "Ca = 3.2 # Specific heat of fish above freezing point in kJ/kg\n",
+ "Lh = 235.0 # Latent heat of fusion of fish in kJ/kg \n",
+ "\n",
+ "print \"\\n Example 8.16\"\n",
+ "T2 = T2_+273 # Final temperature of fish in K\n",
+ "Tf = Tf_+273 # Freezing point temperature of fish in K\n",
+ "H12 = m*((Cb*(Tf-T2))+Lh+(Ca*(T1-Tf))) # Enthalpy change \n",
+ "H21 = -H12 # Enthalpy change \n",
+ "S12 = m*((Cb*math.log(Tf/T2))+(Lh/Tf)+(Ca*math.log(T1/Tf))) # Entropy change\n",
+ "S21 = -S12 # Entropy change\n",
+ "E = H21-T0*S21 #Exergy produced\n",
+ "print \"\\n Exergy produced is \",E/1e3 ,\" MJ or \",E/3600 ,\" kWh\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.17:pg-267"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.17\n",
+ "\n",
+ " The irreversibility in case a is 110.031839359 kJ/kg\n",
+ "\n",
+ " The irreversibility in case b is 38.2318393592 kJ/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "cv = 0.718 # Specific heat capacity of air in kJ/kg\n",
+ "T2 = 500.0 # Final temperature of air in K\n",
+ "T1 = 300.0# Initial temperature of air in K\n",
+ "m = 1.0 # Mass of air in kg\n",
+ "T0 = 300.0 # Ambient temperature\n",
+ "# Case (a)\n",
+ "print \"\\n Example 8.17\"\n",
+ "Sua = cv*math.log(T2/T1) # Entropy change of universe\n",
+ "Ia = T0*Sua # irreversibility\n",
+ "print \"\\n The irreversibility in case a is \",Ia ,\" kJ/kg\"\n",
+ "\n",
+ "# Case (b)\n",
+ "Q = m*cv*(T2-T1) # Heat transfer\n",
+ "T = 600 # Temperature of thermal reservoir in K\n",
+ "Sub = Sua-(Q/T) # Entropy change of universe\n",
+ "Ib = T0*Sub # irreversibility\n",
+ "print \"\\n The irreversibility in case b is \",Ib ,\" kJ/kg\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.18:pg-268"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.18\n",
+ "\n",
+ " Irreversibility per unit mass is 142.7096 kJ/kg\n",
+ "\n",
+ " The second law efficiency of the turbine is 78.0527289547 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "h1 = 3230.9 # Enthalpy of steam at turbine inlet in kJ/kg\n",
+ "s1 = 6.69212# Entropy of steam at turbine inlet in kJ/kgK \n",
+ "V1 = 160.0 # Velocity of steam at turbine inlet in m/s\n",
+ "T1 = 400.0 # Temperature of steam at turbine inlet in degree Celsius\n",
+ "h2 = 2676.1 # Enthalpy of steam at turbine exit in kJ/kg\n",
+ "s2 = 7.3549 # Entropy of steam at turbine exit in kJ/kgK \n",
+ "V2 = 100.0 # Velocity of steam at turbine exit in m/s\n",
+ "T2 = 100.0 # Temperature of steam at turbine exit in degree Celsius\n",
+ "T0 = 298.0 # Ambient temperature in K\n",
+ "W = 540.0 # Work developed by turbine in kW\n",
+ "Tb = 500.0 # Average outer surface temperature of turbine in K\n",
+ "\n",
+ "print \"\\n Example 8.18\"\n",
+ "Q = (h1-h2)+((V1**2-V2**2)/2)*1e-03-W # Heat loss\n",
+ "I = 151.84-Q*(0.404) # Irreversibility \n",
+ "AF = W + Q*(1.0-(T0/Tb)) + I # Exergy transfer\n",
+ "n2 = W/AF # second law efficiency\n",
+ "\n",
+ "print \"\\n Irreversibility per unit mass is \",I ,\" kJ/kg\"\n",
+ "print \"\\n The second law efficiency of the turbine is \",n2*100 ,\" percent\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.19:pg-269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.19\n",
+ "\n",
+ " Case A:\n",
+ "\n",
+ " Rate of availability transfer with heat and the irreversibility rate are \n",
+ " 1.7 kW and -6.8 kW respectively.\n",
+ "\n",
+ " Case B:\n",
+ "\n",
+ " Rate of availability in case b is 3.4 kW \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "T0 = 300.0 # Ambient temperature in K\n",
+ "T = 1500.0 # Resistor temperature in K\n",
+ "Q = -8.5 # Power supply in kW\n",
+ " \n",
+ "# Case (a)\n",
+ "W = -Q # work transfer\n",
+ "I = Q*(1.0-T0/T) + W # Irreversibility\n",
+ "R = Q*(1.0-T0/T) # availability\n",
+ "\n",
+ "print \"\\n Example 8.19\"\n",
+ "print \"\\n Case A:\"\n",
+ "print \"\\n Rate of availability transfer with heat and the irreversibility rate are \\n \",I ,\" kW and \",R ,\" kW respectively.\"\n",
+ "# Case (b)\n",
+ "T1 = 500.0 # Furnace wall temperature\n",
+ "Ib = - Q*(1.0-T0/T) + Q*(1.0-T0/T1) # Irreversibility\n",
+ "print \"\\n Case B:\"\n",
+ "print \"\\n Rate of availability in case b is \",Ib ,\" kW \"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex8.20:pg-270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 8.20\n",
+ "\n",
+ "\n",
+ " Part A:\n",
+ "\n",
+ " There is heat loss to surrounding.\n",
+ "\n",
+ "\n",
+ " Part B:\n",
+ "\n",
+ " The polytropic index is 1.0\n",
+ "\n",
+ "\n",
+ " Part C:\n",
+ "\n",
+ " Isothermal efficiency is 97.8793558312 percent \n",
+ "\n",
+ "\n",
+ " Part D:\n",
+ "\n",
+ " The minimum work input is -6.44697949667 kJ/kg, and irreversibility is 108.941520503 kJ/kg\n",
+ "\n",
+ "\n",
+ " Part E:\n",
+ "\n",
+ " Second law efficiency is 6.0 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "p1 = 1 # Air pressure at compressure inlet in bar\n",
+ "t1 = 30 # Air temperature at compressure inlet in degree Celsius\n",
+ "p2 = 3.5 # Air pressure at compressure exit in bar\n",
+ "t2 = 141 # Air temperature at compressure exit in degree Celsius\n",
+ "v = 90 # Air velocity at compressure exit in m/s\n",
+ "cp = 1.0035 # Specific heat capacity of air in kJ/kg\n",
+ "y = 1.4 # Heat capacity ratio\n",
+ "R = 0.287 # Gas constant\n",
+ "print \"\\n Example 8.20\\n\"\n",
+ "T2s = (t1+273)*(p2/p1)**((y-1)/y)\n",
+ "if T2s>(t2+273): \n",
+ " print \"\\n Part A:\"\n",
+ " print \"\\n There is heat loss to surrounding.\"\n",
+ "n =(1/(1-((math.log((t2+273)/(t1+273)))/(math.log(p2/p1)))))\n",
+ "print \"\\n\\n Part B:\"\n",
+ "print \"\\n The polytropic index is \",n\n",
+ "Wa = cp*(t1-t2)-(v**2)/2000 # Actual work \n",
+ "Wt = -R*(t1+273)*math.log(p2/p1) - (v**2)/2000 # Isothermal work\n",
+ "nt =Wt/Wa # Isothermal efficency\n",
+ "print \"\\n\\n Part C:\"\n",
+ "print \"\\n Isothermal efficiency is \",nt*100 ,\" percent \"\n",
+ "df = cp*(t1-t2) + (t1+273)*(R*math.log(p2/p1) - cp*math.log((t2+273)/(t1+273))) -(v**2)/2000\n",
+ "Wm = df # Minimum work input\n",
+ "I = Wm-Wa # Irreversibility\n",
+ "\n",
+ "print \"\\n\\n Part D:\"\n",
+ "print \"\\n The minimum work input is \",Wm,\" kJ/kg, and irreversibility is \",I ,\" kJ/kg\"\n",
+ "# The answers given in the book contain round off error\n",
+ "\n",
+ "neta = Wm/Wa\n",
+ "print \"\\n\\n Part E:\"\n",
+ "print \"\\n Second law efficiency is \",math. ceil(neta*100) ,\" percent\"\n",
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter9_2XNkqrL.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter9_2XNkqrL.ipynb
new file mode 100644
index 00000000..ceef1a80
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter9_2XNkqrL.ipynb
@@ -0,0 +1,925 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 09:Properties of pure substances"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.1:pg-302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.1\n",
+ "\n",
+ " At 1 MPa, \n",
+ " saturation temperature is 179.91 degree celcius\n",
+ "\n",
+ " Changes in specific volume is 0.193313 m**3/kg\n",
+ "\n",
+ " Change in entropy during evaporation is 4.4478 kJ/kg K\n",
+ "\n",
+ " The latent heat of vaporization is 2015.3 kJ/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# At 1 MPa\n",
+ "tsat = 179.91 # Saturation temperature in degree Celsius\n",
+ "vf = 0.001127 # Specific volume of fluid in m**3/kg\n",
+ "vg = 0.19444 # Specific volume of gas in m**3/kg \n",
+ "sf = 2.1387 # Specific entropy of fluid in kJ/kgK\n",
+ "sg = 6.5865# Specific entropy of gas in kJ/kgK\n",
+ "print \"\\n Example 9.1\"\n",
+ "vfg = vg-vf # Change in specific volume due to evaporation\n",
+ "sfg = sg-sf# Change in specific entropy due to evaporation\n",
+ "hfg = 2015.3\n",
+ "print \"\\n At 1 MPa, \\n saturation temperature is \",tsat ,\" degree celcius\"\n",
+ "print \"\\n Changes in specific volume is \",vfg ,\" m**3/kg\"\n",
+ "print \"\\n Change in entropy during evaporation is \",sfg ,\" kJ/kg K\"\n",
+ "print \"\\n The latent heat of vaporization is \",hfg ,\" kJ/kg\"\n",
+ "# Data is given in the table A.1(b) in Appendix in the book\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.2:pg-302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.2\n",
+ "\n",
+ " pressure = 0.6 Mpa\n",
+ " Temperature = 158.85 degree centigrade\n",
+ " Specific volume = 0.3156 m**3/kg\n",
+ " enthalpy = 2756.8 kJ/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given that\n",
+ "s = 6.76 # Entropy of saturated steam in kJ/kgK\n",
+ "print \"\\n Example 9.2\"\n",
+ "# From the table A.1(b) given in the book at s= 6.76 kJ/kgK\n",
+ "p = 0.6\n",
+ "t=158.85\n",
+ "v_g=0.3156\n",
+ "h_g=2756.8\n",
+ "print \"\\n pressure = \",p ,\" Mpa\\n Temperature = \",t ,\" degree centigrade\\n Specific volume = \",v_g ,\" m**3/kg\\n enthalpy = \",h_g ,\" kJ/kg\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.3:pg-302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.3\n",
+ "\n",
+ " The enthalpy and entropy of the system are\n",
+ " 2614.55463998 kW and 5.96006442363 kJ/kg and kJ/kg K respectively.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "v = 0.09 # Specific volume of substance at a point in m**3/kg\n",
+ "vf = 0.001177 # Specific volume of fluid in m**3/kg\n",
+ "vg = 0.09963 # Specific volume of gas in m**3/kg\n",
+ "hf = 908.79 # Specific enthalpy of fluid in kJ/kg\n",
+ "hfg = 1890.7 # Latent heat of substance in kJ/kg\n",
+ "sf = 2.4474 # Specific entropy of fluid in kJ/kgK\n",
+ "sfg = 3.8935 # Entropy change due to vaporization\n",
+ "\n",
+ "print \"\\n Example 9.3\"\n",
+ "x = (v-vf)/(vg-vf) # steam quality\n",
+ "h = hf+(x*hfg) # Specific enthalpy of substance at a point in kJ/kg\n",
+ "s = sf+(x*sfg) # Specific entropy of substance at a point in kJ/kgK\n",
+ "\n",
+ "print \"\\n The enthalpy and entropy of the system are\\n \",h ,\" kW and \",s ,\" kJ/kg and kJ/kg K respectively.\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.5:pg-303"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.5\n",
+ "\n",
+ " The pressure is 3.973 MPa\n",
+ "\n",
+ " The total mass of mixture is 9.57329343706 kg\n",
+ "\n",
+ " Specific volume is 0.00417829039327 m3/kg\n",
+ "\n",
+ " Enthalpy is is 1188.13405609 kJ/kg\n",
+ "\n",
+ " The entropy is 2.9891336667 kJ/kg K\n",
+ "\n",
+ " The internal energy is 1171.53370836 kJ/kg\n",
+ "\n",
+ " At 250 degree Celsius, internal energy is 1171.53445483 kJ/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "Psat = 3.973 # Saturation pressure in MPa\n",
+ "vf = 0.0012512 # specific volume of fluid in m**3/kg\n",
+ "vg = 0.05013 # Specific volume of gas in m**3/kg\n",
+ "hf = 1085.36 # Specific enthalpy of fluid in kJ/kg\n",
+ "hfg = 1716.2 # Latent heat of vaporization in kJ/kg\n",
+ "sf = 2.7927 # Specific entropy of fluid in kJ/kgK\n",
+ "sfg = 3.2802 # Entropy change due to vaporization in kJ/kgK\n",
+ "mf = 9.0 # Mass of liquid in kg\n",
+ "V = 0.04 # Volume of vessel in m**3\n",
+ "# at T = 250\n",
+ "uf = 1080.39 #Specific internal energy in kJ/kg \n",
+ "ufg = 1522.0# Change in internal energy due to vaporization in kJ/kg\n",
+ "\n",
+ "print \"\\n Example 9.5\"\n",
+ "Vf = mf*vf # volume of fluid\n",
+ "Vg = V-Vf # volume of gas\n",
+ "mg = Vg/vg # mass of gas\n",
+ "m = mf+mg # mass if mixture\n",
+ "x = mg/m # quality of steam\n",
+ "v = vf+x*(vg-vf) # specific volume of mixture\n",
+ "h = hf+x*hfg # enthalpy of mixture\n",
+ "s = sf+(x*sfg) # entropy of mixture\n",
+ "u = h-Psat*1e6*v*1e-03 # Internal energy of mixture\n",
+ "u_ = uf+x*ufg # Internal energy at 250 degree Celsius\n",
+ "print \"\\n The pressure is \",Psat ,\" MPa\"\n",
+ "print \"\\n The total mass of mixture is \",m ,\" kg\"\n",
+ "print \"\\n Specific volume is \",v ,\" m3/kg\"\n",
+ "print \"\\n Enthalpy is is \",h ,\" kJ/kg\"\n",
+ "print \"\\n The entropy is \",s ,\" kJ/kg K\"\n",
+ "print \"\\n The internal energy is \",u ,\" kJ/kg\"\n",
+ "print \"\\n At 250 degree Celsius, internal energy is \",u_ ,\"kJ/kg\" #The answer provided in the textbook is wrong\n",
+ "\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.7:pg-305"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.7\n",
+ "\n",
+ " The ideal work output of the turbine is 882.40804932 kJ/Kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# At T = 40 degree\n",
+ "Psat = 7.384 # Saturation pressure in kPa\n",
+ "sf = 0.5725 # Entropy of fluid in kJ/kgK\n",
+ "sfg = 7.6845 # Entropy change due to vaporization in kJ/kgK\n",
+ "hf = 167.57 # Enthalpy of fluid in kJ/kg\n",
+ "hfg = 2406.7 # Latent heat of vaporization in kJ/kg\n",
+ "s1 = 6.9189 # Entropy at turbine inlet in kJ/kgK\n",
+ "h1 = 3037.6 # Enthalpy at turbine inlet in kJ/kg\n",
+ "print \"\\n Example 9.7\"\n",
+ "x2 = (s1-sf)/sfg # Steam quality\n",
+ "h2 = hf+(x2*hfg) # Enthalpy at turbine exit\n",
+ "W = h1-h2 # Net work done\n",
+ "print \"\\n The ideal work output of the turbine is \",W ,\" kJ/Kg\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.9:pg-308"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.9\n",
+ "\n",
+ " The quality of steam in pipe line is 0.96097673702\n",
+ "\n",
+ " Maximum moisture content that can be determined is 5.47886817645 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "h2 = 2716.2 # Enthalpy at turbine inlet in kJ/kg\n",
+ "hf = 844.89 # Enthalpy of fluid in kJ/kg\n",
+ "hfg = 1947.3 # Latent heat of vaporization in kJ/kg\n",
+ "h3 = 2685.5 # Enthalpy at turbine exit in kJ/kg\n",
+ "print \"\\n Example 9.9\"\n",
+ "x1 = (h2-hf)/hfg\n",
+ "x4 = (h3-hf)/hfg\n",
+ "print \"\\n The quality of steam in pipe line is \",x1 #The answers vary due to round off error\n",
+ "print \"\\n Maximum moisture content that can be determined is \",100-(x4*100) ,\" percent\"#The answer provided in the textbook is wrong\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.10:pg-309"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.10\n",
+ "\n",
+ " The quality of the steam in the pipe line is 0.909544295341\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# At 0.1Mpa, 110 degree\n",
+ "h2 = 2696.2 # Enthalpy at turbine inlet in kJ/kg\n",
+ "hf = 844.89 # Enthalpy of fluid in kJ/kg\n",
+ "hfg = 1947.3 # Latent heat of vaporization in kJ/kg\n",
+ "vf = 0.001023 # at T = 70 degree\n",
+ "V = 0.000150 # In m3\n",
+ "m2 = 3.24 # mass of condensed steam in kg\n",
+ "\n",
+ "print \"\\n Example 9.10\"\n",
+ "x2 = (h2-hf)/hfg # Quality of steam at turbine inlet\n",
+ "m1 = V/vf # mass of moisture collected in separator\n",
+ "x1 = (x2*m2)/(m1+m2) # quality of the steam\n",
+ "print \"\\n The quality of the steam in the pipe line is \",x1 \n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.11:pg-310"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.11\n",
+ "\n",
+ " The heat transfer during the process is 1788.19203218 MJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# P = 1MPa\n",
+ "vf = 0.001127 # specific volume of fluid in m**3/kg\n",
+ "vg = 0.1944# specific volume of gas in m**3/kg\n",
+ "hg = 2778.1 # specific enthalpy of gas in kJ/kg\n",
+ "uf = 761.68 # Specific internal energy of fluid in kJ/kg\n",
+ "ug = 2583.6 # Specific internal energy of gas in kJ/kg\n",
+ "ufg = 1822 # Change in specific internal energy due to phase change in kJ/kg \n",
+ "# Initial anf final mass\n",
+ "Vif = 5 # Initial volume of water in m**3 \n",
+ "Viw = 5# Initial volume of gas in m**3 \n",
+ "Vff = 6 # Final volume of gas in m**3 \n",
+ "Vfw = 4 # Final volume of water in m**3 \n",
+ "\n",
+ "\n",
+ "print \"\\n Example 9.11\"\n",
+ "ms = ((Viw/vf)+(Vif/vg)) - ((Vfw/vf)+(Vff/vg)) \n",
+ "U1 = ((Viw*uf/vf)+(Vif*ug/vg))\n",
+ "Uf = ((Vfw*uf/vf)+(Vff*ug/vg))\n",
+ "Q = Uf-U1+(ms*hg)\n",
+ "print \"\\n The heat transfer during the process is \",Q/1e3 ,\" MJ\"\n",
+ "#The answer provided in the textbook is wrong\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.12:pg-311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.12\n",
+ "\n",
+ " The value of n is 1.23844995978\n",
+ "\n",
+ " The work done by the steam is 4.72026539673 kJ \n",
+ "\n",
+ " The heat transfer is -1.80091923775 kJ \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "m = 0.02 # Mass of steam in Kg\n",
+ "d = 280 # diameter of piston in mm\n",
+ "l = 305 # Stroke length in mm\n",
+ "P1 = 0.6 # Initial pressure in MPa\n",
+ "P2 = 0.12 # Final pressure in MPa\n",
+ "# At 0.6MPa, t = 200 degree\n",
+ "v1 = 0.352 # Specific volume in m**3/kg\n",
+ "h1 = 2850.1 # Specific enthalpy in kJ/kg\n",
+ "vf = 0.0010476 # specific volume of fluid in m**3/kg\n",
+ "vfg = 1.4271 # Specific volume change due to vaporization in m**3/kg\n",
+ "uf = 439.3 # specific enthalpy of fluid\n",
+ "ug = 2512.0 # Specific enthalpy of gas\n",
+ "print \"\\n Example 9.12\"\n",
+ "V1 = m*v1 # total volume at point 1\n",
+ "Vd = (math.pi/4)*(d*1e-3)**2*l*1e-3 # displaced volume\n",
+ "V2 = V1+Vd # Total volume at point 2\n",
+ "n = math.log(P1/P2)/math.log(V2/V1) # polytropic index\n",
+ "W12 = ((P1*V1)-(P2*V2))*1e6/(n-1) # work done\n",
+ "print \"\\n The value of n is \",n\n",
+ "print \"\\n The work done by the steam is \",W12/1e3 ,\"kJ \"\n",
+ "#The answers vary due to round off error\n",
+ "v2 = V2/m # specific volume\n",
+ "x2 = (v2-vf)/vfg # Steam quality\n",
+ "# At 0.12MPa\n",
+ "u2 = uf + (x2*(ug-uf)) # Internal energy \n",
+ "u1 = h1-(P1*1e6*v1*1e-03) # Internal energy\n",
+ "Q12 = m*(u2-u1)+ (W12/1e3) # Heat transfer\n",
+ "print \"\\n The heat transfer is \",Q12 ,\"kJ \"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.13:pg-312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.13\n",
+ "\n",
+ " Final pressure is 3.5 bar\n",
+ "\n",
+ " Steam quality is 0.87 \n",
+ " Entropy change during the process is 0.4227 kJ/K\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "x1 = 1 # Steam quality in first vessel\n",
+ "x2 = 0.8 # Steam quality in second vessel\n",
+ "# at 0.2MPa\n",
+ "vg = 0.8857 # Specific volume of gas in m**3/kg\n",
+ "h1 = 2706.7 # Enthalpy in first vessel in kJ/kg\n",
+ "v1 = vg # Specific volume of gas in first vessel in m**3/kg\n",
+ "hg = h1 # Enthalpy in first vessel 1 in kJ/kg\n",
+ "m1 = 5 # mass in first vessel in kg\n",
+ "V1 = m1*v1 # Volume of first vessel in m**3\n",
+ "# at 0.5MPa\n",
+ "m2 = 10 # mass in second vessel in kg\n",
+ "hf = 640.23 # Enthalpy in second vessel in kJ/kg\n",
+ "hfg = 2108.5 # Latent heat of vaporization in kJ/kg\n",
+ "vf = 0.001093 # Specific volume of fluid in second vessel in m**3/kg\n",
+ "vfg = 0.3749 # Change in specific volume in second vessel due to evaporation of gas in m**3/kg\n",
+ "v2 = vf+(x2*vfg) # Specific volume of gas in second vessel\n",
+ "V2 = m2*v2 # Volume of second vessel in m**3\n",
+ "#\n",
+ "Vm = V1+V2 # Total volume \n",
+ "m = m1+m2 # Total mass\n",
+ "vm = Vm/m # net specific volume\n",
+ "u1 = h1 # Internal energy\n",
+ "h2 = hf+(x2*hfg) # Enthalpy calculation\n",
+ "u2 = h2 # Internal energy calculation\n",
+ "m3 = m # Net mass calculation\n",
+ "h3 = ((m1*u1)+(m2*u2))/m3 # Resultant enthalpy calculation\n",
+ "u3 = h3 # Resultant internal energy calculation\n",
+ "v3 = vm # resultant specific volume calculation\n",
+ "# From Mollier diagram\n",
+ "x3 = 0.870 # Steam quality \n",
+ "p3 = 3.5 # Pressure in MPa\n",
+ "s3 = 6.29 # Entropy at state 3 in kJ/kgK\n",
+ "s1 = 7.1271 # Entropy at state 1 in kJ/kgK\n",
+ "sf = 1.8607 # Entropy in liquid state in kJ/kgK\n",
+ "sfg = 4.9606 # Entropy change due to vaporization in kJ/kgK\n",
+ "s2 = sf+(x2*sfg) # Entropy calculation\n",
+ "E = m3*s3-((m1*s1)+(m2*s2)) # Entropy change during process\n",
+ "\n",
+ "print \"\\n Example 9.13\"\n",
+ "print \"\\n Final pressure is \",p3 ,\" bar\"\n",
+ "print \"\\n Steam quality is \",x3 ,\n",
+ "print \"\\n Entropy change during the process is \",E ,\" kJ/K\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.14:pg-314"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.14\n",
+ "\n",
+ " The availability of the steam before the throttle valve 1263.6894 kJ/kg\n",
+ "\n",
+ " The availability of the steam after the throttle valve 1237.5538 kJ/kg\n",
+ "\n",
+ " The availability of the steam at the turbine exhaust 601.851036792 kJ/kg\n",
+ "\n",
+ " The specific work output from the turbine is 546.253422512 kJ/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# At 6 MPa, 400 degree\n",
+ "h1 = 3177.2 # Enthalpy in kJ/kg\n",
+ "s1 = 6.5408 #Entropy in kJ/kgK\n",
+ "# At 20 degree\n",
+ "h0= 83.96 # Enthalpy in kJ/kg \n",
+ "s0 = 0.2966#Entropy in kJ/kgK\n",
+ "T0 = 20 # Surrounding temperature in degree Celsius \n",
+ "f1 = (h1-h0)-(T0+273)*(s1-s0) # Availability before throttling\n",
+ "# By interpolation at P= 5MPa, h= 3177.2\n",
+ "s2 = 6.63 #Entropy in kJ/kgK\n",
+ "h2 = h1 # Throttling\n",
+ "f2 = (h2-h0)-(T0+273)*(s2-s0) # Availability after throttling\n",
+ "df = f1-f2 # Change in availability\n",
+ "x3s = (s2-1.5301)/(7.1271-1.5301) #Entropy at state 3 in kJ/kgK\n",
+ "h3s = 504.7+(x3s*2201.9) #Enthalpy at state 3 in kJ/kg\n",
+ "eis = 0.82 # isentropic efficiency\n",
+ "h3 = h2-eis*(h1-h3s) # Enthalpy at state 3 in kJ/kgK\n",
+ "x3 = (h3-504.7)/2201.7 # Steam quality at state 3\n",
+ "s3 = 1.5301+(x3*5.597) # Entropy at state 3\n",
+ "f3 = (h3-h0)-(T0+273)*(s3-s0) # Availability at state 3\n",
+ "\n",
+ "print \"\\n Example 9.14\"\n",
+ "print \"\\n The availability of the steam before the throttle valve \",f1 ,\" kJ/kg\"\n",
+ "print \"\\n The availability of the steam after the throttle valve \",f2 ,\" kJ/kg\"\n",
+ "print \"\\n The availability of the steam at the turbine exhaust \",f3 ,\" kJ/kg\"\n",
+ "print \"\\n The specific work output from the turbine is \",h2-h3 ,\" kJ/kg\"\n",
+ "#The answers vary due to round off error\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.15:pg-316"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.15\n",
+ "\n",
+ " Availability of steam entering is 1057.4864 kJ/kg\n",
+ "\n",
+ " Availability of steam leaving the turbine is 656.7062 kJ/kg\n",
+ "\n",
+ " Maximum work is 741.14568 kJ/kg\n",
+ "\n",
+ " Irreversibility is 21.36505104 kJ/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# At 25 bar, 350 degree\n",
+ "h1 = 3125.87 # Enthalpy in kJ/kg\n",
+ "s1 = 6.8481# Entropy in kJ/kgK\n",
+ "# 30 degree\n",
+ "h0 = 125.79 # Enthalpy in kJ/kg\n",
+ "s0 = 0.4369# Entropy in kJ/kgK\n",
+ "# At 3 bar, 200 degree\n",
+ "h2 = 2865.5 # Enthalpy in kJ/kg\n",
+ "s2 = 7.3115 #Entropy in kJ/kgK\n",
+ "# At 0.2 bar 0.95 dry\n",
+ "hf = 251.4 # Enthalpy of liquid in kJ/kg\n",
+ "hfg = 2358.3 # Latent heat of vaporization in kJ/kg\n",
+ "sf = 0.8320 # Entropy of liquid in kJ/kgK\n",
+ "sg = 7.0765# Entropy of liquid in kJ/kgK\n",
+ "h3 = hf+0.92*hfg # Enthalpy at state 3 in kJ/kg\n",
+ "s3 = sf+(0.92*sg) # Entropy at state 3 in kJ/kgK\n",
+ "# Part (a)\n",
+ "T0 = 30 # Atmospheric temperature in degree Celsius\n",
+ "f1 = (h1-h0)-((T0+273)*(s1-s0)) # Availability at steam entering turbine\n",
+ "f2 = (h2-h0)-((T0+273)*(s2-s0)) # Availability at state 2\n",
+ "f3 = (h3-h0)-((T0+273)*(s3-s0))# Availability at state 3\n",
+ "\n",
+ "print \"\\n Example 9.15\"\n",
+ "print \"\\n Availability of steam entering is \",f1 ,\" kJ/kg\"\n",
+ "print \"\\n Availability of steam leaving the turbine is \",f2 ,\" kJ/kg\"\n",
+ "\n",
+ "# Part (b)\n",
+ "m2m1 = 0.25 # mass ratio\n",
+ "m3m1 = 0.75 # mass ratio\n",
+ "Wrev = f1-(m2m1*f2)-(m3m1*f3) # Maximum work\n",
+ "print \"\\n Maximum work is \",Wrev ,\" kJ/kg\"\n",
+ "\n",
+ "# Part (c)\n",
+ "w1 = 600 # mass flow at inlet of turbine in kg/h\n",
+ "w2 = 150 # mass flow at state 2 in turbine in kg/h\n",
+ "w3 = 450# mass flow at state 2 in turbine in kg/h\n",
+ "Q = -10 # Heat loss rate kJ/s\n",
+ "I = ((T0+273)*(w2*s2+w3*s3-w1*s1)-Q*3600)*103/600\n",
+ "print \"\\n Irreversibility is \",I/1e3 ,\" kJ/kg\"\n",
+ "#The answer provided in the textbook is wrong\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.16:pg-317"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.16\n",
+ "\n",
+ " Energy of system in Part (a) is 73.2 kJ\n",
+ "\n",
+ " Energy of system in Part (b) is 197.3474 kJ\n",
+ "\n",
+ " Energy of system in Part (c) is 498.2624 kJ\n",
+ "\n",
+ " Energy of system in Part (d) is 121.8 kJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# At dead state of 1 bar, 300K\n",
+ "u0 = 113.1 # Internal energy in kJ/kg\n",
+ "h0 = 113.2 # Enthalpy in kJ/kg\n",
+ "v0 = 0.001005 # Specific volume in m**3/kg\n",
+ "s0 = 0.395 # Entropy in kJ/kg\n",
+ "T0 = 300 # Atmospheric temperature in K\n",
+ "P0 = 1 # Atmospheric pressure in bar \n",
+ "K = h0-T0*s0\n",
+ "# Part (a)\n",
+ "# At 1bar and 90 degree Celsius \n",
+ "u = 376.9 # Internal energy in kJ/kg\n",
+ "h = 377 # Enthalpy in kJ/kg\n",
+ "v = 0.001035 # specific volume in m**3/kg\n",
+ "s = 1.193 # Entropy in kJ/kgK\n",
+ "m = 3 # Mass of water in kg\n",
+ "fi = m*(h-(T0*s)-K) #Energy of system\n",
+ "\n",
+ "print \"\\n Example 9.16\"\n",
+ "print \"\\n Energy of system in Part (a) is \",fi ,\" kJ\"\n",
+ "#The answers vary due to round off error\n",
+ "\n",
+ "# Part (b)\n",
+ "# At P = 4 Mpa, t = 500 degree\n",
+ "u = 3099.8# Internal energy in kJ/kg \n",
+ "h = 3446.3 # Enthalpy in kJ/kg \n",
+ "v = 0.08637 # specific volume in m**3/kg \n",
+ "s = 7.090 # Entropy in kJ/kgK\n",
+ "m = 0.2 # Mass of steam in kg \n",
+ "fib = m*(u+P0*100*v-T0*s-K) # Energy of system\n",
+ "print \"\\n Energy of system in Part (b) is \",fib ,\" kJ\"\n",
+ "\n",
+ "# Part (c) # P = 0.1 bar\n",
+ "m = 0.4 # Mass of wet steam in kg \n",
+ "x = 0.85 # Quality\n",
+ "u = 192+x*2245 # Internal energy \n",
+ "h = 192+x*2392# Enthalpy\n",
+ "s = 0.649+x*7.499 # Entropy\n",
+ "v = 0.001010+x*14.67 # specific volume\n",
+ "fic = m*(u+P0*100*v-T0*s-K) # Energy of system\n",
+ "print \"\\n Energy of system in Part (c) is \",fic ,\" kJ\"\n",
+ "\n",
+ "# Part (d) \n",
+ "# P = 1 Bar, t = -10 degree Celsius\n",
+ "m = 3 # Mass of ice in kg \n",
+ "h = -354.1 # Enthalpy in kJ/kg \n",
+ "s = -1.298 # at 1000kPa, -10 degree\n",
+ "fid = m*((h-h0)-T0*(s-s0)) # Energy of system\n",
+ "\n",
+ "print \"\\n Energy of system in Part (d) is \",fid ,\" kJ\" #The answer provided in the textbook is wrong\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.17:pg-318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.17\n",
+ "\n",
+ " In parallel flow\n",
+ "\n",
+ " The rate of irreversibility is 10.98 kW\n",
+ "\n",
+ " The Second law efficiency is 24.275862069 percent\n",
+ "\n",
+ "\n",
+ " In counter flow\n",
+ "\n",
+ " The rate of irreversibility is 10.9454545455 kW\n",
+ "\n",
+ " The Second law efficiency is 32.1594684385 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Given\n",
+ "th1 = 90.0 # Inlet temperature of hot water in degree Celsius\n",
+ "tc1 = 25.0# Inlet temperature of cold water in degree Celsius\n",
+ "tc2 = 50.0# Exit temperature of cold water in degree Celsius\n",
+ "mc = 1.0 # mass flow rate of cold water in kg/s\n",
+ "T0 = 300.0 # Atmospheric temperature in K\n",
+ "th2p = 60.0 # Temperature limit in degree Celsius for parallel flow\n",
+ "th2c = 35.0 # Temperature limit in degree Celsius for counter flow\n",
+ "mhp = (tc2-tc1)/(th1-th2p) # mass flow rate of hot water in kg/s for parallel flow\n",
+ "mhc = (tc2-tc1)/(th1-th2c) # mass flow rate of hot water in kg/s for counter flow\n",
+ "# At 300 K\n",
+ "h0 = 113.2 # ENthalpy in kJ/kg\n",
+ "s0 = 0.395 # ENtropy in kJ/kgK\n",
+ "T0 = 300.0 # temperature in K\n",
+ "# At 90 degree celsius\n",
+ "h1 = 376.92 # Enthalpy in kJ/kg \n",
+ "s1 = 1.1925 # Entropy in kJ/kgK\n",
+ "af1 = mhp*((h1-h0)-T0*(s1-s0)) # Availability\n",
+ "# Parallel Flow\n",
+ "# At 60 degree\n",
+ "h2 = 251.13 # Enthalpy in kJ/kg \n",
+ "s2 =0.8312 # Entropy in kJ/kgK\n",
+ " # At 25 degree\n",
+ "h3 = 104.89 # Enthalpy in kJ/kg \n",
+ "s3 = 0.3674 # Entropy in kJ/kgK\n",
+ "# At 50 degree\n",
+ "h4 = 209.33 # Enthalpy in kJ/kg \n",
+ "s4 = 0.7038 # Entropy in kJ/kgK\n",
+ "REG = mc*((h4-h3)-T0*(s4-s3)) # Rate of energy gain\n",
+ "REL = mhp*((h1-h2)-T0*(s1-s2)) # Rate of energy loss\n",
+ "Ia = REL-REG # Energy destruction\n",
+ "n2a = REG/REL # Second law efficiency\n",
+ "\n",
+ "print \"\\n Example 9.17\"\n",
+ "print \"\\n In parallel flow\"\n",
+ "print \"\\n The rate of irreversibility is \",Ia ,\" kW\"\n",
+ "print \"\\n The Second law efficiency is \",n2a*100 ,\" percent\"\n",
+ "#The answers vary due to round off error\n",
+ "\n",
+ "\n",
+ "# Counter flow\n",
+ "h2_ = 146.68 \n",
+ "sp = 0.5053 # At 35 degree\n",
+ "REG_b = REG # Rate of energy gain by hot water is same in both flows\n",
+ "REL_b = mhc*((h1-h2_)-T0*(s1-sp))\n",
+ "Ib = mhc*((h1-h2_)-(T0*(s1-sp))) # Energy destruction\n",
+ "n2b = REG_b/Ib # Second law efficiency\n",
+ "print \"\\n\\n In counter flow\"\n",
+ "print \"\\n The rate of irreversibility is \",Ib ,\" kW\"\n",
+ "print \"\\n The Second law efficiency is \",n2b*100 ,\" percent\"\n",
+ "#The answers vary due to round off error\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Ex9.18:pg-320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Example 9.18\n",
+ "\n",
+ " The maximum cooling rate is 106.207042424 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "m = 50.0# mass flow rate in kg/h\n",
+ "Th = 23.0 # Home temperature in degree Celsius\n",
+ "# State 1\n",
+ "T1 = 150.0 # Saturated vapor temperature in degree Celsius\n",
+ "h1 = 2746.4 # Saturated vapor enthalpy in kJ/kg\n",
+ "s1 = 6.8387 #Saturated vapor entropy in kJ/kgK\n",
+ "# State 2\n",
+ "h2 = 419.0 # Saturated liquid enthalpy in kJ/kg\n",
+ "s2 = 1.3071 #Saturated liquid entropy in kJ/kg \n",
+ "T0 = 45.0 # Atmospheric temperature in degree Celsius\n",
+ "#\n",
+ "b1 = h1-((T0+273)*s1) # Availability at point 1\n",
+ "b2 = h2-((T0+273)*s2) # Availability at point 2\n",
+ "Q_max = m*(b1-b2)/((T0+273)/(Th+273)-1) # maximum cooling rate\n",
+ "\n",
+ "print \"\\n Example 9.18\"\n",
+ "print \"\\n The maximum cooling rate is \",Q_max/3600 ,\" kW\"\n",
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/16.11_EVddapc.png b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/16.11_EVddapc.png
new file mode 100644
index 00000000..b39edce8
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/16.11_EVddapc.png
Binary files differ
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/3.3_hWZB9rU.png b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/3.3_hWZB9rU.png
new file mode 100644
index 00000000..d085b2d3
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/3.3_hWZB9rU.png
Binary files differ
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/7.10_IDdNUer.png b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/7.10_IDdNUer.png
new file mode 100644
index 00000000..070bbe5c
--- /dev/null
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/7.10_IDdNUer.png
Binary files differ