summaryrefslogtreecommitdiff
path: root/Thermodynamics:_From_concepts_to_applications/chapter12.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Thermodynamics:_From_concepts_to_applications/chapter12.ipynb')
-rwxr-xr-xThermodynamics:_From_concepts_to_applications/chapter12.ipynb314
1 files changed, 314 insertions, 0 deletions
diff --git a/Thermodynamics:_From_concepts_to_applications/chapter12.ipynb b/Thermodynamics:_From_concepts_to_applications/chapter12.ipynb
new file mode 100755
index 00000000..aea962e5
--- /dev/null
+++ b/Thermodynamics:_From_concepts_to_applications/chapter12.ipynb
@@ -0,0 +1,314 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:2837d214113f06819e10997f047a7eaa67f457e584a6b0f4db06b83606bfd8b8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter12-ideal gas mixtures and humid air"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example1-pg 251"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate molecular weight of air\n",
+ "##initialisation of variables\n",
+ "x= 0.78\n",
+ "x1= 0.21\n",
+ "x2= 0.008\n",
+ "x3= 0.002\n",
+ "MN2= 28.013 ##gms\n",
+ "MO2= 32. ##gms\n",
+ "MAr= 39.948 ##gms\n",
+ "MH2O= 18.016 ##gms\n",
+ "##CALCULATIONS\n",
+ "M= x*MN2+x1*MO2+x2*MAr+x3*MH2O\n",
+ "##RESULTS\n",
+ "print'%s %.3f %s'% ('molecular wight of air=',M,'kg/kmol')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "molecular wight of air= 28.926 kg/kmol\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example2-pg254"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate average value and mass\n",
+ "##initialisation of variables\n",
+ "M= 30.04 ##kg/kmol\n",
+ "R= 8.3143 ##J/mol K\n",
+ "p= 100. ##kPa\n",
+ "V= 0.2 ##m^3\n",
+ "T= 25. ##C\n",
+ "##CALCULATIONS\n",
+ "R1= R/M\n",
+ "m= p*V/(R1*(273.15+T))\n",
+ "##RESULTS\n",
+ "print'%s %.4f %s'% ('average value of R=',R1,'kJ/kg K')\n",
+ "print'%s %.3f %s'% ('mass=',m,'kg')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "average value of R= 0.2768 kJ/kg K\n",
+ "mass= 0.242 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example3-pg256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate final temperature and final pressure and change in entropy\n",
+ "##initialisation of variables\n",
+ "m1= 0.5 ##kg\n",
+ "cv1= 0.6496 ##kJ/kg K\n",
+ "T1= 80. ##C\n",
+ "m2= 1. ##kg\n",
+ "cv2= 0.6299 ##kJ/kg K\n",
+ "T2= 150. ##C\n",
+ "M= 32. ##kg\n",
+ "M1= 44. ##kg\n",
+ "V1= 0.11437 ##m^3\n",
+ "V2= 0.1 ##m^2\n",
+ "R= 8.314 ##J/mol K\n",
+ "##CALCULATIONS\n",
+ "T= (m1*cv1*(273.15+T1)+m2*cv2*(273.15+T2))/(m1*cv1+m2*cv2)\n",
+ "p= ((m1/M)+(m2/M1))*R*T/(V1+V2)\n",
+ "S= m1*(cv1*math.log(T/(273.15+T1))+(R/M)*math.log((V1+V2)/V1))+m2*(cv2*math.log(T/(273.15+T2))+(R/M1)*math.log((V1+V2)/V2))\n",
+ "##RESULTS\n",
+ "print'%s %.1f %s'% ('final temperature=',T,'kPa')\n",
+ "print'%s %.1f %s'% ('final pressure=',p,'kPa')\n",
+ "print'%s %.4f %s'% ('change in entropy=',S,'kJ/K')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "final temperature= 399.3 kPa\n",
+ "final pressure= 594.0 kPa\n",
+ "change in entropy= 0.2291 kJ/K\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example4-pg268\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate wet-bulb temoerature and minimum temperature and amount of water injected\n",
+ "##initialisation of variables\n",
+ "Twb= 22. ##C\n",
+ "Tmin= 22.3 ##C\n",
+ "w2= 0.0170 ##kg/kg dry air\n",
+ "w1= 0.0093 ##kg/kg dry air\n",
+ "##CALCULATIONS\n",
+ "m= w2-w1\n",
+ "##RESULTS\n",
+ "print'%s %.f %s'% (' wet-bulb temperature=',Twb,'C')\n",
+ "print'%s %.f %s'% ('minimum temperature=',Tmin,'1C')\n",
+ "print'%s %.4f %s'% ('amount of water injected=',m,'kg/kg dry air')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " wet-bulb temperature= 22 C\n",
+ "minimum temperature= 22 1C\n",
+ "amount of water injected= 0.0077 kg/kg dry air\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example5-pg269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate state after mixing\n",
+ "##initialisation of variables\n",
+ "w3= 0.0178 ##kg/kgair\n",
+ "w4= 0.0172 ##kg/kgair\n",
+ "##CALCULATIONS\n",
+ "dw= w3-w4\n",
+ "##RESULTS\n",
+ "print'%s %.4f %s'% (' state after mixing=',dw,'kg/kgair')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " state after mixing= 0.0006 kg/kgair\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example6-pg271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate air mass flow rate and amount of water to be added\n",
+ "##initialisation of variables\n",
+ "m= 20000. ##kg/h\n",
+ "T1= 42. ##C\n",
+ "T2= 22. ##C\n",
+ "J= 4.186 ##cal\n",
+ "h1= 54. ##kJ/kg\n",
+ "h2= 94.8 ##kJ/kg\n",
+ "w1= 0.0105 ##kg/h kg\n",
+ "w2= 0.0244 ##kg/h kg\n",
+ "##CALCULATIONS\n",
+ "ma= m*(T1-T2)*J/((h2-h1-J*T2*(w2-w1)))\n",
+ "mw= ma*(w2-w1)\n",
+ "m4= m-mw\n",
+ "##RESULTS\n",
+ "print'%s %.1f %s'%('air mass flow rate=',ma,'kg/hr')\n",
+ "print'%s %.f %s'%('amount of water to be added=',m4,'kg/hr')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "air mass flow rate= 42368.5 kg/hr\n",
+ "amount of water to be added= 19411 kg/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example7-pg272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate maximum useful work\n",
+ "##initialisation of variables\n",
+ "x= 0.79\n",
+ "P0= 101 ##kPa\n",
+ "P= 20 ##Mpa\n",
+ "V= 0.032 ##m^3\n",
+ "##CALCULATIONS\n",
+ "p= x*P0\n",
+ "Wrev= P*10*10*10*V*(math.log(P/(p*math.pow(10,-3)))+((p*math.pow(10,-3))/P)-1)\n",
+ "##RESULTS\n",
+ "print'%s %.1f %s'% (' maximum useful work=',Wrev,'kJ')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " maximum useful work= 2898.0 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file