This is a question that needs to be answered in Python. This is a thermodynamics and fluids question that needs to be answered using Python coding, so when it says 'write a function', it means write a function for Python code. Please only answer if you are comfortable with Python coding.
Here is the table related to the question (use if needed):
P/bar Tsat (°C) vg/(m3/kg)
0.5 81.3 3.239
1 99.6 1.694
10 179.9 0.1944
20 212.4 0.09957
40 250.3 0.04977
100 311 0.01802
150 342.1 0.01035
180 357 0.00751
200 365.7 0.00585
220 373.7 0.00368
The specific volume of saturated steam can be calculated using the ideal gas equation of state and the saturation temperature and pressure as follows:
Vg = RTsat(P) / P
where:
Vg = specific volume of saturated steam [units kg/m3]
P = Pressure [units Pa]
Tsat(P) = Saturation temperature at pressure P [units K]
R = specific ideal gas constant (= 461.5 J/kg K for steam)
It is well known, however, that the ideal gas equation will produce very large errors at high pressure, in particular as the pressure approaches the critical point.
Affandi et al. (2013) have proposed an alternative equation of state, based on the reduced saturation temperature (T- = T/Tcrit) only, as follows:
ln(vg) = a + b[ln(1/Tr)]^0.4 + c/T^2 + d/T^4 + e/T^5
Values for a-e are given in the table below:
a b c d e
-7.75883 3.23753 2.05755 -0.06052 0.00529
The aim of this exercise is to validate or otherwise the two methods using a data set taken from the Rogers and Mayhew property tables used in this module.
a. Write a function to calculate the specific volume using the ideal gas equation. The input of the function should be temperature (in units of degrees Celsius). The output should be in units of m3/kg.
b. Write a function to calculate the specific volume using the Affandi Equation. The input of the function should be temperature (in units of degrees Celsius). The output should be in units of m3/kg.