summaryrefslogtreecommitdiff
path: root/1919/CH5/EX5.23/Ex5_23.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1919/CH5/EX5.23/Ex5_23.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '1919/CH5/EX5.23/Ex5_23.sce')
-rwxr-xr-x1919/CH5/EX5.23/Ex5_23.sce43
1 files changed, 43 insertions, 0 deletions
diff --git a/1919/CH5/EX5.23/Ex5_23.sce b/1919/CH5/EX5.23/Ex5_23.sce
new file mode 100755
index 000000000..aa3883cd6
--- /dev/null
+++ b/1919/CH5/EX5.23/Ex5_23.sce
@@ -0,0 +1,43 @@
+
+// Theory and Problems of Thermodynamics
+// Chapter 5
+//Second Law of Thermodynamcis
+// Example 23
+
+clear ;clc;
+
+//Given data
+V = 1 // volume of insulated tank in m^3
+r = 1.4 // ratio of specific heat
+P0 = 0.1*1e6 // pressure of air in insulated tank in Pa
+T0 = 300 // temperature of air in insulated tank in K
+Pi = 1*1e6 // pressure of high pressure line in Pa
+Ti = 600 // temperature of high pressure line in K
+Pf = 1*1e6 // final pressure of air in the tank (Pa)
+R = 8.314 // universal gas constant
+// The first law expresion for a control volume (the tank) ignoring the changes//in KE and PE gives
+// mi * hi = dE/dt
+// Cp*Ti*(Nf-N0)=Cv*(Nf*Tf-N0*T0) (A)
+// Nf = Pf*V/(R*Tf); N0 = P0*V/(R*T0)
+// Equation A can be written as
+deff('y=temp(Tf)', 'y = r*Ti*(Pf/Tf-P0/T0) - Pf + P0')
+Tf = fsolve(10,temp)
+
+N0 = P0*V/(R*T0) //mass of air in tank(mol)
+Nf = Pi*V/(R*Tf) //mass of air entered from line(mol)
+m = Nf-N0 //mass of air entered tank(mol)
+
+// 40.093 mol air changed from 0.1 MPa, 300K to 1 MPa, 711.87 K.
+// The entrophy change of this air is del S1
+S1 = N0*R*{r/(r-1)*log(Tf/T0)-log(Pf/P0)}
+
+// 128.869 mol air changed from 1 MPa, 600K to 1 MPa, 711.87 K.
+// The entrophy change of this air is del S2
+S2 = m*R*r/(r-1)*log(Tf/Ti)
+
+S = S1 + S2 // total entropy change
+
+
+// Output Results
+mprintf('Mass of air entered the tank = %5.3f mol', m)
+mprintf('\n Entrophy change associated with the process = %5.3f J/K', S)