Generating the equations of a Thermoptim refrigerator model
Thermoptim Model
It is a very simple cycle, the synoptic view of which is given below:
The diagram and project files are given below. Please note that they require the use of Thermoptim in English, i.e. with the inth2.zip file of this language.
Raw Generated Equations
There are 47 of them. They are given in this file.
Redundancies
The redundancies identified are as follows:
Redundancy for x_4:
# 1 x_4 = (h_3 - hl_4)/(hv_4 - hl_4), equation: 22
# 2 x_4 = 0.328174791, equation: 41
Redundancy for T_4:
# 1 T_4 = calcTsat("R134a";P = p_4 ;X = x_4), equation: 23
# 2 T_4 = calcTsat("R134a";P = p_4;X = x_4)+dTsat_4, equation: 43
Redundancy for h_4:
# 1 h_4 = calcH_TPx("R134a";T = T_4;P = p_4;X = x_4), equation: 24
# 2 h_4 = calcH_TPx("R134a";T = T_4;P = p_4;X = x_4), equation: 44
Redundancy for p_4:
# 1 p_4 = 1.78, equation: 15
# 2 p_4 = 1.78, equation: 40
In equation 22, x_4 is calculated, and in equation 41 its value is given. The second equation must therefore be deleted. This redundancy comes from the fact that it is a point with an imposed saturation temperature and that it is therefore a priori considered as a given of the problem, whereas it must be recalculated if the parameters change.
Redundancy on h_4 is of the same nature. We must keep equation 24.
Redundancies on h_4 and p_4 correspond to duplicate equations. One of them has to be deleted each time.
Uninitialized Variables
The only uninitialized variable is m_dot_throttling. This is due to the fact that none of the processes has a set flow rate. It will therefore be necessary to complete the set of equations by initializing m_dot_throttling to the value of the flow.
List of Equation Groups
Once the missing equation is added, the analysis of the equations can be started again. It makes it possible to highlight the different groups of equations that can be solved simply.
Group 1
Group 1 (16 Variables) : [dTsat_1, p_2, x_3a, dTsat_3, m_dot_throttling, p_1, dTsat_4, p_4, p_3, p_3a, xv_4, x_1, x_3, xl_4, etaT_compressor, dTsat_3a]
Group 1 (Equations):
etaT_compressor = 0.75
p_2 = 12.0
xl_4 = 0.
xv_4 = 1.
p_1 = 1.78
x_1 = 1.0
dTsat_1 = 5.0
p_3a = 12.0
x_3a = 1.0
dTsat_3a = 0.0
p_3 = 12.0
x_3 = 0.0
dTsat_3 = -10.0
p_4 = 1.78
dTsat_4 = 0.0
m_dot_throttling=1
We find here all the equations providing the data for the problem, including m_dot_throttling.
Group 2
Group 2 (4 Variables) : [T_1, T_3, m_dot_refrigerationeffect, T_3a]
Group 2 (Equations):
m_dot_refrigerationeffect = m_dot_throttling
T_1 = calcTsat("R134a";P = p_1;X = x_1)+dTsat_1
T_3a = calcTsat("R134a";P = p_3a;X = x_3a)+dTsat_3a
T_3 = calcTsat("R134a";P = p_3;X = x_3)+dTsat_3
This second group corresponds to equations that allow the calculation of new variables through simple substitution of those from the first group.
Group 3
Group 3 (4 Variables) : [h_3a, h_1, h_3, m_dot_compressor]
Group 3 (Equations):
m_dot_compressor = m_dot_refrigerationeffect
h_1 = calcH_TPx("R134a";T = T_1;P = p_1;X = x_1)
h_3a = calcH_TPx("R134a";T = T_3a;P = p_3a;X = x_3a)
h_3 = calcH_TPx("R134a";T = T_3;P = p_3;X = x_3)
This third group corresponds to equations that allow the calculation of new variables through simple substitution of those from the first and second groups.
The process is repeated in the subsequent groups.
Unresolved Equations
Finally, we obtain the following list of unresolved equations:
Unresolved Equations: 10
Q_dot_refrigerationeffect = m_dot_refrigerationeffect*(h_1 - h_4)
Tl_4 = T_4- 0.01
Tv_4 = T_4+ 0.01
hl_4 = calcH_TPx("R134a";T = Tl_4;P = p_4;X = xl_4)
hv_4 = calcH_TPx("R134a";T = Tv_4;P = p_4;X = xv_4)
x_4 = (h_3 - hl_4)/(hv_4 - hl_4)
T_4 = calcTsat("R134a";P = p_4 ;X = x_4)
h_4 = calcH_TPx("R134a";T = T_4;P = p_4;X = x_4)
useful_Energy = Q_dot_refrigerationeffect
eta_global = abs(useful_Energy/purchased_Energy)
These are the equations that either depend on the properties of the fluid or cannot be directly solved.
The 14 missing variables are also identified.
Conversion to Interactive Thermodynamics Format
Interactive Thermodynamics is a solver provided by MM. Moran, Shapiro and Mmes Boettner and Bailey as a supplement to their book "Fundamentals of Engineering Thermodynamics, 8th Edition", which can be downloaded freely.
The conversion allows for obtaining a file that can be processed by the solver.
The equations for calculating fluid properties converted to this format are given below, with the others remaining unchanged:
//Equation: 8
s_1 = s_Ph("R134a",p_1,h_1) // Upstream point - 1 - Downstream point - 2
//Equation: 9
hs_2 = h_Ps("R134a",p_2,s_1) // Downstream point - 2
//Equation: 12
T_2 = T_Ph("R134a",p_2,h_2) // Downstream point - 2
//Equation: 20
hl_4 = hsat_Px("R134a",p_4,xl_4)// Saturated liquid enthalpy
//Equation: 21
hv_4 = hsat_Px("R134a",p_4,xv_4)// Saturated vapor enthalpy
//Equation: 23
T_4 = Tsat_P("R134a",p_4) // Downstream point - 4
//Equation: 24
h_4 = hsat_Px("R134a",p_4,x_4) // Enthalpy
//Equation: 28
T_1 = Tsat_P("R134a",p_1)+dTsat_1// set Tsat (Celsius)
//Equation: 29
h_1 = hsat_Px("R134a",p_1,x_1)// Enthalpy
//Equation: 33
T_3a = Tsat_P("R134a",p_3a)+dTsat_3a// set Tsat (Celsius)
//Equation: 34
h_3a = hsat_Px("R134a",p_3a,x_3a)// Enthalpy
//Equation: 38
T_3 = Tsat_P("R134a",p_3)+dTsat_3// set Tsat (Celsius)
//Equation: 39
h_3 = hsat_Px("R134a",p_3,x_3)// Enthalpy
//Equation: 43
T_4 = Tsat_P("R134a",p_4)+dTsat_4// set Tsat (Celsius)
//Equation: 44
//h_4 = hsat_Px("R134a",p_4,x_4)// Enthalpy
The file that can be solved in Interactive Thermodynamics is provided below.
Conversion to EES format
EES is a solver developed by f-Chart, which requires a license. The conversion results in a file that can be processed by the solver. The equations for calculating the fluid properties converted to this format are given below, the others remaining unchanged:
//Equation: 8
s_1 = entropy(R134a;P = p_1;H = h_1) // Upstream point - 1 - Downstream point - 2
//Equation: 9
hs_2 = enthalpy(R134a;P = p_2;S = s_1) // Downstream point - 2
//Equation: 11
h_2 = h_1 + (hs_2 - h_1)/etaT_compressor // Upstream point - 1 - Downstream point - 2
//Equation: 12
T_2 = temperature(R134a;P = p_2;H = h_2) // Downstream point - 2
//Equation: 20
hl_4 = enthalpy(R134a;P = p_4;X = xl_4)// Saturated liquid enthalpy
//Equation: 21
hv_4 = enthalpy(R134a;P = p_4;X = xv_4)// Saturated vapor enthalpy
//Equation: 24
h_4 = enthalpy(R134a;P = p_4;X = x_4) // Enthalpy
T_1 = t_sat(R134a;P = p_1)+dTsat_1// set Tsat (Celsius)
//Equation: 29
h_1 = enthalpy(R134a;P = p_1;X = x_1)// Enthalpy
//Equation: 33
T_3a = t_sat(R134a;P = p_3a)+dTsat_3a// set Tsat (Celsius)
//Equation: 34
h_3a = enthalpy(R134a;P = p_3a;X = x_3a)// Enthalpy
//Equation: 38
T_3 = t_sat(R134a;P = p_3)+dTsat_3// set Tsat (Celsius)
//Equation: 39
h_3 = enthalpy(R134a;P = p_3;X = x_3)// Enthalpy
The file that can be resolved in EES is provided below.