using "types";
Model LogMeanTemperature
VARIABLES
DT0 as temp_delta;
DTL as temp_delta;
LMTD as temp_delta;
Thi as temperature;
Tho as temperature;
Tci as temperature;
Tco as temperature;
EQUATIONS
if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL]))
then
"Log Mean Temperature Difference"
LMTD= (DT0-DTL)/ln(DT0/DTL);
else
if DT0*DTL equal 0
then
"Log Mean Temperature Difference"
LMTD = 0.5*(DT0+DTL);
else
"Log Mean Temperature Difference"
LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12);
end
end
end
Model LMTD_counter as LogMeanTemperature
EQUATIONS
"Temperature Difference at Inlet - Counter Flow"
DT0 = Thi - Tco;
"Temperature Difference at Outlet - Counter Flow"
DTL = Tho - Tci;
end
Model LMTD_cocurrent as LogMeanTemperature
EQUATIONS
"Temperature Difference at Inlet - Cocurrent Flow"
DT0 = Thi- Tci;
"Temperature Difference at Outlet - Cocurrent Flow"
DTL = Tho - Tco;
end