10.3. Exercise 3 Solutions#

Section 5.3.2 Exercise 3

#4.3.5 Exercise 1
#A closed rigid container of 0.5 m3 is placed on a hot plate. Initially it contains a two phase mixture of saturated liquid and saturated vapor H2O at  𝑝1 = 1 bar with x = 0.5. After heating  𝑝2 = 1.5 bar. 
#Determine T at states 1 and 2. Determine the heat transfer during the process.

V1 = 0.5 #m3
Q1 = 0.5
P1 = 100*1000 #Pa
P2 = 150*1000 #Pa

#Using Cantera:
import cantera as ct
#define state 1
species1=ct.Water()

species1.PQ=P1,Q1

print(f"Initial temperature:  {round(species1.TQ[0],2)} K")

v1 = v2 = species1.TV[1] # Initial and final specific volume since it is a rigid container

#define state 2
species2=ct.Water()

species2.PV=P2,v2

print(f"Final temperature:  {round(species2.TQ[0],2)} K")

m = V1/v1 # kg
u1 = species1.UV[0]
u2 = species2.UV[0]
Q = m*(u2-u1) # From Delta_U = Q-W, work is zero because volume is fixed

print(f"Heat Transfer:  {round(Q/1000,2)} kJ")
Initial temperature:  372.81 K
Final temperature:  384.55 K
Heat Transfer:  298.1 kJ
#4.3.5 Exercise 2
#A piston cylinder assembly initially (State 1) contains 10 kg of H2O at 1200 kPa.
# a) If 8 kg is in the liquid form and the rest vapor, determine the temperature, specific volume and specific enthalpy.
# b) The cylinder continues to be heated at constant pressure until the temperature reaches 300 °C (State 2). Determine the final state (compressed liquid, saturated mixture, superheated vapor), specific volume and specific enthalpy.
# c) Determine the heat transfer and work for this process.

# part a
m=10 #kg
P1 = 1200*1000 #Pa
mg = 2 #kg
Q1 = mg/m

#Using Cantera:
import cantera as ct
#define state 1
species1=ct.Water()

species1.PQ=P1,Q1
T1 = species1.TV[0]
v1 = species1.TV[1]
h1 = species1.HP[0]

print(f"Initial temperature:  {round(T1,2)} K")
print(f"Initial specific volume:  {round(v1,6)} K")
print(f"Initial specific enthalpy:  {round(h1,2)} K")

# part b
T2 = 300+273.15 # K
P2=P1

#define state 2
species2=ct.Water()

species2.TP=T2,P2
v2 = species2.TV[1]
phase = species2.phase_of_matter
h2 = species2.HP[0]

print(f"Final state of matter:  {phase}")
print(f"Final specific volume:  {round(v2,6)} K")
print(f"Final specific enthalpy:  {round(h2,2)} K")

# part c

Q = m*(h2-h1) # J, constant pressure process
W = P2*(v2-v1) # J,constant volume process

print(f"Work:  {round(W/1000,2)} kJ")
print(f"Heat Transfer:  {round(Q/1000,2)} kJ")
Initial temperature:  461.18 K
Initial specific volume:  0.033582 K
Initial specific enthalpy:  -14774746.42 K
Final state of matter:  gas
Final specific volume:  0.213816 K
Final specific enthalpy:  -12925000.32 K
Work:  216.28 kJ
Heat Transfer:  18497.46 kJ
#4.3.5 Exercise 3
#4.3.5 Exercise 4
#4.3.5 Exercise 5
#4.3.5 Exercise 6
#Using Cantera:
import cantera as ct
#define state 1
species1=ct.Water()

P1=100*1000
T1=30+273.15
species1.TP=T1,P1
species1()
  water:

       temperature   303.15 K
          pressure   1e+05 Pa
           density   995.73 kg/m^3
  mean mol. weight   18.016 kg/kmol
    vapor fraction   0
   phase of matter   liquid

                          1 kg             1 kmol     
                     ---------------   ---------------
          enthalpy       -1.5845e+07       -2.8546e+08  J
   internal energy       -1.5845e+07       -2.8546e+08  J
           entropy            3956.8             71286  J/K
    Gibbs function       -1.7044e+07       -3.0707e+08  J
 heat capacity c_p            4178.6             75282  J/K
 heat capacity c_v            4116.1             74156  J/K