diff --git a/Interfaces/PartialHelmholtzMedium/package.mo b/Interfaces/PartialHelmholtzMedium/package.mo index 82fcc59..847385d 100644 --- a/Interfaces/PartialHelmholtzMedium/package.mo +++ b/Interfaces/PartialHelmholtzMedium/package.mo @@ -94,7 +94,7 @@ protected constant Density d_crit=MM/fluidConstants[1].criticalMolarVolume; constant Temperature T_trip=fluidConstants[1].triplePointTemperature; constant Temperature T_crit=fluidConstants[1].criticalTemperature; - Real tau(unit="1") "inverse reduced temperature"; + constant Real tau(unit="1")=T_crit/T "inverse reduced temperature"; EoS.HelmholtzDerivs fl(T=T); EoS.HelmholtzDerivs fv(T=T); @@ -114,14 +114,13 @@ protected Real det "determinant of Jacobi matrix"; Real gamma(min=0,max=1) = 1 "convergence speed, default=1"; Integer iter=0; + constant Integer iter_max = 200; Real tolerance=1e-9 "Tolerance for sum of Delta_J and Delta_K"; algorithm // Modelica.Utilities.Streams.print("setSat_T: T="+String(T),"printlog.txt"); if ((T>=T_trip) and (T tolerance) loop + while (abs(Delta_J) + abs(Delta_K) > tolerance) and (iter