summaryrefslogtreecommitdiff
path: root/Basic_Engineering_Thermodynamics_by_R_Joel/4-Steam_and_two_phase_systems.ipynb
diff options
context:
space:
mode:
authorPrashant S2020-04-14 10:25:32 +0530
committerGitHub2020-04-14 10:25:32 +0530
commit06b09e7d29d252fb2f5a056eeb8bd1264ff6a333 (patch)
tree2b1df110e24ff0174830d7f825f43ff1c134d1af /Basic_Engineering_Thermodynamics_by_R_Joel/4-Steam_and_two_phase_systems.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 'Basic_Engineering_Thermodynamics_by_R_Joel/4-Steam_and_two_phase_systems.ipynb')
-rw-r--r--Basic_Engineering_Thermodynamics_by_R_Joel/4-Steam_and_two_phase_systems.ipynb1096
1 files changed, 1096 insertions, 0 deletions
diff --git a/Basic_Engineering_Thermodynamics_by_R_Joel/4-Steam_and_two_phase_systems.ipynb b/Basic_Engineering_Thermodynamics_by_R_Joel/4-Steam_and_two_phase_systems.ipynb
new file mode 100644
index 0000000..aa80cfc
--- /dev/null
+++ b/Basic_Engineering_Thermodynamics_by_R_Joel/4-Steam_and_two_phase_systems.ipynb
@@ -0,0 +1,1096 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4: Steam and two phase systems"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.10: mass_of_steam_and_water.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example .10');\n",
+"\n",
+"// aim : To determine\n",
+"// (a) the mass of steam entering the heater\n",
+"// (b) the mass of water entering the heater\n",
+"\n",
+"// Given values\n",
+"x = .95;// Dryness fraction\n",
+"P = .7;// pressure,[MN/m^2]\n",
+"d = 25;// internal diameter of heater,[mm]\n",
+"C = 12; // steam velocity in the pipe,[m/s]\n",
+"\n",
+"// solution\n",
+"// from steam table at .7 MN/m^2 pressure\n",
+"hf = 697.1;// [kJ/kg]\n",
+"hfg = 2064.9;// [kJ/kg]\n",
+"hg = 2762.0; // [kJ/kg]\n",
+"vg = .273; // [m^3/kg]\n",
+"\n",
+"// (a)\n",
+"v = x*vg; // [m^3/kg]\n",
+"ms_dot = %pi*(d*10^-3)^2*C*3600/(4*v);// mass of steam entering, [kg/h]\n",
+"mprintf('\n (a) The mass of steam entering the heater is = %f kg/h \n',ms_dot);\n",
+"\n",
+"// (b)\n",
+"h = hf+x*hfg;// specific enthalpy of steam entering heater,[kJ/kg]\n",
+"// again from steam tables\n",
+"hf1 = 376.8;// [kJ/kg] at 90 C\n",
+"hf2 = 79.8;// [kJ/kg] at 19 C\n",
+"\n",
+"// using energy balance,mw_dot*(hf1-hf2)=ms_dot*(h-hf1)\n",
+"mw_dot = ms_dot*(h-hf1)/(hf1-hf2);// mass of water entering to heater,[kg/h]\n",
+"\n",
+"mprintf('\n (b) The mass of water entering the heater is = %f kg/h \n',mw_dot);\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.11: change_of_internal_energy.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.11');\n",
+"\n",
+"// aim: To determine\n",
+"// the change of internal energy\n",
+"\n",
+"// Given values\n",
+"m = 1.5;// mass of steam,[kg]\n",
+"P1 = 1;// initial pressure, [MN/m^2]\n",
+"t = 225;// temperature, [C]\n",
+"P2 = .28;// final pressure, [MN/m^2]\n",
+"x = .9;// dryness fraction of steam at P2\n",
+"\n",
+"// solution\n",
+"\n",
+"// from steam table at P1\n",
+"h1 = 2886;// [kJ/kg]\n",
+"v1 = .2198; // [m^3/kg]\n",
+"// hence\n",
+"u1 = h1-P1*v1*10^3;// internal energy [kJ/kg]\n",
+"\n",
+"// at P2\n",
+"hf2 = 551.4;// [kJ/kg]\n",
+"hfg2 = 2170.1;// [kJ/kg]\n",
+"vg2 = .646; // [m^3/kg]\n",
+"// so\n",
+"h2 = hf2+x*hfg2;// [kj/kg]\n",
+"v2 = x*vg2;// [m^3/kg]\n",
+"\n",
+"// now\n",
+"u2 = h2-P2*v2*10^3;// [kJ/kg]\n",
+"\n",
+"// hence change in specific internal energy is\n",
+"del_u = u2-u1;// [kJ/kg]\n",
+"\n",
+"del_u = m*del_u;// [kJ];\n",
+"mprintf('\n The change in internal energy is = %f kJ \n',del_u);\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.12: dryness_fraction.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.12');\n",
+"\n",
+"// aim : To determine \n",
+"// the dryness fraction of steam after throttling\n",
+"\n",
+"// given values\n",
+"P1 = 1.4;// pressure before throttling, [MN/m^2]\n",
+"x1 = .7;// dryness fraction before throttling\n",
+"P2 = .11;// pressure after throttling, [MN/m^2]\n",
+"\n",
+"// solution\n",
+"// from steam table\n",
+"hf1 = 830.1;// [kJ/kg]\n",
+"hfg1 = 1957.7;// [kJ/kg]\n",
+"h1 = hf1 + x1*hfg1; // [kJ/kg]\n",
+"\n",
+"hf2 = 428.8;// [kJ/kg]\n",
+"hfg2 = 2250.8;// [kJ/kg]\n",
+"\n",
+"// now for throttling,\n",
+"// hf1+x1*hfg1=hf2+x2*hfg2; where x2 is dryness fraction after throttling\n",
+"\n",
+"x2=(h1-hf2)/hfg2; // final dryness fraction\n",
+"\n",
+"mprintf('\n Dryness fraction of steam after throttling is = %f \n',x2);\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.13: condition_of_steam_and_internal_diameter.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.13');\n",
+"\n",
+"// aim : To determine \n",
+"// the dryness fraction of steam \n",
+"// and the internal diameter of the pipe\n",
+"\n",
+"// Given values\n",
+"\n",
+"// steam1\n",
+"P1 = 2;// pressure before throttling, [MN/m^2]\n",
+"t = 300;// temperature,[C]\n",
+"ms1_dot = 2;// steam flow rate, [kg/s]\n",
+"P2 = 800;// pressure after throttling, [kN/m^2]\n",
+"\n",
+"// steam2\n",
+"P = 800;// pressure, [N/m^2]\n",
+"x2 = .9;// dryness fraction\n",
+"ms2_dot = 5; // [kg/s]\n",
+"\n",
+"// solution\n",
+"// (a)\n",
+"// from steam table specific enthalpy of steam1 before throttling is\n",
+"hf1 = 3025;// [kJ/kg]\n",
+"// for throttling process specific enthalpy will same so final specific enthalpy of steam1 is\n",
+"hf2 = hf1;\n",
+"// hence\n",
+"h1 = ms1_dot*hf2;// [kJ/s]\n",
+"\n",
+"// calculation of specific enthalpy of steam2\n",
+"hf2 = 720.9;// [kJ/kg]\n",
+"hfg2 = 2046.5;// [kJ/kg]\n",
+"// hence\n",
+"h2 = hf2+x2*hfg2;// specific enthalpy, [kJ/kg]\n",
+"h2 = ms2_dot*h2;// total enthalpy, [kJ/s]\n",
+"\n",
+"// after mixing\n",
+"m_dot = ms1_dot+ms2_dot;// total mass of mixture,[kg/s]\n",
+"h = h1+h2;// Total enthalpy of the mixture,[kJ/s]\n",
+"h = h/7;// [kJ/kg]\n",
+"\n",
+"// At pressure 800 N/m^2 \n",
+"hf = 720.9;// [kJ/kg]\n",
+"hfg = 2046.5;// [kJ/kg]\n",
+"// so total enthalpy is,hf+x*hfg, where x is dryness fraction of mixture and which is equal to h\n",
+"// hence\n",
+"x = (h-hf)/hfg;// dryness fraction after mixing\n",
+"mprintf('\n (a) The condition of the resulting mixture is dry with dryness fraction = %f \n',x);\n",
+"\n",
+"// (b)\n",
+"// Given\n",
+"C = 15;// velocity, [m/s]\n",
+"// from steam table\n",
+"v = .1255;// [m^/kg]\n",
+"A = ms1_dot*v/C;// area, [m^2]\n",
+"// using ms1_dot = A*C/v, where A is cross section area in m^2 and\n",
+"// A = %pi*d^2/4, where d is diameter of the pipe \n",
+"\n",
+"// calculation of d\n",
+"d = sqrt(4*A/%pi); // diameter, [m]\n",
+"\n",
+"mprintf('\n (b) The internal diameter of the pipe is = %f mm \n',d*1000);\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.14: dryness_fraction.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.14');\n",
+"\n",
+"// aim : To estimate \n",
+"// the dryness fraction\n",
+"\n",
+"// Given values\n",
+"M = 1.8;// mass of condensate, [kg]\n",
+"m = .2;// water collected, [kg]\n",
+"\n",
+"// solution\n",
+"x = M/(M+m);// formula for calculation of dryness fraction using seprating calorimeter\n",
+"\n",
+"mprintf(' \n The dryness fraction of the steam entering seprating calorimeter is = %f \n',x);\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.15: dryness_fraction.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.15');\n",
+"\n",
+"// aim : To determine\n",
+"// the dryness fraction of the steam at 2.2 MN/m^2\n",
+"\n",
+"// Given values\n",
+"P1 = 2.2;// [MN/m^2]\n",
+"P2 = .13;// [MN/m^2]\n",
+"t2 = 112;// [C]\n",
+"tf2 = 150;// temperature, [C]\n",
+"\n",
+"// solution\n",
+"// from steam table, at 2.2 MN/m^2\n",
+"// saturated steam at 2 MN/m^2 Pressure\n",
+"hf1 = 931;// [kJ/kg]\n",
+"hfg1 = 1870;// [kJ/kg]\n",
+"hg1 = 2801;// [kJ/kg]\n",
+"\n",
+"// for superheated steam\n",
+"// at .1 MN/m^2\n",
+"hg2 = 2675;// [kJ/kg]\n",
+"hg2_150 = 2777;// specific enthalpy at 150 C, [kJ/kg]\n",
+"tf2 = 99.6;// saturation temperature, [C]\n",
+"\n",
+"// at .5 MN/m^2\n",
+"hg3 = 2693;// [kJ/kg]\n",
+"hg3_150 = 2773;// specific enthalpy at 150 C, [kJ/kg]\n",
+"tf3 = 111.4;// saturation temperature, [C]\n",
+"\n",
+"Table_P_h1 = [[.1,.5];[hg2,hg3]];// where, P in MN/m^2 and h in [kJ/kg]\n",
+"hg = interpln(Table_P_h1,.13);// specific entahlpy at .13 MN/m^2, [kJ/kg]\n",
+"\n",
+"Table_P_h2 = [[.1,.5];[hg2_150,hg3_150]];// where, P in MN/m^2 and h in [kJ/kg]\n",
+"hg_150 = interpln(Table_P_h2,.13);// specific entahlpy at .13 MN/m^2 and 150 C, [kJ/kg]\n",
+"\n",
+"Table_P_tf = [[.1,.5];[tf2,tf3]];// where, P in MN/m^2 and h in [kJ/kg]\n",
+"tf = interpln(Table_P_tf,.13);// saturation temperature, [C]\n",
+"\n",
+"// hence\n",
+"h2 = hg+(hg_150-hg)/(t2-tf)/(tf2-tf);// specific enthalpy at .13 MN/m^2 and 112 C, [kJ/kg]\n",
+"\n",
+"// now since process is throttling so h2=h1\n",
+"// and h1 = hf1+x1*hfg1, so\n",
+"x1 = (h2-hf1)/hfg1;// dryness fraction\n",
+"mprintf(' \n The dryness fraction of steam is = %f \n',x1);\n",
+"\n",
+"// There is a calculation mistake in book so answer is not matching\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.16: minimum_dryness_fraction.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.16');\n",
+"\n",
+"// aim : To determine \n",
+"// the minimum dryness fraction of steam\n",
+"\n",
+"// Given values\n",
+"P1 = 1.8;// testing pressure,[MN/m^2]\n",
+"P2 = .11;// pressure after throttling,[MN/m^2]\n",
+"\n",
+"// solution\n",
+"// from steam table\n",
+"// at .11 MN/m^2 steam is completely dry and specific enthalpy is\n",
+"hg = 2680;// [kJ/kg]\n",
+"\n",
+"// before throttling steam is wet, so specific enthalpy is=hf+x*hfg, where x is dryness fraction\n",
+"// from steam table\n",
+"hf = 885;// [kJ/kg]\n",
+"hfg = 1912;// [kJ/kg]\n",
+"\n",
+"// now for throttling process,specific enthalpy will same before and after\n",
+"// hence\n",
+"x = (hg-hf)/hfg;\n",
+"mprintf('\n The minimum dryness fraction of steam is x = %f \n',x);\n",
+"\n",
+"// End\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.17: mass_dryness_fraction_and_heat_transfer.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.17');\n",
+"\n",
+"// aim : To determine the\n",
+"// (a) mass of steam in the vessel\n",
+"// (b) final dryness of the steam\n",
+"// (c) amount of heat transferrred during the cooling process\n",
+"\n",
+"// Given values\n",
+"V1 = .8;// [m^3]\n",
+"P1 = 360;// [kN/m^2]\n",
+"P2 = 200;// [kN/m^2]\n",
+"\n",
+"// solution\n",
+"\n",
+"// (a)\n",
+"// at 360 kN/m^2\n",
+"vg1 = .510;// [m^3]\n",
+"m = V1/vg1;// mass of steam,[kg]\n",
+"mprintf('\n (a) The mass of steam in the vessel is = %f kg\n',m);\n",
+"\n",
+"// (b)\n",
+"// at 200 kN/m^2\n",
+"vg2 = .885;// [m^3/kg]\n",
+"// the volume remains constant so\n",
+"x = vg1/vg2;// final dryness fraction\n",
+"mprintf('\n (b) The final dryness fraction of the steam is = %f \n',x);\n",
+"\n",
+"// (c)\n",
+"// at 360 kN/m^2\n",
+"h1 = 2732.9;// [kJ/kg]\n",
+"// hence\n",
+"u1 = h1-P1*vg1;// [kJ/kg]\n",
+"\n",
+"// at 200 kN/m^2\n",
+"hf = 504.7;// [kJ/kg]\n",
+"hfg=2201.6;//[kJ/kg]\n",
+"// hence\n",
+"h2 = hf+x*hfg;// [kJ/kg]\n",
+"// now\n",
+"u2 = h2-P2*vg1;// [kJ/kg]\n",
+"// so\n",
+"del_u = u2-u1;// [kJ/kg]\n",
+"// from the first law of thermodynamics del_U+W=Q, \n",
+"W = 0;// because volume is constant\n",
+"del_U = m*del_u;// [kJ]\n",
+"// hence\n",
+"Q = del_U;// [kJ]\n",
+"mprintf('\n (c) The amount of heat transferred during cooling process is = %f kJ \n',Q);\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.18: specific_heat.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.18');\n",
+"\n",
+"// aim : To determine\n",
+"// the heat received by the steam per kilogram\n",
+"\n",
+"// Given values\n",
+"// initial\n",
+"P1 = 4;// pressure, [MN/m^2]\n",
+"x1 = .95; // dryness fraction\n",
+"\n",
+"// final\n",
+"t2 = 350;// temperature,[C]\n",
+"\n",
+"// solution\n",
+"\n",
+"// from steam table, at 4 MN/m^2 and x1=.95\n",
+"hf = 1087.4;// [kJ/kg]\n",
+"hfg = 1712.9;// [kJ/kg]\n",
+"// hence\n",
+"h1 = hf+x1*hfg;// [kJ/kg]\n",
+"\n",
+"// since pressure is kept constant ant temperature is raised so at this condition\n",
+"h2 = 3095;// [kJ/kg]\n",
+"\n",
+"// so by energy balance\n",
+"Q = h2-h1;// Heat received,[kJ/kg]\n",
+"mprintf('\n The heat received by the steam is = %f kJ/kg \n',Q);\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.19: condition_of_steam.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.19');\n",
+"\n",
+"// aim : To determine the condition of the steam after \n",
+"// (a) isothermal compression to half its initial volume,heat rejected\n",
+"// (b) hyperbolic compression to half its initial volume\n",
+"\n",
+"// Given values\n",
+"V1 = .3951;// initial volume,[m^3]\n",
+"P1 = 1.5;// initial pressure,[MN/m^2]\n",
+"\n",
+"// solution\n",
+"\n",
+"// (a)\n",
+"// from steam table, at 1.5 MN/m^2 \n",
+"hf1 = 844.7;// [kJ/kg]\n",
+"hfg1 = 1945.2;// [kJ/kg]\n",
+"hg1 = 2789.9;// [kJ/kg]\n",
+"vg1 = .1317;// [m^3/kg]\n",
+"\n",
+"// calculation\n",
+"m = V1/vg1;// mass of steam,[kg]\n",
+"vg2b = vg1/2;// given,[m^3/kg](vg2b is actual specific volume before compression)\n",
+"x1 = vg2b/vg1;// dryness fraction\n",
+"h1 = m*(hf1+x1*hfg1);// [kJ]\n",
+"Q = m*x1*hfg1;// heat loss,[kJ]\n",
+"mprintf('\n (a) The Quantity of steam present is = %f kg \n',m);\n",
+"mprintf('\n Dryness fraction is = %f \n',x1);\n",
+"mprintf('\n The enthalpy is = %f kJ \n',h1);\n",
+"mprintf('\n The heat loss is = %f kJ \n',Q);\n",
+"\n",
+"// (b)\n",
+"V2 = V1/2;\n",
+"// Given compression is according to the law PV=Constant,so\n",
+"P2 = P1*V1/V2;// [MN/m^2]\n",
+"// from steam table at P2\n",
+"hf2 = 1008.4;// [kJ/kg]\n",
+"hfg2 = 1793.9;// [kJ/kg]\n",
+"hg2 = 2802.3;// [kJ/kg]\n",
+"vg2 = .0666;// [m^3/kg]\n",
+"\n",
+"// calculation\n",
+"x2 = vg2b/vg2;// dryness fraction\n",
+"h2 = m*(hf2+x2*hfg2);// [kJ]\n",
+"\n",
+"mprintf('\n (b) The dryness fraction is = %f \n',x2);\n",
+"mprintf('\n The enthalpy is = %f kJ\n',h2);\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.1: specific_enthalpies.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.1');\n",
+"\n",
+"// aim : To determine\n",
+"// the enthalpy\n",
+"\n",
+"// Given values\n",
+"P = .50;// Pressure, [MN/m^2]\n",
+"\n",
+"// solution\n",
+"\n",
+"// From steam tables, at given pressure\n",
+"hf = 640.1;// specific liquid enthalpy ,[kJ/kg]\n",
+"hfg = 2107.4;// specific enthalpy of evaporation ,[kJ/kg]\n",
+"hg = 2747.5; // specific enthalpy of dry saturated steam ,[kJ/kg]\n",
+"tf = 151.8; // saturation temperature,[C]\n",
+"\n",
+"mprintf('\n The specific liquid enthalpy is = %f kJ/kg \n',hf);\n",
+"mprintf('\n The specific enthalpy of evaporation is = %f kJ/kg \n',hfg);\n",
+"mprintf('\n The specific enthalpy of dry saturated steam is = %f kJ/kg \n',hg);\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.20: mass_work_change_in_internal_energy_and_heat_transfer.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.20');\n",
+"\n",
+"// aim : To determine the\n",
+"// (a) mass of steam \n",
+"// (b) work transfer\n",
+"// (c) change of internal energy\n",
+"// (d) heat exchange b/w the steam and surroundings\n",
+"\n",
+"// Given values\n",
+"P1 = 2.1;// initial pressure,[MN/m^2]\n",
+"x1 = .9;// dryness fraction\n",
+"V1 = .427;// initial volume,[m^3]\n",
+"P2 = .7;// final pressure,[MN/m^2]\n",
+"// Given process is polytropic with\n",
+"n = 1.25; // polytropic index\n",
+"\n",
+"// solution\n",
+"// from steam table\n",
+"\n",
+"// at 2.1 MN/m^2\n",
+"hf1 = 920.0;// [kJ/kg]\n",
+"hfg1=1878.2;// [kJ/kg]\n",
+"hg1=2798.2;// [kJ/kg]\n",
+"vg1 = .0949;// [m^3/kg]\n",
+"\n",
+"// and at .7 MN/m^2\n",
+"hf2 = 697.1;// [kJ/kg]\n",
+"hfg2 = 2064.9;// [kJ/kg]\n",
+"hg2 = 2762.0;// [kJ/kg]\n",
+"vg2 = .273;// [m^3/kg]\n",
+"\n",
+"// (a)\n",
+"v1 = x1*vg1;// [m^3/kg]\n",
+"m = V1/v1;// [kg]\n",
+"mprintf('\n (a) The mass of steam present is = %f kg\n',m);\n",
+"\n",
+"// (b)\n",
+"// for polytropic process\n",
+"v2 = v1*(P1/P2)^(1/n);// [m^3/kg]\n",
+"\n",
+"x2 = v2/vg2;// final dryness fraction\n",
+"// work transfer\n",
+"W = m*(P1*v1-P2*v2)*10^3/(n-1);// [kJ]\n",
+"mprintf('\n (b) The work transfer is = %f kJ\n',W);\n",
+"\n",
+"// (c)\n",
+"// initial\n",
+"h1 = hf1+x1*hfg1;// [kJ/kg]\n",
+"u1 = h1-P1*v1*10^3;// [kJ/kg]\n",
+"\n",
+"// final\n",
+"h2 = hf2+x2*hfg2;// [kJ/kg]\n",
+"u2 = h2-P2*v2*10^3;// [kJ/kg]\n",
+"\n",
+"del_U = m*(u2-u1);// [kJ]\n",
+"mprintf('\n (c) The change in internal energy is = %f kJ',del_U);\n",
+"if(del_U<0)\n",
+" disp('since del_U<0,so this is loss of internal energy')\n",
+"else\n",
+" disp('since del_U>0,so this is gain in internal energy')\n",
+"end\n",
+"\n",
+"// (d)\n",
+"Q = del_U+W;// [kJ]\n",
+"mprintf('\n (d) The heat exchange between the steam and surrounding is = %f kJ',Q);\n",
+"if(Q<0)\n",
+" disp('since Q<0,so this is loss of heat energy to surrounding')\n",
+"else\n",
+" disp('since Q>0,so this is gain in heat energy to the steam')\n",
+"end\n",
+"\n",
+"// there are minor vairations in the values reported in the book\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.21: volume_dryness_fraction_and_change_of_internal_energy.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.21');\n",
+"\n",
+"// aim : To determine the \n",
+"// (a) volume occupied by steam\n",
+"// (b)(1) final dryness fraction of steam\n",
+"// (2) Change of internal energy during expansion\n",
+"\n",
+"// (a)\n",
+"// Given values\n",
+"P1 = .85;// [mN/m^2]\n",
+"x1 = .97;\n",
+"\n",
+"// solution\n",
+"// from steam table, at .85 MN/m^2,\n",
+"vg1 = .2268;// [m^3/kg]\n",
+"// hence\n",
+"v1 = x1*vg1;// [m^3/kg]\n",
+"mprintf('\n (a) The volume occupied by 1 kg of steam is = %f m^3/kg\n',v1);\n",
+"\n",
+"// (b)(1)\n",
+"P2 = .17;// [MN/m^2]\n",
+"// since process is polytropic process with\n",
+"n = 1.13; // polytropic index\n",
+"// hence\n",
+"v2 = v1*(P1/P2)^(1/n);// [m^3/kg]\n",
+"\n",
+"// from steam table at .17 MN/m^2\n",
+"vg2 = 1.031;// [m^3/kg]\n",
+"// steam is wet so\n",
+"x2 = v2/vg2;// final dryness fraction\n",
+"mprintf('\n (b)(1) The final dryness fraction of the steam is = %f \n',x2);\n",
+"\n",
+"// (2)\n",
+"W = (P1*v1-P2*v2)*10^3/(n-1);// [kJ/kg]\n",
+"// since process is adiabatic, so\n",
+"del_u = -W;// [kJ/kg]\n",
+"mprintf('\n (2) The change in internal energy of the steam during expansion is = %f kJ/kg (This is a loss of internal energy)\n',del_u);\n",
+"// There are minor variation in the answer\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.2: Saturation_temperature_and_specific_enthalpies.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.2');\n",
+"\n",
+"// aim : To determine \n",
+"// saturation temperature and enthalpy\n",
+"\n",
+"// Given values\n",
+"P = 2.04;// pressure, [MN/m^2]\n",
+"\n",
+"// solution\n",
+"// since in the steam table values of enthalpy and saturation temperature at 2 and 2.1 MN?m^2 are given, so for knowing required values at given pressure,there is need to do interpolation\n",
+"\n",
+"// calculation of saturation temperature\n",
+"// from steam table\n",
+"Table_P_tf = [[2.1,2.0];[214.9,212.4]]; // P in [MN/m^2] and tf in [C]\n",
+"// using interpolation\n",
+"tf = interpln(Table_P_tf,2.04);// saturation temperature at given condition\n",
+"mprintf('\n The Saturation temperature is = %f C \n',tf);\n",
+"\n",
+"// calculation of specific liquid enthalpy\n",
+"// from steam table\n",
+"Table_P_hf = [[2.1,2.0];[920.0,908.6]];// P in [MN/m^2] and hf in [kJ/kg]\n",
+"// using interpolation\n",
+"hf = interpln(Table_P_hf,2.04); // enthalpy at given condition, [kJ/kg]\n",
+"mprintf('\n The Specific liquid enthalpy is = %f kJ/kg \n',hf);\n",
+"\n",
+"// calculation of specific enthalpy of evaporation\n",
+"// from steam table\n",
+"Table_P_hfg = [[2.1,2.0];[1878.2,1888.6]];// P in [MN/m^2] and hfg in [kJ/kg]\n",
+"// using interpolation\n",
+"hfg = interpln(Table_P_hfg,2.04); // enthalpy at given condition, [kJ/kg]\n",
+"mprintf('\n The Specific enthalpy of evaporation is = %f kJ/kg \n',hfg);\n",
+"\n",
+"// calculation of specific enthalpy of dry saturated steam\n",
+"// from steam table\n",
+"Table_P_hg = [[2.1,2.0];[2798.2,2797.2]];//P in [MN/m^2] and hg in [kJ/kg]\n",
+"// using interpolation\n",
+"hg = interpln(Table_P_hg,2.04); // enthalpy at given condition, [kJ/kg]\n",
+"mprintf('\n The Specific enthalpy of dry saturated steam is = %f kJ/kg \n',hg);\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.3: specific_enthalpy.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.3');\n",
+"\n",
+"// aim : To determine\n",
+"// the specific enthalpy\n",
+"\n",
+"// given values\n",
+"P = 2; // pressure ,[MN/m^2]\n",
+"t = 250; // Temperature, [C]\n",
+"cp = 2.0934; // average value of specific heat capacity, [kJ/kg K]\n",
+"\n",
+"// solution\n",
+"\n",
+"// looking up steam table it shows that at given pressure saturation temperature is 212.4 C,so\n",
+"tf = 212.4; // [C]\n",
+"// hence,\n",
+"Degree_of_superheat = t-tf;// [C]\n",
+"// from table at given temperature 250 C\n",
+"h = 2902; // specific enthalpy of steam at 250 C ,[kJ/kg]\n",
+"mprintf('\nThe specific enthalpy of steam at 2 MN/m^2 with temperature 250 C is = %f kJ/kg \n',h);\n",
+"\n",
+"// Also from steam table enthalpy at saturation temperature is\n",
+"hf = 2797.2 ;// [kJ/kg]\n",
+"// so enthalpy at given temperature is\n",
+"h = hf+cp*(t-tf);// [kJ/kg]\n",
+"\n",
+"mprintf('\n The specific enthalpy at given T and P by alternative path is = %f kJ/kg \n',h);\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4: specific_enthalpy.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.4');\n",
+"\n",
+"// aim : To determine\n",
+"// the specific enthalpy of steam\n",
+"\n",
+"// Given values\n",
+"P = 2.5;// pressure, [MN/m^2]\n",
+"t = 320; // temperature, [C]\n",
+"\n",
+"// solution\n",
+"// from steam table at given condition the saturation temperature of steam is 223.9 C, therefore steam is superheated\n",
+"tf = 223.9;// [C]\n",
+"\n",
+"// first let's calculate estimated enthalpy\n",
+"// again from steam table \n",
+"\n",
+"hg = 2800.9;// enthalpy at saturation temp, [kJ/kg]\n",
+"cp =2.0934;// specific heat capacity of steam,[kJ/kg K]\n",
+"\n",
+"// so enthalpy at given condition is\n",
+"h = hg+cp*(t-tf);// [kJ/kg]\n",
+"mprintf('\n The estimated specific enthalpy is = %f kJ/kg \n',h);\n",
+"\n",
+"// calculation of accurate specific enthalpy\n",
+"// we need double interpolation for this\n",
+"\n",
+"// first interpolation w.r.t. to temperature\n",
+"// At 2 MN/m^2\n",
+"Table_t_h = [[325,300];[3083,3025]];// where, t in [C] and h in [kJ/kg]\n",
+"h1 = interpln(Table_t_h,320); // [kJ/kg]\n",
+"\n",
+"// at 4 MN/m^2\n",
+"Table_t_h = [[325,300];[3031,2962]]; // t in [C] and h in [kJ/kg]\n",
+"h2 = interpln(Table_t_h,320); // [kJ/kg]\n",
+"\n",
+"// now interpolation w.r.t. pressure\n",
+"Table_P_h = [[4,2];[h2,h1]]; // where P in NM/m^2 and h1,h2 in kJ/kg\n",
+"h = interpln(Table_P_h,2.5);// [kJ/kg]\n",
+"mprintf('\n The accurate specific enthalpy of steam at pressure of 2.5 MN/m^2 and with a temperature 320 C is = %f kJ/kg \n',h);\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.5: specific_enthalpy.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.5');\n",
+"\n",
+"// aim : To determine \n",
+"// the specific enthalpy \n",
+"\n",
+"// Given values\n",
+"P = 70; // pressure, [kn/m^2]\n",
+"x = .85; // Dryness fraction\n",
+"\n",
+"// solution\n",
+"\n",
+"// from steam table, at given pressure \n",
+"hf = 376.8;// [kJ/kg]\n",
+"hfg = 2283.3;// [kJ/kg]\n",
+"\n",
+"// now using equation [2]\n",
+"h = hf+x*hfg;// specific enthalpy of wet steam,[kJ/kg]\n",
+"\n",
+"mprintf('\n The specific enthalpy of wet steam is = %f kJ/kg \n',h);\n",
+"\n",
+"// There is minor variation in the book's answer\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.8: specific_volume.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.8');\n",
+"\n",
+"// aim : To determine \n",
+"// the specific volume of wet steam\n",
+"\n",
+"// Given values\n",
+"P = 1.25; // pressure, [MN/m^2]\n",
+"x = .9; // dry fraction\n",
+"\n",
+"// solution\n",
+"// from steam table at given pressure\n",
+"vg = .1569;// [m^3/kg]\n",
+"// hence\n",
+"v = x*vg; // [m^3/kg]\n",
+"\n",
+"mprintf('\nThe specific volume of wet steam is = %f m^3/kg \n',v);\n",
+"\n",
+"// End"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.9: specific_volume.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clear;\n",
+"clc;\n",
+"disp('Example 4.9');\n",
+"\n",
+"// aim : To determine\n",
+"// the specific volume \n",
+"\n",
+"// Given values\n",
+"t = 325; // temperature, [C]\n",
+"P = 2; // pressure, [MN/m^2]\n",
+"\n",
+"// solution\n",
+"// from steam table at given t and P\n",
+"vf = .1321; // [m^3/kg]\n",
+"tf = 212.4; // saturation temperature, [C]\n",
+"\n",
+"mprintf('\n The specific volume of steam at pressure of 2 MN/m^2 and with temperature 325 C is = %f m^3/kg \n',vf);\n",
+"doh= t-tf; // degree of superheat, [C]\n",
+"mprintf('\n The degree of superheat is = %f C\n',doh);\n",
+"\n",
+"// End "
+ ]
+ }
+],
+"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
+}