{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 21: Gas compression" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 21.1: example_1.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//initialization of varaibles\n", "R=53.34\n", "T1=540 //R\n", "n=1.4\n", "g=n\n", "n2=1.3\n", "P2=90 //psia\n", "P1=15 //psia\n", "cv=0.171\n", "//calculations\n", "pv=R*T1\n", "Wk=n*R*T1*((P2/P1)^((g-1)/g) -1) /(n-1)\n", "Wn=n2*R*T1*((P2/P1)^((n2-1)/n2) -1) /(n2-1)\n", "Wt=R*T1*log(P2/P1)\n", "Q=cv*(n-n2)*778*T1*((P2/P1)^((n2-1)/n2) -1) /(1-n2)\n", "//results\n", "printf('\n Work in case 1 = %d ft lb/lb',Wk)\n", "printf('\n Work in case 2 = %d ft lb/lb',Wn)\n", "printf('\n Work in case 3 = %d ft lb/lb',Wt)\n", "printf('\n Heat transferred = %.1f B/lb',Q*0.001305)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 21.2: example_2.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//initialization of varaibles\n", "R=53.34\n", "T1=540 //R\n", "n=1.4\n", "g=n\n", "n2=1.3\n", "P2=90 //psia\n", "P1=15 //psia\n", "cv=0.171\n", "//calculations\n", "pv=R*T1\n", "Wk=n*R*T1*((P2/P1)^((g-1)/g) -1) /(n-1)\n", "Wn=n2*R*T1*((P2/P1)^((n2-1)/n2) -1) /(n2-1)\n", "Wt=R*T1*log(P2/P1)\n", "eta1=Wt/Wn\n", "eta2=Wk/Wn\n", "//results\n", "printf('Adiabatic efficiency = %.2f',eta2)\n", "printf('\n Isothermal efficiency = %.2f',eta1)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 21.3: example_3.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//initialization of varaibles\n", "R=53.34\n", "T1=540 //R\n", "n=1.4\n", "g=n\n", "n2=1.3\n", "P2=90 //psia\n", "P1=15 //psia\n", "cv=0.171\n", "eta=0.95\n", "//calculations\n", "pv=R*T1\n", "Wk=n*R*T1*((P2/P1)^((g-1)/g) -1) /(n-1)\n", "Wn=n2*R*T1*((P2/P1)^((n2-1)/n2) -1) /(n2-1)\n", "Wt=R*T1*log(P2/P1)\n", "Wx=-Wk/eta\n", "dh=cp*T1*(1.52 - 1)\n", "Q=dh+Wx/778\n", "//results\n", "printf('Heat transferred = %.1f B/lb',Q)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 21.4: example_4.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//initialization of varaibles\n", "n=1.3\n", "P1=15 //psia\n", "P2=75 //psia\n", "eta=0.5\n", "eta2=0\n", "//calculations\n", "Pr=(P2/P1)^(1/n)\n", "Cl=(1-eta)/(Pr-1)\n", "Cl2=(1-eta2)/(Pr-1)\n", "//results\n", "printf('For volumetric efficiency to be 0.5, Clearance = %.3f',Cl)\n", "printf('\n For volumetric efficiency to be 0, Clearance = %.3f',Cl2)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 21.5: example_5.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//initialization of varaibles\n", "P1=5 //psia\n", "P2=83.5 //psia\n", "n=1.25\n", "per=0.03\n", "//calculations\n", "nv1=1- per*((P2/P1)^(1/n) -1)\n", "nv2=1-per*((sqrt(P2/P1))^(1/n) -1)\n", "//results\n", "printf('For single stage machine = %.3f',nv1)\n", "printf('\n For Two stage machine = %.3f',nv2)" ] } ], "metadata": { "kernelspec": { "display_name": "Scilab", "language": "scilab", "name": "scilab" }, "language_info": { "file_extension": ".sce", "help_links": [ { "text": "MetaKernel Magics", "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" } ], "mimetype": "text/x-octave", "name": "scilab", "version": "0.7.1" } }, "nbformat": 4, "nbformat_minor": 0 }