summaryrefslogtreecommitdiff
path: root/572/CH3
diff options
context:
space:
mode:
Diffstat (limited to '572/CH3')
-rwxr-xr-x572/CH3/EX3.1/c3_1.sce39
-rwxr-xr-x572/CH3/EX3.10/c3_10.sce3
-rwxr-xr-x572/CH3/EX3.11/c3_11.sce21
-rwxr-xr-x572/CH3/EX3.2/c3_2.sce22
-rwxr-xr-x572/CH3/EX3.3/c3_3.sce18
-rwxr-xr-x572/CH3/EX3.4/c3_4.sce25
-rwxr-xr-x572/CH3/EX3.5/c3_5.sce3
-rwxr-xr-x572/CH3/EX3.6/c3_6.sce39
-rwxr-xr-x572/CH3/EX3.7/3_7fig.pdfbin0 -> 3621 bytes
-rwxr-xr-x572/CH3/EX3.7/c3_7.sce50
-rwxr-xr-x572/CH3/EX3.8/c3_8.sce18
-rwxr-xr-x572/CH3/EX3.9/c3_9.sce25
12 files changed, 263 insertions, 0 deletions
diff --git a/572/CH3/EX3.1/c3_1.sce b/572/CH3/EX3.1/c3_1.sce
new file mode 100755
index 000000000..2f733e72a
--- /dev/null
+++ b/572/CH3/EX3.1/c3_1.sce
@@ -0,0 +1,39 @@
+// (3.1) A closed, rigid container of volume 0.5 m3 is placed on a hot plate. Initially, the container holds a two-phase mixture of saturated liquid water and saturated water vapor at p1 = 1 bar with a quality of 0.5. After heating, the pressure in the container is p2=  1.5 bar. Indicate the initial and final states on a T–v diagram, and determine (a) the temperature, in degree Celcius, at each state.(b) the mass of vapor present at each state, in kg.(c) If heating continues, determine the pressure, in bar, when the container holds only saturated vapor.
+
+// solution
+
+//initializing variables
+p1 = 10^5 // initial pressure in pascal
+x1 = .5 // initial quality
+p2 = 1.5*10^5 // pressure after heating in pascal
+v = .5 // volume of container in m3
+
+vf1 = 1.0432*10^(-3) // specific volume of fluid in state 1 in m3/Kg(from table A-3)
+vg1 = 1.694 // specific volume of gas in state 1 in m3/kg(from table A-3)
+
+v1 = vf1 + x1*(vg1-vf1) // specific volume in state 1 in m3/Kg
+v2 = v1 // specific volume in state 2 in m3/Kg
+vf2 = 1.0582*10^(-3) // specific volume of fluid in state 2 in m3/Kg(from table A-3)
+vg2 = 1.159 // specific volume of gas in state 2 in m3/Kg(from table A-3)
+
+// part (a)
+T1 = 99.63 // temperature in degree celcius in state 1, from table A-3
+T2 = 111.4 // temperature in degree celcius in state 2, from table A-3
+printf('the temperature in degree celcius in state 1 is:\n\t T1 = %f',T1);
+printf('\nthe temperature in degree celcius in state 2 is:\n\t T2 = %f',T2);
+
+// part (b)
+m = v/v1 // total mass in Kg
+mg1 = x1*m // mass of vapour in state 1 in Kg
+printf('\nthe mass of vapor in state 1 in Kg is:\n\t mg1 = %f',mg1 );
+x2 = (v1-vf2)/(vg2-vf2) // quality in state 2
+mg2 = x2*m // mass of vapor in state 2 in Kg
+printf('\nthe mass of vapor in state 2 in Kg is:\n\t mg2 = %f',mg2 );
+
+//part(c)
+p3 = 2.11 // pressure in state 3 from table A-3
+printf('\nthe pressure corresponding to state 3 in bar is:\n\t p3 = %f',p3 );
+
+
+
+
diff --git a/572/CH3/EX3.10/c3_10.sce b/572/CH3/EX3.10/c3_10.sce
new file mode 100755
index 000000000..020e64aec
--- /dev/null
+++ b/572/CH3/EX3.10/c3_10.sce
@@ -0,0 +1,3 @@
+//(3.10) One kmol of carbon dioxide gas (CO2) in a piston–cylinder assembly undergoes a constant-pressure process at 1 bar from T1 = 300 K to T2. Plot the heat transfer to the gas, in kJ, versus T2 ranging from 300 to 1500 K. Assume the ideal gas model, and determine the specific internal energy change of the gas using. (a)Ubar data from IT.(b) a constant Cv bar evaluated at T1 from IT.
+
+printf('This is solved by the referred software ') \ No newline at end of file
diff --git a/572/CH3/EX3.11/c3_11.sce b/572/CH3/EX3.11/c3_11.sce
new file mode 100755
index 000000000..4d18c229e
--- /dev/null
+++ b/572/CH3/EX3.11/c3_11.sce
@@ -0,0 +1,21 @@
+//(3.11) Air undergoes a polytropic compression in a piston–cylinder assembly from p1 = 1 bar, T1 = 22C to p2 = 5 bars. Employing the ideal gas model, determine the work and heat transfer per unit mass, in kJ/kg, if n = 1.3.
+
+//solution
+
+//variable initialization
+p1 = 1 //initial pressure in bar
+T1 = 295 //initial temperature in kelvin
+p2 = 5 //final pressure in bar
+n=1.3 //polytropic constant
+R = 8314/28.97 // gas constant for air in SI units
+
+T2 = T1*(p2/p1)^((n-1)/n)
+w = R*(T2-T1)/(1-n)
+printf('the work done per unit mass in KJ/Kg is :\n\tW = %f',w/1000)
+
+//from table A-22
+u2 = 306.53
+u1 = 210.49
+Q = u2-u1+w/1000
+
+printf('\n\nthe heat transfer per unit mass in KJ/Kg is:\n\t Q = %f',Q)
diff --git a/572/CH3/EX3.2/c3_2.sce b/572/CH3/EX3.2/c3_2.sce
new file mode 100755
index 000000000..dd46b0745
--- /dev/null
+++ b/572/CH3/EX3.2/c3_2.sce
@@ -0,0 +1,22 @@
+//(3.2) A vertical piston–cylinder assembly containing 0.05 kg of ammonia, initially a saturated vapor, is placed on a hot plate. Due to the weight of the piston and the surrounding atmospheric pressure, the pressure of the ammonia is 1.5 bars. Heating occurs slowly, and the ammonia expands at constant pressure until the final temperature is 25C. Show the initial and final states on T–v and p–v diagrams, and determine(a) the volume occupied by the ammonia at each state, in m3.(b) the work for the process, in kJ.
+
+// solution
+
+// variable initialization
+
+m = .05 // mass of ammonia in kg
+p1 = 1.5*10^5 // initial pressure of ammonia in pascal
+T2 = 25 // final temperature in degree celcius
+
+//part (a)
+v1 = .7787 // specific volume in state 1 in m3/kg from table A-14
+V1 = m*v1 // volume occupied by ammonia in state 1 in m3
+v2 = .9553 // specific volume in state 2 in m3/kg from table A-15
+V2 = m*v2 // volume occupied by ammonia in state 2 in m3
+
+printf('the volume occupied by ammonia in state 1 in m3 is:\n\t V1 = %f',V1);
+printf('\nthe volume occupied by ammonia in state 2 in m3 is:\n\t V2 = %f',V2);
+
+// part (b)
+w = (p1*(V2-V1))/1000 // work in KJ
+printf('\nthe work done for the process in KJ is:\n\t W = %f',w)
diff --git a/572/CH3/EX3.3/c3_3.sce b/572/CH3/EX3.3/c3_3.sce
new file mode 100755
index 000000000..da48c3110
--- /dev/null
+++ b/572/CH3/EX3.3/c3_3.sce
@@ -0,0 +1,18 @@
+// (3.3) A well-insulated rigid tank having a volume of .25 m3 contains saturated water vapor at 100C. The water is rapidly stirred until the pressure is 1.5 bars. Determine the temperature at the final state, in C, and the work during the process, in kJ.
+
+//solution
+
+//variable initialization
+V = .25 // volume of tank in m3
+T1 = 100 // initial temperature in degree celcius
+p2 = 1.5 // final pressure in bars
+
+v = 1.673 // specific volume in m3/kg obtained using table A-2
+u1 = 2506.5 // specific internal energy in state 1 in KJ/Kg obtained from table A-2
+T2 = 273 // temperature in state 2 in degree celcius obtained from table A-4
+u2 = 2767.8 // specific internal energy in state 2 in KJ/Kg obtained from table A-4
+m = V/v // mass of the system in kg
+DeltaU = m*(u2-u1) // change in internal energy in KJ
+W = - DeltaU // from energy balance
+printf('the temperature at the final state in degree celcius is:\n T2 = %f',T2);
+printf('\nthe work during the process in KJ is:\n\tW = %f',W); \ No newline at end of file
diff --git a/572/CH3/EX3.4/c3_4.sce b/572/CH3/EX3.4/c3_4.sce
new file mode 100755
index 000000000..ba5cddd37
--- /dev/null
+++ b/572/CH3/EX3.4/c3_4.sce
@@ -0,0 +1,25 @@
+// (3.4) Water contained in a piston–cylinder assembly undergoes two processes in series from an initial state where the pressure is 10 bar and the temperature is 400C.Process 1–2: The water is cooled as it is compressed at a constant pressure of 10 bar to the saturated vapor state. Process 2–3: The water is cooled at constant volume to 150C.(a) Sketch both processes on T–v and p–v diagrams.(b) For the overall process determine the work, in kJ/kg. (c) For the overall process determine the heat transfer, in kJ/kg.
+
+//solution
+
+//variable initialization
+P1 = 10*(10^5) //initial pressure in pascal
+T1 = 400 // initial temperature in degree celcius
+
+v1 = .3066 // specific volume in state 1 in m3/kg obtained from table A-4
+u1 = 2957.3 // specific internal energy in state 1 in KJ/Kg obtained from table A-4
+v2 = .1944 // specific volume in state 2 in m3/kg obtained from table A-3
+w1to2 = (P1*(v2-v1))/1000 // work in KJ/Kg in process 1-2
+w2to3 = 0 // work in process 2-3
+W = w1to2 + w2to3 // net work in KJ/kg
+
+v3 = v2
+vf3 = 1.0905*10^(-3) // specific volume of fluid in state 3 from table A-2
+vg3 = .3928 // specific volume of gas in state 3 from table A-2
+x3 = (v3-vf3)/(vg3-vf3)
+uf3 = 631.68 // specific internal energy for fluid in state 3 from table A-2
+ug3 = 2559.5 // specific internal energy for gas in state 3 from table A-2
+u3 = uf3+x3*(ug3-uf3) // specific internal energy in state 3 in Kj/Kg
+q = (u3-u1) + W // heat transfer in Kj/Kg
+printf(' the work done in the overall process in KJ/Kg is:\n\t W = %f',W);
+printf(' \nthe heat transfer in the overall process in KJ/Kg is:\n\t Q = %f',q); \ No newline at end of file
diff --git a/572/CH3/EX3.5/c3_5.sce b/572/CH3/EX3.5/c3_5.sce
new file mode 100755
index 000000000..652fe4c95
--- /dev/null
+++ b/572/CH3/EX3.5/c3_5.sce
@@ -0,0 +1,3 @@
+//(3.5) For the system of Example 3.1, plot the heat transfer, in kJ, and the mass of saturated vapor present, in kg, each versus pressure at state 2 ranging from 1 to 2 bar. Discuss the results.
+
+ printf('The problem is solved by using the software referred to in the book. The data can be retrieved from that software'); \ No newline at end of file
diff --git a/572/CH3/EX3.6/c3_6.sce b/572/CH3/EX3.6/c3_6.sce
new file mode 100755
index 000000000..074496fa1
--- /dev/null
+++ b/572/CH3/EX3.6/c3_6.sce
@@ -0,0 +1,39 @@
+// (3.6) A closed, rigid tank filled with water vapor, initially at 20 MPa, 520C, is cooled until its temperature reaches 400C. Using the compressibility chart, determine. (a) the specific volume of the water vapor in m3/kg at the initial state.(b) the pressure in MPa at the final state.Compare the results of parts (a) and (b) with the values obtained from the superheated vapor table, Table A-4.
+
+//solution
+
+//variable initialization
+p1 = 20 //initial pressure in MPa
+T1 = 520 // initial temperature in degree celcius
+T2 = 400 // final temperature in degree celcius
+
+//part(a)
+//from table A-1
+Tc = 647.3 //critical temperature in kelvin
+pc = 22.09 //critical pressure in MPa
+
+Tr = (T1+273)/Tc //reduced temperature
+Pr = p1/pc //reduced pressure
+Z1 = .83 //compressibility factor
+R = 8.314 //universal gas constant in SI unit
+n = 1000/18.02 //number of moles in a kg of water
+v1 = (Z1*n*R*(T1+273))/(p1*10^6)
+printf('the specific volume in state1 in m3/Kg is:\n\t v1 = %f',v1)
+printf('\n and the corresponding value obtained from table A-4 is .01551 m^3/Kg')
+
+//part(b)
+vr = v1*(pc*10^6)/(n*R*Tc)
+Tr2 = (T2+273)/Tc
+//at above vr and Tr2
+PR = .69
+P2 = pc*PR
+printf('\n\n the pressure in MPa in the final state is: \n\t P2 = %f',P2)
+printf('\n and the corresponding value from the table is 15.16Mpa')
+
+
+
+
+
+
+
+
diff --git a/572/CH3/EX3.7/3_7fig.pdf b/572/CH3/EX3.7/3_7fig.pdf
new file mode 100755
index 000000000..098ee1b44
--- /dev/null
+++ b/572/CH3/EX3.7/3_7fig.pdf
Binary files differ
diff --git a/572/CH3/EX3.7/c3_7.sce b/572/CH3/EX3.7/c3_7.sce
new file mode 100755
index 000000000..1bcfaf5d3
--- /dev/null
+++ b/572/CH3/EX3.7/c3_7.sce
@@ -0,0 +1,50 @@
+//(3.7) One pound of air undergoes a thermodynamic cycle consisting of three processes.Process 1–2: constant specific volume Process 2–3: constant-temperature expansion Process 3–1: constant-pressure compression. At state 1, the temperature is 300K, and the pressure is 1 bar. At state 2, the pressure is 2 bars. Employing the ideal gas equation of state, (a) sketch the cycle on p–v coordinates. (b) determine the temperature at state 2, in K; (c) determine the specific volume at state 3, in m3/kg.
+
+//solution
+
+//variable initialization
+T1 = 300 //temperature in state 1 in kelvin
+P1 = 1 //pressure in state 1 in bar
+P2 = 2 //pressure in state 2 in bar
+
+R = 287 //gas constant of air in SI units
+v1 = (R*T1)/(P1*10^5) //specific volume in state 1
+P = linspace(1,2,100)
+for i = 1:100
+ v(1,i) = v1
+end
+
+plot2d(v,P,rect=[0,0,5,2.5]);
+
+T2 = (P2*10^5*v1)/R
+v3 = (R*T2)/(P1*10^5)
+vv = linspace(v1,v3,100)
+plot(vv,P1)
+
+function[out]= f(inp)
+ out = (R*T2)/inp
+endfunction
+
+VV = linspace(v1,v3,100)
+for j = 1:100
+ pp(1,j) = f(VV(1,j))/(10^5)
+end
+plot2d(VV,pp)
+xtitle("","v","p(bar)")
+
+printf('the temperature in kelvin in state 2 is:\n\t T2 = %f',T2)
+printf('\n\nthe specific volume in state 3 in m^3/kg is \n\t v = %f',v3)
+
+
+
+
+
+
+
+
+
+
+
+
+
+ \ No newline at end of file
diff --git a/572/CH3/EX3.8/c3_8.sce b/572/CH3/EX3.8/c3_8.sce
new file mode 100755
index 000000000..e8147395f
--- /dev/null
+++ b/572/CH3/EX3.8/c3_8.sce
@@ -0,0 +1,18 @@
+//(3.8) A piston–cylinder assembly contains 0.9 kg of air at a temperature of 300K and a pressure of 1 bar. The air is compressed to a state where the temperature is 470K and the pressure is 6 bars. During the compression, there is a heat transfer from the air to the surroundings equal to 20 kJ. Using the ideal gas model for air, determine the work during the process, in kJ.
+
+//solutiion
+
+//variable initialization
+m = .9 // mass of air in kg
+T1 = 300 // initial temperature in kelvin
+P1 = 1 // initial pressure in bar
+T2 = 470 // final temperature in kelvin
+P2 = 6 // final pressure in bar
+Q = -20 // heat transfer in kj
+
+//from table A-22
+u1 = 214.07 // in KJ/kg
+u2 = 337.32 // in KJ/Kg
+deltaU = m*(u2-u1) // change in internal energy in kj
+W = Q - deltaU // in KJ/kg
+printf('the work during the process in KJ is \n\t W = %f',W)
diff --git a/572/CH3/EX3.9/c3_9.sce b/572/CH3/EX3.9/c3_9.sce
new file mode 100755
index 000000000..b46e32772
--- /dev/null
+++ b/572/CH3/EX3.9/c3_9.sce
@@ -0,0 +1,25 @@
+// (3.9) Two tanks are connected by a valve. One tank contains 2 kg of carbon monoxide gas at 77C and 0.7 bar. The other tank holds 8 kg of the same gas at 27C and 1.2 bar. The valve is opened and the gases are allowed to mix while receiving energy byheat transfer from the surroundings. The final equilibrium temperature is 42C. Using the ideal gas model, determine (a) the final equilibrium pressure, in bar (b) the heat transfer for the process, in kJ.
+
+//solution
+
+//variable initialization
+
+m1 = 2 //initial mass of gas in tank 1 in kg
+T1 = 350 //initial temperature in kelvin in tank1
+p1 = .7 //initial pressure in bar in tank 1
+m2 = 8 //initial mass of gas in tank 2 in kg
+T2 = 300 //initial temperature in kelvin in tank 2
+p2 = 1.2 //initial pressure in bar in tank 2
+Tf = 315 //final equilibrium temperature in kelvin
+
+pf = ((m1+m2)*Tf)/((m1*T1/p1)+(m2*T2/p2))
+
+printf('the final equilibrium pressure in bar is: \n\t pf = %f',pf)
+
+//from table A-20
+Cv = .745 //in KJ/Kg.k
+Ui = (m1*Cv*T1)+(m2*Cv*T2)
+Uf = (m1+m2)*Cv*Tf
+deltaU = Uf-Ui
+Q = deltaU
+printf('\n\nthe heat transfer for the process in KJ is :\n\t Q = %f',Q)