{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 6: Properties of fluids" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 6.10: Example_9.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "h1=1220.4 //Btu/lbm\n", "s1=1.6050 //Btu/lbm R\n", "s2=1.6050 //Btu/lbm R\n", "p2=3 //psia\n", "sf=0.2008 //Btu/lbm R\n", "hf=109.37\n", "sfg=1.6855 //Btu/lbm R\n", "hfg=1013.2 //Btu/lbm \n", "eta=0.7\n", "//calculations\n", "x= (s2-sf)/sfg\n", "h2=hf+ x*hfg\n", "Wrev= h1-h2\n", "w=eta*Wrev\n", "//results\n", "printf('Work done = %d Btu/lbm',Wrev)\n", "printf('\n Work done in case 2 = %.1f Btu/lbm',w)\n", "//The asnwer is a bit different due to rounding off error int he textbook" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 6.11: Example_10.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "disp('From steam tables,')\n", "hb=1192.8 //Btu/lbm\n", "ha=hb\n", "hf=330.51 //Btu/lbm\n", "hfg=863.6 //Btu/lbm\n", "//calculations\n", "x=(ha-hf)/hfg\n", "//results\n", "printf('Quality of wet steam = %.1f percent',x*100)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 6.1: Example_1.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "m=1 //lbm\n", "T=32+460 //R\n", "//calculations\n", "disp('From steam tables')\n", "hf=0\n", "p=0.08854 //psi\n", "vf=0.01602 //ft^3\n", "u = hf- p*vf*144/778.16\n", "//results\n", "printf('Internal energy = %.7f Btu/lbm',u)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 6.2: Example_2.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "T=35+459.6 //R\n", "//calculations\n", "disp('From steam tables,')\n", "hfg=1074.1 //Btu/lbm\n", "ds=hfg/T\n", "//results\n", "printf('Change in entropy = %.4f Btu/lbm R',ds)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 6.3: Example_3.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "p=3 //psi\n", "x=0.35\n", "//calculations\n", "printf('From steam tables,')\n", "p=3 //psi\n", "vf=0.01630 //ft^3/lbm\n", "vg=118.71 //ft^3/lbm\n", "hf=109.37 //Btu/lbm\n", "hfg=1013.2 //Btu/lbm\n", "vx=vf+x*(vg-vf)\n", "hx=hf+x*(hfg)\n", "//results\n", "printf('specific volume = %.1f ft^3/lbm',vx)\n", "printf('\n specific enthalpy = %.1f Btu/lbm',hx)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 6.4: Example_4.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "disp('From steam tables,')\n", "T1=355.21 //F\n", "T2=500 //F\n", "hg=1193.4 //Btu/lbm\n", "h=1274.8 //Btu/lbm\n", "//calculations\n", "Qrev=h-hg\n", "//results\n", "printf('Heat transferred = %.1f Btu/lbm',Qrev)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 6.5: Example_5.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "Qrev=81.4 //Btu/lbm\n", "T1=355.21 //F\n", "T2=500 //F\n", "cp=0.562\n", "//calculations\n", "cp=Qrev/(T2-T1)\n", "ds=cp*(log((460+T2)/(460+T1)))\n", "s1=1.5728\n", "s2=s1+ds\n", "//results\n", "printf('Change in entropy = %.4f Btu/lbm F',ds)\n", "printf('\n Final entropy = %.4f Btu/lbm F',s2)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 6.6: Example_6.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "m=1 //lbm\n", "P1=144 //psia\n", "P2=150 //psia\n", "t1=360 //F\n", "J=778.16\n", "//calculations\n", "disp('From steam tables,')\n", "v1=3.160 //ft^3/lbm\n", "h1=1196.5 //Btu/lbm\n", "u1=h1-P1*v1*144/J\n", "h2=1211.4 //Btu/lbm\n", "u2=h2 - P2*144*v1/J\n", "Qrev=u2-u1\n", "//results\n", "printf('Heat transferred = %.1f Btu/lbm',Qrev)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 6.7: Example_7.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "sf=0.12948\n", "dt=0.32 //F\n", "t1=100 //F\n", "x=0.6\n", "//calculations\n", "t2=t1+dt\n", "hf=67.97\n", "ht=2.7\n", "hp=0.3\n", "h2=hf+ht+hp\n", "Wrev=hf-h2\n", "Wact=Wrev/x\n", "//results\n", "printf('Actual work done = %.1f Btu/lbm',Wact)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 6.8: Example_8.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "p1=1000 //psia\n", "t1=100.32 //F\n", "h1=70.97 //Btu/lbm\n", "p2=1000 //psia\n", "t2=544.61 //F\n", "h2=1191.8 //Btu/lbm\n", "//calculations\n", "Qrev=h2-h1\n", "//results\n", "printf('Heat transferred = %.1f Btu/lbm',Qrev)" ] } ], "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 }