summaryrefslogtreecommitdiff
path: root/Thermodynamics_by_Gaggioli_and_Obert/18-Refrigeration.ipynb
diff options
context:
space:
mode:
authorPrashant S2020-04-14 10:25:32 +0530
committerGitHub2020-04-14 10:25:32 +0530
commit06b09e7d29d252fb2f5a056eeb8bd1264ff6a333 (patch)
tree2b1df110e24ff0174830d7f825f43ff1c134d1af /Thermodynamics_by_Gaggioli_and_Obert/18-Refrigeration.ipynb
parentabb52650288b08a680335531742a7126ad0fb846 (diff)
parent476705d693c7122d34f9b049fa79b935405c9b49 (diff)
downloadall-scilab-tbc-books-ipynb-master.tar.gz
all-scilab-tbc-books-ipynb-master.tar.bz2
all-scilab-tbc-books-ipynb-master.zip
Merge pull request #1 from prashantsinalkar/masterHEADmaster
Initial commit
Diffstat (limited to 'Thermodynamics_by_Gaggioli_and_Obert/18-Refrigeration.ipynb')
-rw-r--r--Thermodynamics_by_Gaggioli_and_Obert/18-Refrigeration.ipynb305
1 files changed, 305 insertions, 0 deletions
diff --git a/Thermodynamics_by_Gaggioli_and_Obert/18-Refrigeration.ipynb b/Thermodynamics_by_Gaggioli_and_Obert/18-Refrigeration.ipynb
new file mode 100644
index 0000000..1ed9863
--- /dev/null
+++ b/Thermodynamics_by_Gaggioli_and_Obert/18-Refrigeration.ipynb
@@ -0,0 +1,305 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 18: Refrigeration"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18.1: Work_and_cop_calculations.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"clear\n",
+"//Initialization of variables\n",
+"Ta=500 //R\n",
+"Tr=540 //R\n",
+"//calculations\n",
+"cop=Ta/(Tr-Ta)\n",
+"hp=4.71/cop\n",
+"disp('From steam tables,')\n",
+"ha=48.02\n",
+"hb=46.6\n",
+"hc=824.1\n",
+"hd=886.9\n",
+"Wc=-(hd-hc)\n",
+"We=-(hb-ha)\n",
+"//results\n",
+"printf('Coefficient of performance = %.1f ',cop)\n",
+"printf('\n horsepower required per ton of refrigeration = %.3f hp/ton refrigeration',hp)\n",
+"printf('\n Work of compression = %.1f Btu/lbm',Wc)\n",
+"printf('\n Work of expansion = %.2f Btu/lbm',We)\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18.2: cop_calculatio.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"clear\n",
+"//Initialization of variables\n",
+"x=0.8\n",
+"he=26.28 //Btu/lbm\n",
+"hb=26.28 //Btu/lbm\n",
+"pe=98.76 //psia\n",
+"pc=51.68 //psia\n",
+"hc=82.71 //Btu/lbm\n",
+"hf=86.80+0.95\n",
+"//calculations\n",
+"dwisen=-(hf-hc)\n",
+"dwact=dwisen/x\n",
+"hd=hc-dwact\n",
+"cop=(hc-hb)/(hd-hc)\n",
+"//results\n",
+"printf('Coefficient of performance = %.2f',cop)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18.3: work_done_and_cop_calculations.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"clear\n",
+"//Initialization of variables\n",
+"hc=613.3//btu/lbm\n",
+"hb=138.9//btu/lbm\n",
+"ha=138.9//btu/lbm\n",
+"hd=713.4 //btu/lbm\n",
+"ta=464.7 //R\n",
+"t0=545.7 //R\n",
+"v=8.150 //ft^3/lbm\n",
+"//calculations\n",
+"Qa=hc-hb\n",
+"Qr=ha-hd\n",
+"Wcd=Qa+Qr\n",
+"cop=abs(Qa/Wcd)\n",
+"hp=abs(4.71/cop)\n",
+"carnot=abs(ta/(t0-ta))\n",
+"rel=abs(cop/carnot)\n",
+"mass=200/Qa\n",
+"C=mass*v\n",
+"//results\n",
+"printf('Work done = %.1f Btu/lbm',Wcd)\n",
+"printf('\n horsepower required per ton of refrigeration = %.3f hp/ton refrigeration',hp)\n",
+"printf('\n Coefficient of performance actual = %.2f ',cop)\n",
+"printf('\n Ideal cop = %.3f',carnot)\n",
+"printf('\n relative efficiency = %.3f',rel)\n",
+"printf('\n Mass flow rate = %.3f lbm/min ton',mass)\n",
+"printf('\n Compressor capacity = %.2f cfm/ton',C)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18.4: Pressure_ratio_calculations.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"clear\n",
+"//Initialization of variables\n",
+"pc=0.6982 //psia\n",
+"pe=0.1217 //psia\n",
+"m=200 //gal/min\n",
+"qual=0.98\n",
+"h1=23.07 //Btu/lbm\n",
+"h2=8.05 //Btu/lbm\n",
+"hw=1071.3\n",
+"//calculations\n",
+"rp=pc/pe\n",
+"m2=m/0.01602 *0.1388 //Conversion of units \n",
+"m2=1670\n",
+"dh=15.02\n",
+"Qa=m2*(h1-h2)\n",
+"h3=h2 + qual*hw\n",
+"m3=Qa/(h3-h1)\n",
+"v=0.016+ qual*2444\n",
+"C=m3*v\n",
+"//results\n",
+"printf('Pressure ratio = %.2f',rp)\n",
+"printf('\n Heat = %d Btu/min',Qa)\n",
+"printf('\n Water make up required = %.2f lbm/min',m3)\n",
+"printf('\n Volume of vapor entering ejector = %d cfm',C)\n",
+"disp('The answers are a bit different due to rounding off error in textbook')\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18.5: Work_done_and_heat_calculations.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"clear\n",
+"//Initialization of variables\n",
+"disp('From fig B-4,')\n",
+"disp('Appropraite notation from textbook has been used')\n",
+"disp('All are enthalpy values at different stages')\n",
+"hc=73.5 //Btu/lbm\n",
+"hb=26.28 //Btu/lbm\n",
+"hd=91.58 //Btu/lbm\n",
+"hc2=190.7 //Btu/lbm\n",
+"hd2=244.3 //Btu/lbm\n",
+"hb2=44.4 //Btu/lbm\n",
+"m1=1 //lbm\n",
+"m2=0.461 //lbm\n",
+"hc1=73.5 //Btu/lbm\n",
+"hd1=83.35 //Btu/lbm \n",
+"hc2=190.7 //Btu/lbm \n",
+"hd2=244.3 //Btu/lbm\n",
+"hb1=12.55 //Btu/lbm \n",
+"hc22=197.58 //Btu/lbm \n",
+"hd22=224 //Btu/lbm\n",
+"//Calculations\n",
+"w1=hc-hd\n",
+"qa1=hc-hb\n",
+"cop1=abs(qa1/(w1))\n",
+"hp1=4.71/cop1\n",
+"w2=hc2-hd2\n",
+"qa2=hc2-hb2\n",
+"cop2=abs(qa2/(w2))\n",
+"hp2=4.71/cop2\n",
+"qa3=m1*(hc1-hb1)\n",
+"w3=m1*(hc1-hd1) + m2*(hc22-hd22)\n",
+"cop3=abs(qa3/w3)\n",
+"hp3=4.71/cop3\n",
+"//results\n",
+"disp('part a')\n",
+"printf('Work done = %.2f Btu/lbm',w1)\n",
+"printf('\n Heat = %.2f Btu/lbm',qa1)\n",
+"printf('\n horsepower required per ton of refrigeration = %.3f hp/ton refrigeration',hp1)\n",
+"printf('\n Coefficient of performance actual = %.2f ',cop1)\n",
+"disp('case 2')\n",
+"printf('\n Work done = %.1f Btu/lbm',w2)\n",
+"printf('\n Heat = %.2f Btu/lbm',qa2)\n",
+"printf('\n horsepower required per ton of refrigeration = %.3f hp/ton refrigeration',hp2)\n",
+"printf('\n Coefficient of performance actual = %.2f ',cop2)\n",
+"disp('part b')\n",
+"printf('\n Work done = %.1f Btu/lbm',w3)\n",
+"printf('\n Heat = %.2f Btu/lbm',qa3)\n",
+"printf('\n horsepower required per ton of refrigeration = %.3f hp/ton refrigeration',hp3)\n",
+"printf('\n Coefficient of performance actual = %.2f ',cop3)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18.6: hp_and_cop_calculations.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"clear\n",
+"//Initialization of variables\n",
+"disp('From fig B-4,')\n",
+"disp('Appropraite notation from textbook has been used')\n",
+"disp('All are enthalpy values at different stages')\n",
+"ha=44.36 //Btu/lbm \n",
+"hc=18.04 //Btu/lbm\n",
+"hj=197.58 //Btu/lbm\n",
+"hh=213.5 //Btu/lbm \n",
+"hd=hc //Btu/lbm\n",
+"he=190.66 //Btu/lbm\n",
+"hk=241.25 //Btu/lbm\n",
+"//calculations\n",
+"m=(hc-ha)/(ha-hj)\n",
+"hi=(m*hj+hh)/(1+m)\n",
+"Qa=he-hd\n",
+"W=he-hh + (1+m)*(hi-hk)\n",
+"cop=abs(Qa/W)\n",
+"hp=4.71/cop\n",
+"//results\n",
+"printf('\n horsepower required per ton of refrigeration = %.3f hp/ton refrigeration',hp)\n",
+"printf('\n Coefficient of performance actual = %.2f ',cop)"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}