This functions computes the Number of Transfer Units (NTU) of an exchanger for counter current flows. The function is mainly used to supply to the solver the inverse function of the effectiveness.
When both flows have the same thermal capacity ( Cr = 1 ), a zero division occurs. However, an analytical relation is existing for this specific case. To get around the problem, when the value of Cr comes closer to one, a polynomial interpolation between the normal relation and the relation for Cr = 1 is performed.
A threshold is applied on the value of the effectiveness Eff = 0.999 to avoid numerical troubles such as zero divisions or infinite values.
function NTU_counterCurrent extends Modelica.Icons.Function; input Modelica.SIunits.Efficiency Eff "Exchanger effectiveness"; input Real Cr "Ratio of thermal condutance"; output Real NTU "Number of transfer unit"; end NTU_counterCurrent;