2.10: Water in Two Tanks#
A rigid tank containig water in two seperate rigid compartments (A & B) is shown below. The compartment A contains
a) the liquid mass and pressure of each compartment before mixing
b) the quality and pressure of mixed water
Solution Approach for a)#
the quality of a saturated mixture is defined as
therfore the mass of liquid would be
#import librarier
import CoolProp.CoolProp as CP
#define variables
V_A = 2 #tank A volume in m3
V_B = 3 #tank B volume in m3
m_A = 500 #fluid in tank A mass in kg
m_B = 0.25 #fluid in tank B mass in kg
T = 25 + 273.15 #temperature in K
D_A = m_A / V_A #density of tank A in kg/m3 used in CoolProp
D_B = m_B / V_B #density of tank B in kg/m3 used in CoolProp
fluid = "water" # define the fluid or material of interest
x_A = CP.PropsSI("Q", "T", T, "D", D_A , fluid) #mixture quality in A
x_B = CP.PropsSI("Q", "T", T, "D", D_B , fluid) #mixture quality in B
m_l_A = (1 - x_A) * m_A #liquid mass in A in kg
m_l_B = (1 - x_B) * m_B #liquid mass in B in kg
print('liquid mass in A is', f"{m_l_A:.2f}", 'kg')
print('liquid mass in B is', f"{m_l_B:.2f}", 'kg')
P_A = CP.PropsSI("P", "T", T, "D", D_A , fluid) #pressure in A in Pa
P_B = CP.PropsSI("P", "T", T, "D", D_B , fluid) #pressure in B in Pa
print('pressure in A is', f"{P_A:.2f}", 'Pa')
print('pressure in B is', f"{P_B:.2f}", 'Pa')
liquid mass in A is 499.97 kg
liquid mass in B is 0.18 kg
pressure in A is 3169.93 Pa
pressure in B is 3169.93 Pa
Solution Approach for b)#
after mixing the total volume and mass would be
and the temperature remains constant since the tank is in equilibrium with its surrounding
V = V_A + V_B #total volume in m3
m = m_A + m_B #total mass in kg
D = m / V #density of the mixture
x = CP.PropsSI("Q", "T", T, "D", D, fluid) #mixture quality
m_l = (1 - x) * m #liquid mass in kg
print('liquid mass after mixing is', f"{m_l:.2f}", 'kg')
P = CP.PropsSI("P", "T", T, "D", D, fluid) #pressure after mixing
print('pressure after mixing is', f"{P:.2f}", 'Pa')
liquid mass after mixing is 500.15 kg
pressure after mixing is 3169.93 Pa