diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/Equilibrium/BaseBalanceEquationsEq.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/Equilibrium/BaseBalanceEquationsEq.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/Equilibrium/BaseBalanceEquationsEq.mo"	2022-03-10 09:57:37.904144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/Equilibrium/BaseBalanceEquationsEq.mo"	2022-03-10 09:58:39.532151922 +0000
@@ -22,9 +22,9 @@
 
   /*** interface medium models and properties ***/
   SI.Temperature T_star[n];
-  input SI.MoleFraction x_l_star[n,nSL]; // is this really an input or does it come from the film model?
+  input SI.MoleFraction x_l_star[n,nSL];   // is this really an input or does it come from the film model?
   output SI.MoleFraction c_l_star[n,nSL];
-  input SI.MoleFraction x_v_star[n,nSV]; // is this really an input or does it come from the film model?
+  input SI.MoleFraction x_v_star[n,nSV];   // is this really an input or does it come from the film model?
   output SI.MoleFraction c_v_star[n,nSV];
 
   /*** vapour properties ***/
@@ -53,13 +53,13 @@
    SI.MolarMass MM_l_in=propsLiqIn.MM;
    ThermalSeparation.Units.MolarEnthalpy h_l[n]=propsLiq.h;
    ThermalSeparation.Units.MolarEnthalpy h_l_in=propsLiqIn.h;
-   parameter Modelica.SIunits.Temperature T_ref;
+   parameter Modelica.Units.SI.Temperature T_ref;
 
   /*** variables upStream ***/
   input SI.Concentration c_v[n,nSV](each stateSelect=StateSelect.default);
    SI.Concentration c_v_in[nSV]=propsVapIn.c;
    SI.MoleFraction x_v_in[nSV]=propsVapIn.x;
-   // SI.MoleFraction x_v[n,nSV]=propsVap.x;
+   // SI.MoleFraction x_v[n,nSV]=propsVap.x;
    SI.MoleFraction x_v[n,nSV];
   input SI.VolumeFlowRate Vdot_v_in(nominal=1e-2);
   input SI.VolumeFlowRate Vdot_v[n](nominal=fill(1e-2,n));
@@ -94,10 +94,10 @@
   input SI.MolarMass MM_l_feed[n];
   input SI.MolarMass MM_v_feed[n];
 
-        SI.MolarFlowRate Ndot_v_transfer[n,nSV](start=fill(-0.1,n,nSV)); // calculated in film model/balance equations
-  input SI.MolarFlowRate Ndot_l_transfer[n,nSL](start=fill(0.1,n,nSL)); // calculated in film model/balance equations
-        SI.HeatFlowRate Edot_l_transfer[n]; // calculated in film model/balance equations
-        SI.HeatFlowRate Edot_v_transfer[n]; // calculated in film model/balance equations
+        SI.MolarFlowRate Ndot_v_transfer[n,nSV](start=fill(-0.1,n,nSV));   // calculated in film model/balance equations
+  input SI.MolarFlowRate Ndot_l_transfer[n,nSL](start=fill(0.1,n,nSL));   // calculated in film model/balance equations
+        SI.HeatFlowRate Edot_l_transfer[n];   // calculated in film model/balance equations
+        SI.HeatFlowRate Edot_v_transfer[n];   // calculated in film model/balance equations
   input SI.MolarFlowRate Ndot_reac[n,nSL];
   input SI.HeatFlowRate Qdot_reac[n];
   input Boolean bool_eps[n];
@@ -114,7 +114,7 @@
     "vapour volume fraction";
 
 /*** entrainment ***/
-  input SI.VolumeFlowRate Vdot_le[n] "liquid volume flow entrained by vapour"; // has to be supplied in extending class
+  input SI.VolumeFlowRate Vdot_le[n] "liquid volume flow entrained by vapour";   // has to be supplied in extending class
 
 /*** StartUp ***/
   input Real Ndot_source_startUp[n]
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/Equilibrium/BaseTwoPhaseSteadyState.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/Equilibrium/BaseTwoPhaseSteadyState.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/Equilibrium/BaseTwoPhaseSteadyState.mo"	2022-03-10 09:57:37.904144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/Equilibrium/BaseTwoPhaseSteadyState.mo"	2022-03-10 09:58:39.508151919 +0000
@@ -8,9 +8,9 @@
   input SI.MolarInternalEnergy u_v[n](each stateSelect=StateSelect.default);
   input SI.MolarInternalEnergy u_l[n](each stateSelect=StateSelect.default);
 
-  Modelica.SIunits.AmountOfSubstance n_mol_L[n](each stateSelect=StateSelect.default);
-  Modelica.SIunits.AmountOfSubstance n_mol_V[n](each stateSelect=StateSelect.default);
-  Modelica.SIunits.AmountOfSubstance n_mol[n,nS];
+  Modelica.Units.SI.AmountOfSubstance n_mol_L[n](each stateSelect=StateSelect.default);
+  Modelica.Units.SI.AmountOfSubstance n_mol_V[n](each stateSelect=StateSelect.default);
+  Modelica.Units.SI.AmountOfSubstance n_mol[n,nS];
 
 protected
   Real eps_liq_state[n](each stateSelect=StateSelect.default)=eps_liq;
@@ -27,57 +27,47 @@
 end for;
 
 /*** MOLE BALANCES ***/
-if n==1 then
-
-/* EQ equations */
-
-   // component balance for vapour and liquid together
-  fill(0,nS) =  Ndot_v_in*x_upStreamIn_act + Ndot_l_in * x_downStreamIn_act  -Ndot_v[n]*x_upStreamOut_act -Ndot_l[1]* x_downStreamOut_act + Vdot_v_feed[1]*c_v_feed[1,:]+ Vdot_l_feed[1]*c_l_feed[1,:] + Ndot_source_startUp[1] * x_v[1,:]+ Ndot_reac[1,:]- Vdot_le[1]*c_l[1,:];
-
-  // total mole balance for liquid and vapour together
-   //bool_eps[1]=false;
-  // der(sum(n_mol[1,:])) =  Vdot_l_in*rho_l_in/MM_l_in+Vdot_v_in*rho_v_in/MM_v_in -  Vdot_l[1]*rho_l[1]/MM_l[1]-  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1]+ Ndot_source_startUp[1]- Vdot_le[1]*rho_l[1]/MM_l[1];
-  sum(x_v[1,:])=1;
+if n==1 then
+/* EQ equations */
+// component balance for vapour and liquid together
+    fill(0, nS) = Ndot_v_in * x_upStreamIn_act + Ndot_l_in * x_downStreamIn_act - Ndot_v[n] * x_upStreamOut_act - Ndot_l[1] * x_downStreamOut_act + Vdot_v_feed[1] * c_v_feed[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :] + Ndot_reac[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour together
+//bool_eps[1]=false;
+// der(sum(n_mol[1,:])) =  Vdot_l_in*rho_l_in/MM_l_in+Vdot_v_in*rho_v_in/MM_v_in -  Vdot_l[1]*rho_l[1]/MM_l[1]-  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1]+ Ndot_source_startUp[1]- Vdot_le[1]*rho_l[1]/MM_l[1];
+    sum(x_v[1, :]) = 1;
   sum(x_l[1,:])=1;
   Ndot_v_transfer[1,:]=fill(0,nS);
 
-  else
-
-    /** Begin lowest stage (n=1) **/
-   // component balance for vapour and liquid together
-   fill(0,nS) =  Ndot_v_in*x_upStreamIn_act + Ndot_l_in * x_downStreamIn_act  -Ndot_v[n]*x_upStreamOut_act -Ndot_l[1]* x_downStreamOut_act + Vdot_v_feed[1]*c_v_feed[1,:]+ Vdot_l_feed[1]*c_l_feed[1,:] + Ndot_source_startUp[1] * x_v[1,:]+ Ndot_reac[1,:]- Vdot_le[1]*c_l[1,:];
-
-   // total mole balance for liquid and vapour together
-   //bool_eps[1]=false;    /** End lowest stage (n=1) **/
-   // der(sum(n_mol[1,:])) =  Vdot_l_in*rho_l_in/MM_l_in+Vdot_v_in*rho_v_in/MM_v_in -  Vdot_l[1]*rho_l[1]/MM_l[1]-  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1]+ Ndot_source_startUp[1]- Vdot_le[1]*rho_l[1]/MM_l[1];
-   sum(x_v[1,:])=1;
+  else
+/** Begin lowest stage (n=1) **/
+// component balance for vapour and liquid together
+    fill(0, nS) = Ndot_v_in * x_upStreamIn_act + Ndot_l_in * x_downStreamIn_act - Ndot_v[n] * x_upStreamOut_act - Ndot_l[1] * x_downStreamOut_act + Vdot_v_feed[1] * c_v_feed[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :] + Ndot_reac[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour together
+//bool_eps[1]=false;    /** End lowest stage (n=1) **/
+// der(sum(n_mol[1,:])) =  Vdot_l_in*rho_l_in/MM_l_in+Vdot_v_in*rho_v_in/MM_v_in -  Vdot_l[1]*rho_l[1]/MM_l[1]-  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1]+ Ndot_source_startUp[1]- Vdot_le[1]*rho_l[1]/MM_l[1];
+    sum(x_v[1, :]) = 1;
    sum(x_l[1,:])=1;
-   Ndot_v_transfer[1,:]=fill(0,nS);
-
-    /** Begin stages 2 to n-1 **/
-    for j in 2:n-1 loop
-      for i in 1:nSV loop
-     0 = Vdot_v[j-1]*c_v[j-1,i]+Vdot_l[j+1]*c_l[j+1,i] - Vdot_v[j] * c_v[j,i]- Vdot_l[j] * c_l[j,i] + Ndot_reac[j,i]+ Vdot_l_feed[j]*c_l_feed[j,i] + Vdot_v_feed[j]*c_v_feed[j,i] + Ndot_source_startUp[j]*x_v[j,i]+ Vdot_le[j-1]*c_l[j-1,i] - Vdot_le[j]*c_l[j,i];
-    end for;
-
-   // total mole balance for liquid and vapour together
-     //bool_eps[j]=false;
-   // der(sum(n_mol[j,:])) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1]+Vdot_v[j-1]*rho_v[j-1]/MM_v[j-1] -  Vdot_l[j]*rho_l[j]/MM_l[j]-  Vdot_v[j]*rho_v[j]/MM_v[j]+ sum(Ndot_reac[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j]+ Vdot_v_feed[j]*rho_v_feed[j]/MM_v_feed[j] + Ndot_source_startUp[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
-   sum(x_v[j,:])=1;
-   sum(x_l[j,:])=1;
-   Ndot_v_transfer[j,:]=fill(0,nS);
-    end for;
-    /** End stages 2 to n-1 **/
-
-    /** Begin highest stage (n=n) **/
-
-   // component balance for vapour and liquid together
-   fill(0,nS) = Vdot_v[n-1]*c_v[n-1,:]+Ndot_l_in * x_downStreamIn_act  -Ndot_v[n]*x_upStreamOut_act- Vdot_l[n] * c_l[n,:] + Vdot_v_feed[n]*c_v_feed[n,:]+ Ndot_reac[n,:] + Vdot_l_feed[n]*c_l_feed[n,:] + Vdot_le[n-1]*c_l[n-1,:]  + Ndot_source_startUp[n]*x_v[n,:];
-
-  // total mole balance for liquid and vapour together
-  // bool_eps[n]=false;
-   // der(sum(n_mol[n,:])) = Ndot_l_in +Vdot_v[n-1]*rho_v[n-1]/MM_v[n-1] -  Vdot_l[n]*rho_l[n]/MM_l[n] -Ndot_v[n] + sum(Ndot_reac[n,:])+ Vdot_v_feed[n]*rho_v_feed[n]/MM_v_feed[n] + Ndot_source_startUp[n] + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
-   sum(x_v[n,:])=1;
+   Ndot_v_transfer[1,:]=fill(0,nS);
+/** Begin stages 2 to n-1 **/
+    for j in 2:n - 1 loop
+      for i in 1:nSV loop
+        0 = Vdot_v[j - 1] * c_v[j - 1, i] + Vdot_l[j + 1] * c_l[j + 1, i] - Vdot_v[j] * c_v[j, i] - Vdot_l[j] * c_l[j, i] + Ndot_reac[j, i] + Vdot_l_feed[j] * c_l_feed[j, i] + Vdot_v_feed[j] * c_v_feed[j, i] + Ndot_source_startUp[j] * x_v[j, i] + Vdot_le[j - 1] * c_l[j - 1, i] - Vdot_le[j] * c_l[j, i];
+      end for;
+// total mole balance for liquid and vapour together
+//bool_eps[j]=false;
+// der(sum(n_mol[j,:])) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1]+Vdot_v[j-1]*rho_v[j-1]/MM_v[j-1] -  Vdot_l[j]*rho_l[j]/MM_l[j]-  Vdot_v[j]*rho_v[j]/MM_v[j]+ sum(Ndot_reac[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j]+ Vdot_v_feed[j]*rho_v_feed[j]/MM_v_feed[j] + Ndot_source_startUp[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
+      sum(x_v[j, :]) = 1;
+      sum(x_l[j, :]) = 1;
+      Ndot_v_transfer[j, :] = fill(0, nS);
+    end for;
+/** End stages 2 to n-1 **/
+/** Begin highest stage (n=n) **/
+// component balance for vapour and liquid together
+    fill(0, nS) = Vdot_v[n - 1] * c_v[n - 1, :] + Ndot_l_in * x_downStreamIn_act - Ndot_v[n] * x_upStreamOut_act - Vdot_l[n] * c_l[n, :] + Vdot_v_feed[n] * c_v_feed[n, :] + Ndot_reac[n, :] + Vdot_l_feed[n] * c_l_feed[n, :] + Vdot_le[n - 1] * c_l[n - 1, :] + Ndot_source_startUp[n] * x_v[n, :];
+// total mole balance for liquid and vapour together
+// bool_eps[n]=false;
+// der(sum(n_mol[n,:])) = Ndot_l_in +Vdot_v[n-1]*rho_v[n-1]/MM_v[n-1] -  Vdot_l[n]*rho_l[n]/MM_l[n] -Ndot_v[n] + sum(Ndot_reac[n,:])+ Vdot_v_feed[n]*rho_v_feed[n]/MM_v_feed[n] + Ndot_source_startUp[n] + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
+    sum(x_v[n, :]) = 1;
    sum(x_l[n,:])=1;
    Ndot_v_transfer[n,:]=fill(0,nS);
   /** End highest stage (n=n) **/
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/Equilibrium/BaseTwoPhaseVarState.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/Equilibrium/BaseTwoPhaseVarState.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/Equilibrium/BaseTwoPhaseVarState.mo"	2022-03-10 09:57:37.904144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/Equilibrium/BaseTwoPhaseVarState.mo"	2022-03-10 09:58:39.488151916 +0000
@@ -8,9 +8,9 @@
   input SI.MolarInternalEnergy u_v[n](each stateSelect=StateSelect.default);
   input SI.MolarInternalEnergy u_l[n](each stateSelect=StateSelect.default);
 
-  Modelica.SIunits.AmountOfSubstance n_mol_L[n](each stateSelect=StateSelect.default);
-  Modelica.SIunits.AmountOfSubstance n_mol_V[n](each stateSelect=StateSelect.default);
-  Modelica.SIunits.AmountOfSubstance n_mol[n,nS];
+  Modelica.Units.SI.AmountOfSubstance n_mol_L[n](each stateSelect=StateSelect.default);
+  Modelica.Units.SI.AmountOfSubstance n_mol_V[n](each stateSelect=StateSelect.default);
+  Modelica.Units.SI.AmountOfSubstance n_mol[n,nS];
 
 protected
   Real eps_liq_state[n](each stateSelect=StateSelect.prefer)=eps_liq;
@@ -27,57 +27,47 @@
 end for;
 
 /*** MOLE BALANCES ***/
-if n==1 then
-
-/* EQ equations */
-
-   // component balance for vapour and liquid together
-  der(n_mol[1,:]) =  Ndot_v_in*x_upStreamIn_act + Ndot_l_in * x_downStreamIn_act  -Ndot_v[n]*x_upStreamOut_act -Ndot_l[1]* x_downStreamOut_act + Vdot_v_feed[1]*c_v_feed[1,:]+ Vdot_l_feed[1]*c_l_feed[1,:] + Ndot_source_startUp[1] * x_v[1,:]+ Ndot_reac[1,:]- Vdot_le[1]*c_l[1,:];
-
-  // total mole balance for liquid and vapour together
-  // bool_eps[1]=false;
-  // der(sum(n_mol[1,:])) =  Vdot_l_in*rho_l_in/MM_l_in+Vdot_v_in*rho_v_in/MM_v_in -  Vdot_l[1]*rho_l[1]/MM_l[1]-  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1]+ Ndot_source_startUp[1]- Vdot_le[1]*rho_l[1]/MM_l[1];
-  sum(x_v[1,:])=1;
+if n==1 then
+/* EQ equations */
+// component balance for vapour and liquid together
+    der(n_mol[1, :]) = Ndot_v_in * x_upStreamIn_act + Ndot_l_in * x_downStreamIn_act - Ndot_v[n] * x_upStreamOut_act - Ndot_l[1] * x_downStreamOut_act + Vdot_v_feed[1] * c_v_feed[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :] + Ndot_reac[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour together
+// bool_eps[1]=false;
+// der(sum(n_mol[1,:])) =  Vdot_l_in*rho_l_in/MM_l_in+Vdot_v_in*rho_v_in/MM_v_in -  Vdot_l[1]*rho_l[1]/MM_l[1]-  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1]+ Ndot_source_startUp[1]- Vdot_le[1]*rho_l[1]/MM_l[1];
+    sum(x_v[1, :]) = 1;
   sum(x_l[1,:])=1;
   Ndot_v_transfer[1,:]=fill(0,nS);
 
-  else
-
-    /** Begin lowest stage (n=1) **/
-   // component balance for vapour and liquid together
-   der(n_mol[1,:]) =  Ndot_v_in*x_upStreamIn_act + Ndot_l_in * x_downStreamIn_act  -Ndot_v[n]*x_upStreamOut_act -Ndot_l[1]* x_downStreamOut_act + Vdot_v_feed[1]*c_v_feed[1,:]+ Vdot_l_feed[1]*c_l_feed[1,:] + Ndot_source_startUp[1] * x_v[1,:]+ Ndot_reac[1,:]- Vdot_le[1]*c_l[1,:];
-
-   // total mole balance for liquid and vapour together
-   //bool_eps[1]=false;    /** End lowest stage (n=1) **/
-   // der(sum(n_mol[1,:])) =  Vdot_l_in*rho_l_in/MM_l_in+Vdot_v_in*rho_v_in/MM_v_in -  Vdot_l[1]*rho_l[1]/MM_l[1]-  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1]+ Ndot_source_startUp[1]- Vdot_le[1]*rho_l[1]/MM_l[1];
-   sum(x_v[1,:])=1;
+  else
+/** Begin lowest stage (n=1) **/
+// component balance for vapour and liquid together
+    der(n_mol[1, :]) = Ndot_v_in * x_upStreamIn_act + Ndot_l_in * x_downStreamIn_act - Ndot_v[n] * x_upStreamOut_act - Ndot_l[1] * x_downStreamOut_act + Vdot_v_feed[1] * c_v_feed[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :] + Ndot_reac[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour together
+//bool_eps[1]=false;    /** End lowest stage (n=1) **/
+// der(sum(n_mol[1,:])) =  Vdot_l_in*rho_l_in/MM_l_in+Vdot_v_in*rho_v_in/MM_v_in -  Vdot_l[1]*rho_l[1]/MM_l[1]-  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1]+ Ndot_source_startUp[1]- Vdot_le[1]*rho_l[1]/MM_l[1];
+    sum(x_v[1, :]) = 1;
    sum(x_l[1,:])=1;
-   Ndot_v_transfer[1,:]=fill(0,nS);
-
-    /** Begin stages 2 to n-1 **/
-    for j in 2:n-1 loop
-      for i in 1:nSV loop
-     der(n_mol[j,i]) = Vdot_v[j-1]*c_v[j-1,i]+Vdot_l[j+1]*c_l[j+1,i] - Vdot_v[j] * c_v[j,i]- Vdot_l[j] * c_l[j,i] + Ndot_reac[j,i]+ Vdot_l_feed[j]*c_l_feed[j,i] + Vdot_v_feed[j]*c_v_feed[j,i] + Ndot_source_startUp[j]*x_v[j,i]+ Vdot_le[j-1]*c_l[j-1,i] - Vdot_le[j]*c_l[j,i];
-    end for;
-
-   // total mole balance for liquid and vapour together
-    // bool_eps[j]=false;
-   // der(sum(n_mol[j,:])) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1]+Vdot_v[j-1]*rho_v[j-1]/MM_v[j-1] -  Vdot_l[j]*rho_l[j]/MM_l[j]-  Vdot_v[j]*rho_v[j]/MM_v[j]+ sum(Ndot_reac[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j]+ Vdot_v_feed[j]*rho_v_feed[j]/MM_v_feed[j] + Ndot_source_startUp[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
-   sum(x_v[j,:])=1;
-   sum(x_l[j,:])=1;
-   Ndot_v_transfer[j,:]=fill(0,nS);
-    end for;
-    /** End stages 2 to n-1 **/
-
-    /** Begin highest stage (n=n) **/
-
-   // component balance for vapour and liquid together
-   der(n_mol[n,:]) = Vdot_v[n-1]*c_v[n-1,:]+Ndot_l_in * x_downStreamIn_act  -Ndot_v[n]*x_upStreamOut_act- Vdot_l[n] * c_l[n,:] + Vdot_v_feed[n]*c_v_feed[n,:]+ Ndot_reac[n,:] + Vdot_l_feed[n]*c_l_feed[n,:] + Vdot_le[n-1]*c_l[n-1,:]  + Ndot_source_startUp[n]*x_v[n,:];
-
-  // total mole balance for liquid and vapour together
-  // bool_eps[n]=false;
-   // der(sum(n_mol[n,:])) = Ndot_l_in +Vdot_v[n-1]*rho_v[n-1]/MM_v[n-1] -  Vdot_l[n]*rho_l[n]/MM_l[n] -Ndot_v[n] + sum(Ndot_reac[n,:])+ Vdot_v_feed[n]*rho_v_feed[n]/MM_v_feed[n] + Ndot_source_startUp[n] + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
-   sum(x_v[n,:])=1;
+   Ndot_v_transfer[1,:]=fill(0,nS);
+/** Begin stages 2 to n-1 **/
+    for j in 2:n - 1 loop
+      for i in 1:nSV loop
+        der(n_mol[j, i]) = Vdot_v[j - 1] * c_v[j - 1, i] + Vdot_l[j + 1] * c_l[j + 1, i] - Vdot_v[j] * c_v[j, i] - Vdot_l[j] * c_l[j, i] + Ndot_reac[j, i] + Vdot_l_feed[j] * c_l_feed[j, i] + Vdot_v_feed[j] * c_v_feed[j, i] + Ndot_source_startUp[j] * x_v[j, i] + Vdot_le[j - 1] * c_l[j - 1, i] - Vdot_le[j] * c_l[j, i];
+      end for;
+// total mole balance for liquid and vapour together
+// bool_eps[j]=false;
+// der(sum(n_mol[j,:])) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1]+Vdot_v[j-1]*rho_v[j-1]/MM_v[j-1] -  Vdot_l[j]*rho_l[j]/MM_l[j]-  Vdot_v[j]*rho_v[j]/MM_v[j]+ sum(Ndot_reac[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j]+ Vdot_v_feed[j]*rho_v_feed[j]/MM_v_feed[j] + Ndot_source_startUp[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
+      sum(x_v[j, :]) = 1;
+      sum(x_l[j, :]) = 1;
+      Ndot_v_transfer[j, :] = fill(0, nS);
+    end for;
+/** End stages 2 to n-1 **/
+/** Begin highest stage (n=n) **/
+// component balance for vapour and liquid together
+    der(n_mol[n, :]) = Vdot_v[n - 1] * c_v[n - 1, :] + Ndot_l_in * x_downStreamIn_act - Ndot_v[n] * x_upStreamOut_act - Vdot_l[n] * c_l[n, :] + Vdot_v_feed[n] * c_v_feed[n, :] + Ndot_reac[n, :] + Vdot_l_feed[n] * c_l_feed[n, :] + Vdot_le[n - 1] * c_l[n - 1, :] + Ndot_source_startUp[n] * x_v[n, :];
+// total mole balance for liquid and vapour together
+// bool_eps[n]=false;
+// der(sum(n_mol[n,:])) = Ndot_l_in +Vdot_v[n-1]*rho_v[n-1]/MM_v[n-1] -  Vdot_l[n]*rho_l[n]/MM_l[n] -Ndot_v[n] + sum(Ndot_reac[n,:])+ Vdot_v_feed[n]*rho_v_feed[n]/MM_v_feed[n] + Ndot_source_startUp[n] + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
+    sum(x_v[n, :]) = 1;
    sum(x_l[n,:])=1;
    Ndot_v_transfer[n,:]=fill(0,nS);
   /** End highest stage (n=n) **/
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseBalanceEquationsNonEq.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseBalanceEquationsNonEq.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseBalanceEquationsNonEq.mo"	2022-03-10 09:57:37.904144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseBalanceEquationsNonEq.mo"	2022-03-10 09:58:39.464151913 +0000
@@ -25,9 +25,9 @@
   MediumVapour.BaseProperties mediumVapourStar[n](c=c_v, each T0=T_ref, p=p_v[1:n], T=T_star, x=x_v_star, x_star=x_v_star,h=h_vap_star);
   MediumLiquid.BaseProperties mediumLiquidStar[n](each T0=T_ref, p=p_hyd[1:n], T=T_star, x=x_l_star, h=h_liq_star);
   SI.Temperature T_star[n];
-  input SI.MoleFraction x_l_star[n,nSL]; // is this really an input or does it come from the film model?
+  input SI.MoleFraction x_l_star[n,nSL];   // is this really an input or does it come from the film model?
   output SI.MoleFraction c_l_star[n,nSL];
-  input SI.MoleFraction x_v_star[n,nSV]; // is this really an input or does it come from the film model?
+  input SI.MoleFraction x_v_star[n,nSV];   // is this really an input or does it come from the film model?
   output SI.MoleFraction c_v_star[n,nSV];
 
   output SI.MoleFraction h_vap_star[n];
@@ -60,13 +60,13 @@
    SI.MolarMass MM_l_in=propsLiqIn.MM;
    ThermalSeparation.Units.MolarEnthalpy h_l[n]=propsLiq.h;
    ThermalSeparation.Units.MolarEnthalpy h_l_in=propsLiqIn.h;
-  parameter Modelica.SIunits.Temperature T_ref;
+  parameter Modelica.Units.SI.Temperature T_ref;
 
   /*** variables upStream ***/
   input SI.Concentration c_v[n,nSV](each stateSelect=StateSelect.default);
    SI.Concentration c_v_in[nSV]=propsVapIn.c;
    SI.MoleFraction x_v_in[nSV]=propsVapIn.x;
-   // SI.MoleFraction x_v[n,nSV]=propsVap.x;
+   // SI.MoleFraction x_v[n,nSV]=propsVap.x;
    SI.MoleFraction x_v[n,nSV];
   input SI.VolumeFlowRate Vdot_v_in(nominal=1e-2);
   input SI.VolumeFlowRate Vdot_v[n](nominal=fill(1e-2,n));
@@ -101,10 +101,10 @@
   input SI.MolarMass MM_l_feed[n];
   input SI.MolarMass MM_v_feed[n];
 
-        SI.MolarFlowRate Ndot_v_transfer[n,nSV](start=fill(-0.1,n,nSV)); // calculated in film model/balance equations
-  input SI.MolarFlowRate Ndot_l_transfer[n,nSL](start=fill(0.1,n,nSL));  // calculated in film model/balance equations
-        SI.HeatFlowRate Edot_l_transfer[n]; // calculated in film model/balance equations
-        SI.HeatFlowRate Edot_v_transfer[n]; // calculated in film model/balance equations
+        SI.MolarFlowRate Ndot_v_transfer[n,nSV](start=fill(-0.1,n,nSV));   // calculated in film model/balance equations
+  input SI.MolarFlowRate Ndot_l_transfer[n,nSL](start=fill(0.1,n,nSL));    // calculated in film model/balance equations
+        SI.HeatFlowRate Edot_l_transfer[n];   // calculated in film model/balance equations
+        SI.HeatFlowRate Edot_v_transfer[n];   // calculated in film model/balance equations
   input SI.MolarFlowRate Ndot_reac[n,nSL];
   input SI.HeatFlowRate Qdot_reac[n];
   input Boolean bool_eps[n];
@@ -121,7 +121,7 @@
     "vapour volume fraction";
 
 /*** entrainment ***/
-  input SI.VolumeFlowRate Vdot_le[n] "liquid volume flow entrained by vapour"; // has to be supplied in extending class
+  input SI.VolumeFlowRate Vdot_le[n] "liquid volume flow entrained by vapour";   // has to be supplied in extending class
 
 /*** StartUp ***/
   input Real Ndot_source_startUp[n]
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseFixedState.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseFixedState.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseFixedState.mo"	2022-03-10 09:57:37.904144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseFixedState.mo"	2022-03-10 09:58:39.436151909 +0000
@@ -7,82 +7,65 @@
 /*** changes to reduce index: fixed state selection ***/
   input SI.MolarInternalEnergy u_v[n](stateSelect=StateSelect.prefer);
   input SI.MolarInternalEnergy u_l[n](stateSelect=StateSelect.prefer);
-  Modelica.SIunits.AmountOfSubstance n_mol_L[n](stateSelect=StateSelect.prefer);
-  Modelica.SIunits.AmountOfSubstance n_mol_V[n](stateSelect=StateSelect.prefer);
-  Modelica.SIunits.AmountOfSubstance n_mol_L_i[n,nSL](stateSelect=StateSelect.prefer);
-  Modelica.SIunits.AmountOfSubstance n_mol_V_i[n,nSV](stateSelect=StateSelect.prefer);
-  Modelica.SIunits.AmountOfSubstance n_mol[n,nS];
+  Modelica.Units.SI.AmountOfSubstance n_mol_L[n](stateSelect=StateSelect.prefer);
+  Modelica.Units.SI.AmountOfSubstance n_mol_V[n](stateSelect=StateSelect.prefer);
+  Modelica.Units.SI.AmountOfSubstance n_mol_L_i[n,nSL](stateSelect=StateSelect.prefer);
+  Modelica.Units.SI.AmountOfSubstance n_mol_V_i[n,nSV](stateSelect=StateSelect.prefer);
+  Modelica.Units.SI.AmountOfSubstance n_mol[n,nS];
 
 equation
 stat=false;
 
 /*** MOLE BALANCES ***/
-if n==1 then
-
-   // component balance for vapour
-  der(n_mol_V_i[1,:]) =  Ndot_v_in*x_upStreamIn_act  -Ndot_v[n]*x_upStreamOut_act + Ndot_v_transfer[1,:] + Vdot_v_feed[1]*c_v_feed[1,:] + Ndot_source_startUp[1] * x_v[1,:];
-    // component balance for liquid
- der(n_mol_L_i[1,:]) = Ndot_l_in * x_downStreamIn_act  -Ndot_l[1]* x_downStreamOut_act + Ndot_l_transfer[1,:] + Ndot_reac[1,:] + Vdot_l_feed[1]*c_l_feed[1,:] - Vdot_le[1]*c_l[1,:];
-
-  // total mole balance for liquid and vapour
-  // bool_eps[1]=false;
-   der(n_mol_L[1]) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-   //    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-
-      der(n_mol_V[1]) = Vdot_v_in*rho_v_in/MM_v_in -  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_v_transfer[1,:]) + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1] + Ndot_source_startUp[1];
-else
-
-  /** Begin lowest stage (n=1) **/
-
-   // component balance for vapour
-  der(n_mol_V_i[1,:]) = Ndot_v_in*x_upStreamIn_act - Vdot_v[1] * c_v[1,:] + Ndot_v_transfer[1,:] + Vdot_v_feed[1]*c_v_feed[1,:] + Ndot_source_startUp[1]*x_v[1,:];
-    // component balance for liquid
-   der(n_mol_L_i[1,:]) = Vdot_l[2]*c_l[2,:]    -Ndot_l[1] * x_downStreamOut_act + Ndot_l_transfer[1,:] + Ndot_reac[1,:] + Vdot_l_feed[1]*c_l_feed[1,:] - Vdot_le[1]*c_l[1,:];
-
-  // total mole balance for liquid and vapour
-
-  // bool_eps[1]=false;
-   der(n_mol_L[1]) =  Vdot_l[2]*rho_l[2]/MM_l[2] -Ndot_l[1] + sum(Ndot_l_transfer[1,:]) + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-   //    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l[2]*rho_l[2]/MM_l[2] -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-
-   der(n_mol_V[1]) = Ndot_v_in -  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_v_transfer[1,:]) + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1] + Ndot_source_startUp[1];
-  /** End lowest stage (n=1) **/
-
-  /** Begin stages 2 to n-1 **/
-  for j in 2:n-1 loop
-    for i in 1:nSV loop
-     // component balance for vapour
-     der(n_mol_V_i[j,i]) = Vdot_v[j-1]*c_v[j-1,i] - Vdot_v[j] * c_v[j,i] + Ndot_v_transfer[j,i] + Vdot_v_feed[j]*c_v_feed[j,i] + Ndot_source_startUp[j]*x_v[j,i];
-    end for;
-    for i in 1:nSL loop
-      // component balance for liquid
-     der(n_mol_L_i[j,i]) = Vdot_l[j+1]*c_l[j+1,i] - Vdot_l[j] * c_l[j,i] + Ndot_l_transfer[j,i]+ Ndot_reac[j,i]+ Vdot_l_feed[j]*c_l_feed[j,i] + Vdot_le[j-1]*c_l[j-1,i] - Vdot_le[j]*c_l[j,i];
-    end for;
-   // total mole balance for liquid and vapour
-    // bool_eps[j]=false;
-   der(n_mol_L[j]) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(Ndot_reac[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
-   //   A*H/n*eps* der(eps_liq[j]*rho_l[j]/MM_l[j]) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(reaction.Ndot[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
-
-  der(n_mol_V[j]) = Vdot_v[j-1]*rho_v[j-1]/MM_v[j-1] -  Vdot_v[j]*rho_v[j]/MM_v[j]  + sum(Ndot_v_transfer[j,:])+ Vdot_v_feed[j]*rho_v_feed[j]/MM_v_feed[j] + Ndot_source_startUp[j];
-   end for;
-  /** End stages 2 to n-1 **/
-
-  /** Begin highest stage (n=n) **/
-
-   // component balance for vapour
-
-   der(n_mol_V_i[n,:]) = Vdot_v[n-1]*c_v[n-1,:]  -Ndot_v[n]*x_upStreamOut_act + Ndot_v_transfer[n,:] + Vdot_v_feed[n]*c_v_feed[n,:]  + Ndot_source_startUp[n]*x_v[n,:];
-
-    // component balance for liquid
-   der(n_mol_L_i[n,:]) = Ndot_l_in * x_downStreamIn_act - Vdot_l[n] * c_l[n,:] + Ndot_l_transfer[n,:]+ Ndot_reac[n,:] + Vdot_l_feed[n]*c_l_feed[n,:] + Vdot_le[n-1]*c_l[n-1,:];
-
-  // total mole balance for liquid and vapour
-
-     //bool_eps[n]=false;
-   der(n_mol_L[n]) = Ndot_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(Ndot_reac[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
-   //   A*H/n*eps* der(eps_liq[n]*rho_l[n]/MM_l[n]) = Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(reaction.Ndot[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
-
-   der(n_mol_V[n]) = Vdot_v[n-1]*rho_v[n-1]/MM_v[n-1] -Ndot_v[n] + sum(Ndot_v_transfer[n,:])+ Vdot_v_feed[n]*rho_v_feed[n]/MM_v_feed[n] + Ndot_source_startUp[n];
+if n==1 then
+// component balance for vapour
+    der(n_mol_V_i[1, :]) = Ndot_v_in * x_upStreamIn_act - Ndot_v[n] * x_upStreamOut_act + Ndot_v_transfer[1, :] + Vdot_v_feed[1] * c_v_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :];
+// component balance for liquid
+    der(n_mol_L_i[1, :]) = Ndot_l_in * x_downStreamIn_act - Ndot_l[1] * x_downStreamOut_act + Ndot_l_transfer[1, :] + Ndot_reac[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour
+// bool_eps[1]=false;
+    der(n_mol_L[1]) = Vdot_l_in * rho_l_in / MM_l_in - Vdot_l[1] * rho_l[1] / MM_l[1] + sum(Ndot_l_transfer[1, :]) + sum(Ndot_reac[1, :]) + Vdot_l_feed[1] * rho_l_feed[1] / MM_l_feed[1] - Vdot_le[1] * rho_l[1] / MM_l[1];
+//    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
+    der(n_mol_V[1]) = Vdot_v_in * rho_v_in / MM_v_in - Vdot_v[1] * rho_v[1] / MM_v[1] + sum(Ndot_v_transfer[1, :]) + Vdot_v_feed[1] * rho_v_feed[1] / MM_v_feed[1] + Ndot_source_startUp[1];
+else
+/** Begin lowest stage (n=1) **/
+// component balance for vapour
+    der(n_mol_V_i[1, :]) = Ndot_v_in * x_upStreamIn_act - Vdot_v[1] * c_v[1, :] + Ndot_v_transfer[1, :] + Vdot_v_feed[1] * c_v_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :];
+// component balance for liquid
+    der(n_mol_L_i[1, :]) = Vdot_l[2] * c_l[2, :] - Ndot_l[1] * x_downStreamOut_act + Ndot_l_transfer[1, :] + Ndot_reac[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour
+// bool_eps[1]=false;
+    der(n_mol_L[1]) = Vdot_l[2] * rho_l[2] / MM_l[2] - Ndot_l[1] + sum(Ndot_l_transfer[1, :]) + sum(Ndot_reac[1, :]) + Vdot_l_feed[1] * rho_l_feed[1] / MM_l_feed[1] - Vdot_le[1] * rho_l[1] / MM_l[1];
+//    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l[2]*rho_l[2]/MM_l[2] -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
+    der(n_mol_V[1]) = Ndot_v_in - Vdot_v[1] * rho_v[1] / MM_v[1] + sum(Ndot_v_transfer[1, :]) + Vdot_v_feed[1] * rho_v_feed[1] / MM_v_feed[1] + Ndot_source_startUp[1];
+/** End lowest stage (n=1) **/
+/** Begin stages 2 to n-1 **/
+    for j in 2:n - 1 loop
+      for i in 1:nSV loop
+// component balance for vapour
+        der(n_mol_V_i[j, i]) = Vdot_v[j - 1] * c_v[j - 1, i] - Vdot_v[j] * c_v[j, i] + Ndot_v_transfer[j, i] + Vdot_v_feed[j] * c_v_feed[j, i] + Ndot_source_startUp[j] * x_v[j, i];
+      end for;
+      for i in 1:nSL loop
+// component balance for liquid
+        der(n_mol_L_i[j, i]) = Vdot_l[j + 1] * c_l[j + 1, i] - Vdot_l[j] * c_l[j, i] + Ndot_l_transfer[j, i] + Ndot_reac[j, i] + Vdot_l_feed[j] * c_l_feed[j, i] + Vdot_le[j - 1] * c_l[j - 1, i] - Vdot_le[j] * c_l[j, i];
+      end for;
+// total mole balance for liquid and vapour
+// bool_eps[j]=false;
+      der(n_mol_L[j]) = Vdot_l[j + 1] * rho_l[j + 1] / MM_l[j + 1] - Vdot_l[j] * rho_l[j] / MM_l[j] + sum(Ndot_l_transfer[j, :]) + sum(Ndot_reac[j, :]) + Vdot_l_feed[j] * rho_l_feed[j] / MM_l_feed[j] + Vdot_le[j - 1] * rho_l[j - 1] / MM_l[j - 1] - Vdot_le[j] * rho_l[j] / MM_l[j];
+//   A*H/n*eps* der(eps_liq[j]*rho_l[j]/MM_l[j]) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(reaction.Ndot[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
+      der(n_mol_V[j]) = Vdot_v[j - 1] * rho_v[j - 1] / MM_v[j - 1] - Vdot_v[j] * rho_v[j] / MM_v[j] + sum(Ndot_v_transfer[j, :]) + Vdot_v_feed[j] * rho_v_feed[j] / MM_v_feed[j] + Ndot_source_startUp[j];
+    end for;
+/** End stages 2 to n-1 **/
+/** Begin highest stage (n=n) **/
+// component balance for vapour
+    der(n_mol_V_i[n, :]) = Vdot_v[n - 1] * c_v[n - 1, :] - Ndot_v[n] * x_upStreamOut_act + Ndot_v_transfer[n, :] + Vdot_v_feed[n] * c_v_feed[n, :] + Ndot_source_startUp[n] * x_v[n, :];
+// component balance for liquid
+    der(n_mol_L_i[n, :]) = Ndot_l_in * x_downStreamIn_act - Vdot_l[n] * c_l[n, :] + Ndot_l_transfer[n, :] + Ndot_reac[n, :] + Vdot_l_feed[n] * c_l_feed[n, :] + Vdot_le[n - 1] * c_l[n - 1, :];
+// total mole balance for liquid and vapour
+//bool_eps[n]=false;
+    der(n_mol_L[n]) = Ndot_l_in - Vdot_l[n] * rho_l[n] / MM_l[n] + sum(Ndot_l_transfer[n, :]) + sum(Ndot_reac[n, :]) + Vdot_l_feed[n] * rho_l_feed[n] / MM_l_feed[n] + Vdot_le[n - 1] * rho_l[n - 1] / MM_l[n - 1];
+//   A*H/n*eps* der(eps_liq[n]*rho_l[n]/MM_l[n]) = Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(reaction.Ndot[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
+    der(n_mol_V[n]) = Vdot_v[n - 1] * rho_v[n - 1] / MM_v[n - 1] - Ndot_v[n] + sum(Ndot_v_transfer[n, :]) + Vdot_v_feed[n] * rho_v_feed[n] / MM_v_feed[n] + Ndot_source_startUp[n];
 /** End highest stage (n=n) **/
 end if;
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseSteadyState.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseSteadyState.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseSteadyState.mo"	2022-03-10 09:57:37.904144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseSteadyState.mo"	2022-03-10 09:58:39.380151901 +0000
@@ -1,103 +1,80 @@
-within ThermalSeparation.BalanceEquations.Base.NonEquilibrium;
-model BaseTwoPhaseSteadyState "phases balanced seperately, steady state"
-
-extends
-    ThermalSeparation.BalanceEquations.Base.NonEquilibrium.BaseBalanceEquationsNonEq;
-
-  input SI.MolarInternalEnergy u_v[n](each stateSelect=StateSelect.default);
-  input SI.MolarInternalEnergy u_l[n](each stateSelect=StateSelect.default);
-
-protected
-  Real eps_liq_state[n]=eps_liq;//(each stateSelect=StateSelect.prefer)=eps_liq;
-
-equation
-stat=false;
-
-/*** MOLE BALANCES ***/
-if n==1 then
-
-   // component balance for vapour
- fill(0,nSV) =  Ndot_v_in*x_upStreamIn_act  -Ndot_v[n]*x_upStreamOut_act + Ndot_v_transfer[1,:] + Vdot_v_feed[1]*c_v_feed[1,:] + Ndot_source_startUp[1] * x_v[1,:];
-    // component balance for liquid
- fill(0,nSL) = Ndot_l_in * x_downStreamIn_act  -Ndot_l[1]* x_downStreamOut_act + Ndot_l_transfer[1,:] + Ndot_reac[1,:] + Vdot_l_feed[1]*c_l_feed[1,:] - Vdot_le[1]*c_l[1,:];
-
-  // total mole balance for liquid and vapour
-
-   //bool_eps[1]=false;
-    0 =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-   //    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-
-       0 = Vdot_v_in*rho_v_in/MM_v_in -  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_v_transfer[1,:]) + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1] + Ndot_source_startUp[1];
-  else
-
-    /** Begin lowest stage (n=1) **/
-
-     // component balance for vapour
-    fill(0,nSV) = Ndot_v_in*x_upStreamIn_act - Vdot_v[1] * c_v[1,:] + Ndot_v_transfer[1,:] + Vdot_v_feed[1]*c_v_feed[1,:] + Ndot_source_startUp[1]*x_v[1,:];
-      // component balance for liquid
-      fill(0,nSL) = Vdot_l[2]*c_l[2,:]    -Ndot_l[1] * x_downStreamOut_act + Ndot_l_transfer[1,:] + Ndot_reac[1,:] + Vdot_l_feed[1]*c_l_feed[1,:] - Vdot_le[1]*c_l[1,:];
-
-    // total mole balance for liquid and vapour
-
-     //bool_eps[1]=false;
-      0 =  Vdot_l[2]*rho_l[2]/MM_l[2] -Ndot_l[1] + sum(Ndot_l_transfer[1,:]) + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-     //    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l[2]*rho_l[2]/MM_l[2] -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-
-          0 = Ndot_v_in -  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_v_transfer[1,:]) + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1] + Ndot_source_startUp[1];
-    /** End lowest stage (n=1) **/
-
-    /** Begin stages 2 to n-1 **/
-    for j in 2:n-1 loop
-      for i in 1:nSV loop
-       // component balance for vapour
-        0 = Vdot_v[j-1]*c_v[j-1,i] - Vdot_v[j] * c_v[j,i] + Ndot_v_transfer[j,i] + Vdot_v_feed[j]*c_v_feed[j,i] + Ndot_source_startUp[j]*x_v[j,i];
-      end for;
-      for i in 1:nSL loop
-        // component balance for liquid
-        0 = Vdot_l[j+1]*c_l[j+1,i] - Vdot_l[j] * c_l[j,i] + Ndot_l_transfer[j,i]+ Ndot_reac[j,i]+ Vdot_l_feed[j]*c_l_feed[j,i] + Vdot_le[j-1]*c_l[j-1,i] - Vdot_le[j]*c_l[j,i];
-      end for;
-     // total mole balance for liquid and vapour
-
-       //bool_eps[j]=false;
-     0 = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(Ndot_reac[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
-     //   A*H/n*eps* der(eps_liq[j]*rho_l[j]/MM_l[j]) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(reaction.Ndot[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
-
-   0 = Vdot_v[j-1]*rho_v[j-1]/MM_v[j-1] -  Vdot_v[j]*rho_v[j]/MM_v[j]  + sum(Ndot_v_transfer[j,:])+ Vdot_v_feed[j]*rho_v_feed[j]/MM_v_feed[j] + Ndot_source_startUp[j];
-     end for;
-    /** End stages 2 to n-1 **/
-
-    /** Begin highest stage (n=n) **/
-
-     // component balance for vapour
-      fill(0,nSV) = Vdot_v[n-1]*c_v[n-1,:]  -Ndot_v[n]*x_upStreamOut_act + Ndot_v_transfer[n,:] + Vdot_v_feed[n]*c_v_feed[n,:]  + Ndot_source_startUp[n]*x_v[n,:];
-      // component balance for liquid
-     fill(0,nSL) = Ndot_l_in * x_downStreamIn_act - Vdot_l[n] * c_l[n,:] + Ndot_l_transfer[n,:]+ Ndot_reac[n,:] + Vdot_l_feed[n]*c_l_feed[n,:] + Vdot_le[n-1]*c_l[n-1,:];
-    // total mole balance for liquid and vapour
-
-      // bool_eps[n]=false;
-     0 = Ndot_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(Ndot_reac[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
-     //   A*H/n*eps* der(eps_liq[n]*rho_l[n]/MM_l[n]) = Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(reaction.Ndot[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
-
-    0 = Vdot_v[n-1]*rho_v[n-1]/MM_v[n-1] -Ndot_v[n] + sum(Ndot_v_transfer[n,:])+ Vdot_v_feed[n]*rho_v_feed[n]/MM_v_feed[n] + Ndot_source_startUp[n];
-  /** End highest stage (n=n) **/
-  end if;
-
-/*** ENERGY BALANCE ***/
-  if n==1 then
-    0 =sum(-Ndot_v_transfer[1,:].* delta_hv[1,:])+ Ndot_l_in*h_downStreamIn_act   -Ndot_l[1]*h_downStreamOut_act  - Qdot_wall[1] + Edot_l_transfer[1]  + Vdot_l_feed[1]*sum(c_l_feed[1,:])*h_l_feed[1] - Vdot_le[1]*sum(c_l[1,:])*h_l[1] +Qdot_reac[1];
-    0 = Ndot_v_in*h_upStreamIn_act   -Ndot_v[n]*h_upStreamOut_act +Edot_v_transfer[1]  + Vdot_v_feed[1]*sum(c_v_feed[1,:])*h_v_feed[1] + Ndot_source_startUp[1]*h_v[1];
-  else
-    0 = sum(-Ndot_v_transfer[1,:].* delta_hv[1,:])+Vdot_l[2]*sum(c_l[2,:])*h_l[2] -Ndot_l[1]*h_downStreamOut_act - Qdot_wall[1] + Edot_l_transfer[1]  + Vdot_l_feed[1]*sum(c_l_feed[1,:])*h_l_feed[1] - Vdot_le[1]*sum(c_l[1,:])*h_l[1] + Qdot_reac[1];
-      for j in 2:n-1 loop
-    0 = sum(-Ndot_v_transfer[j,:].* delta_hv[j,:])+  Vdot_l[j+1]*sum(c_l[j+1,:])*h_l[j+1] - Vdot_l[j]*sum(c_l[j,:])*h_l[j] -Qdot_wall[j]+Edot_l_transfer[j] + Vdot_l_feed[j]*sum(c_l_feed[j,:])*h_l_feed[j] +Vdot_le[j-1]*sum(c_l[j-1,:])*h_l[j-1] - Vdot_le[j]*sum(c_l[j,:])*h_l[j] + Qdot_reac[j];
-     end for;
-    0 =sum(-Ndot_v_transfer[n,:].* delta_hv[n,:])+ Ndot_l_in*h_downStreamIn_act - Vdot_l[n]*sum(c_l[n,:])*h_l[n] - Qdot_wall[n] + Edot_l_transfer[n] + Vdot_l_feed[n]*sum(c_l_feed[n,:])*h_l_feed[n] + Vdot_le[n-1]*sum(c_l[n-1,:])*h_l[n-1]+ Qdot_reac[n];
-
-    0 =  Ndot_v_in*h_upStreamIn_act - Vdot_v[1]*sum(c_v[1,:])*h_v[1] +Edot_v_transfer[1]  + Vdot_v_feed[1]*sum(c_v_feed[1,:])*h_v_feed[1] + Ndot_source_startUp[1]*h_v[1];
-    for j in 2:n-1 loop
-    0  =Vdot_v[j-1] * sum(c_v[j-1,:])*propsVap[j-1].h  - Vdot_v[j]*sum(c_v[j,:])*h_v[j] +Edot_v_transfer[j] + Vdot_v_feed[j]*sum(c_v_feed[j,:])*h_v_feed[j]  + Ndot_source_startUp[j]*h_v[j];
-    end for;
-  0 = Vdot_v[n-1] * sum(c_v[n-1,:])*propsVap[n-1].h  -Ndot_v[n]*h_upStreamOut_act +Edot_v_transfer[n] + Vdot_v_feed[n]*sum(c_v_feed[n,:])*h_v_feed[n] + Ndot_source_startUp[n]*h_v[n];
-  end if;
-
-end BaseTwoPhaseSteadyState;
+within ThermalSeparation.BalanceEquations.Base.NonEquilibrium;
+
+model BaseTwoPhaseSteadyState "phases balanced seperately, steady state"
+  extends ThermalSeparation.BalanceEquations.Base.NonEquilibrium.BaseBalanceEquationsNonEq;
+  input SI.MolarInternalEnergy u_v[n](each stateSelect = StateSelect.default);
+  input SI.MolarInternalEnergy u_l[n](each stateSelect = StateSelect.default);
+protected
+  Real eps_liq_state[n] = eps_liq;
+  //(each stateSelect=StateSelect.prefer)=eps_liq;
+equation
+  stat = false;
+/*** MOLE BALANCES ***/
+  if n == 1 then
+// component balance for vapour
+    fill(0, nSV) = Ndot_v_in * x_upStreamIn_act - Ndot_v[n] * x_upStreamOut_act + Ndot_v_transfer[1, :] + Vdot_v_feed[1] * c_v_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :];
+// component balance for liquid
+    fill(0, nSL) = Ndot_l_in * x_downStreamIn_act - Ndot_l[1] * x_downStreamOut_act + Ndot_l_transfer[1, :] + Ndot_reac[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour
+//bool_eps[1]=false;
+    0 = Vdot_l_in * rho_l_in / MM_l_in - Vdot_l[1] * rho_l[1] / MM_l[1] + sum(Ndot_l_transfer[1, :]) + sum(Ndot_reac[1, :]) + Vdot_l_feed[1] * rho_l_feed[1] / MM_l_feed[1] - Vdot_le[1] * rho_l[1] / MM_l[1];
+//    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
+    0 = Vdot_v_in * rho_v_in / MM_v_in - Vdot_v[1] * rho_v[1] / MM_v[1] + sum(Ndot_v_transfer[1, :]) + Vdot_v_feed[1] * rho_v_feed[1] / MM_v_feed[1] + Ndot_source_startUp[1];
+  else
+/** Begin lowest stage (n=1) **/
+// component balance for vapour
+    fill(0, nSV) = Ndot_v_in * x_upStreamIn_act - Vdot_v[1] * c_v[1, :] + Ndot_v_transfer[1, :] + Vdot_v_feed[1] * c_v_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :];
+// component balance for liquid
+    fill(0, nSL) = Vdot_l[2] * c_l[2, :] - Ndot_l[1] * x_downStreamOut_act + Ndot_l_transfer[1, :] + Ndot_reac[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour
+//bool_eps[1]=false;
+    0 = Vdot_l[2] * rho_l[2] / MM_l[2] - Ndot_l[1] + sum(Ndot_l_transfer[1, :]) + sum(Ndot_reac[1, :]) + Vdot_l_feed[1] * rho_l_feed[1] / MM_l_feed[1] - Vdot_le[1] * rho_l[1] / MM_l[1];
+//    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l[2]*rho_l[2]/MM_l[2] -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
+    0 = Ndot_v_in - Vdot_v[1] * rho_v[1] / MM_v[1] + sum(Ndot_v_transfer[1, :]) + Vdot_v_feed[1] * rho_v_feed[1] / MM_v_feed[1] + Ndot_source_startUp[1];
+/** End lowest stage (n=1) **/
+/** Begin stages 2 to n-1 **/
+    for j in 2:n - 1 loop
+      for i in 1:nSV loop
+// component balance for vapour
+        0 = Vdot_v[j - 1] * c_v[j - 1, i] - Vdot_v[j] * c_v[j, i] + Ndot_v_transfer[j, i] + Vdot_v_feed[j] * c_v_feed[j, i] + Ndot_source_startUp[j] * x_v[j, i];
+      end for;
+      for i in 1:nSL loop
+// component balance for liquid
+        0 = Vdot_l[j + 1] * c_l[j + 1, i] - Vdot_l[j] * c_l[j, i] + Ndot_l_transfer[j, i] + Ndot_reac[j, i] + Vdot_l_feed[j] * c_l_feed[j, i] + Vdot_le[j - 1] * c_l[j - 1, i] - Vdot_le[j] * c_l[j, i];
+      end for;
+// total mole balance for liquid and vapour
+//bool_eps[j]=false;
+      0 = Vdot_l[j + 1] * rho_l[j + 1] / MM_l[j + 1] - Vdot_l[j] * rho_l[j] / MM_l[j] + sum(Ndot_l_transfer[j, :]) + sum(Ndot_reac[j, :]) + Vdot_l_feed[j] * rho_l_feed[j] / MM_l_feed[j] + Vdot_le[j - 1] * rho_l[j - 1] / MM_l[j - 1] - Vdot_le[j] * rho_l[j] / MM_l[j];
+//   A*H/n*eps* der(eps_liq[j]*rho_l[j]/MM_l[j]) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(reaction.Ndot[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
+      0 = Vdot_v[j - 1] * rho_v[j - 1] / MM_v[j - 1] - Vdot_v[j] * rho_v[j] / MM_v[j] + sum(Ndot_v_transfer[j, :]) + Vdot_v_feed[j] * rho_v_feed[j] / MM_v_feed[j] + Ndot_source_startUp[j];
+    end for;
+/** End stages 2 to n-1 **/
+/** Begin highest stage (n=n) **/
+// component balance for vapour
+    fill(0, nSV) = Vdot_v[n - 1] * c_v[n - 1, :] - Ndot_v[n] * x_upStreamOut_act + Ndot_v_transfer[n, :] + Vdot_v_feed[n] * c_v_feed[n, :] + Ndot_source_startUp[n] * x_v[n, :];
+// component balance for liquid
+    fill(0, nSL) = Ndot_l_in * x_downStreamIn_act - Vdot_l[n] * c_l[n, :] + Ndot_l_transfer[n, :] + Ndot_reac[n, :] + Vdot_l_feed[n] * c_l_feed[n, :] + Vdot_le[n - 1] * c_l[n - 1, :];
+// total mole balance for liquid and vapour
+// bool_eps[n]=false;
+    0 = Ndot_l_in - Vdot_l[n] * rho_l[n] / MM_l[n] + sum(Ndot_l_transfer[n, :]) + sum(Ndot_reac[n, :]) + Vdot_l_feed[n] * rho_l_feed[n] / MM_l_feed[n] + Vdot_le[n - 1] * rho_l[n - 1] / MM_l[n - 1];
+//   A*H/n*eps* der(eps_liq[n]*rho_l[n]/MM_l[n]) = Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(reaction.Ndot[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
+    0 = Vdot_v[n - 1] * rho_v[n - 1] / MM_v[n - 1] - Ndot_v[n] + sum(Ndot_v_transfer[n, :]) + Vdot_v_feed[n] * rho_v_feed[n] / MM_v_feed[n] + Ndot_source_startUp[n];
+/** End highest stage (n=n) **/
+  end if;
+/*** ENERGY BALANCE ***/
+  if n == 1 then
+    0 = sum(-Ndot_v_transfer[1, :] .* delta_hv[1, :]) + Ndot_l_in * h_downStreamIn_act - Ndot_l[1] * h_downStreamOut_act - Qdot_wall[1] + Edot_l_transfer[1] + Vdot_l_feed[1] * sum(c_l_feed[1, :]) * h_l_feed[1] - Vdot_le[1] * sum(c_l[1, :]) * h_l[1] + Qdot_reac[1];
+    0 = Ndot_v_in * h_upStreamIn_act - Ndot_v[n] * h_upStreamOut_act + Edot_v_transfer[1] + Vdot_v_feed[1] * sum(c_v_feed[1, :]) * h_v_feed[1] + Ndot_source_startUp[1] * h_v[1];
+  else
+    0 = sum(-Ndot_v_transfer[1, :] .* delta_hv[1, :]) + Vdot_l[2] * sum(c_l[2, :]) * h_l[2] - Ndot_l[1] * h_downStreamOut_act - Qdot_wall[1] + Edot_l_transfer[1] + Vdot_l_feed[1] * sum(c_l_feed[1, :]) * h_l_feed[1] - Vdot_le[1] * sum(c_l[1, :]) * h_l[1] + Qdot_reac[1];
+    for j in 2:n - 1 loop
+      0 = sum(-Ndot_v_transfer[j, :] .* delta_hv[j, :]) + Vdot_l[j + 1] * sum(c_l[j + 1, :]) * h_l[j + 1] - Vdot_l[j] * sum(c_l[j, :]) * h_l[j] - Qdot_wall[j] + Edot_l_transfer[j] + Vdot_l_feed[j] * sum(c_l_feed[j, :]) * h_l_feed[j] + Vdot_le[j - 1] * sum(c_l[j - 1, :]) * h_l[j - 1] - Vdot_le[j] * sum(c_l[j, :]) * h_l[j] + Qdot_reac[j];
+    end for;
+    0 = sum(-Ndot_v_transfer[n, :] .* delta_hv[n, :]) + Ndot_l_in * h_downStreamIn_act - Vdot_l[n] * sum(c_l[n, :]) * h_l[n] - Qdot_wall[n] + Edot_l_transfer[n] + Vdot_l_feed[n] * sum(c_l_feed[n, :]) * h_l_feed[n] + Vdot_le[n - 1] * sum(c_l[n - 1, :]) * h_l[n - 1] + Qdot_reac[n];
+    0 = Ndot_v_in * h_upStreamIn_act - Vdot_v[1] * sum(c_v[1, :]) * h_v[1] + Edot_v_transfer[1] + Vdot_v_feed[1] * sum(c_v_feed[1, :]) * h_v_feed[1] + Ndot_source_startUp[1] * h_v[1];
+    for j in 2:n - 1 loop
+      0 = Vdot_v[j - 1] * sum(c_v[j - 1, :]) * propsVap[j - 1].h - Vdot_v[j] * sum(c_v[j, :]) * h_v[j] + Edot_v_transfer[j] + Vdot_v_feed[j] * sum(c_v_feed[j, :]) * h_v_feed[j] + Ndot_source_startUp[j] * h_v[j];
+    end for;
+    0 = Vdot_v[n - 1] * sum(c_v[n - 1, :]) * propsVap[n - 1].h - Ndot_v[n] * h_upStreamOut_act + Edot_v_transfer[n] + Vdot_v_feed[n] * sum(c_v_feed[n, :]) * h_v_feed[n] + Ndot_source_startUp[n] * h_v[n];
+  end if;
+end BaseTwoPhaseSteadyState;
\ No newline at end of file
Only in converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium: BaseTwoPhaseSteadyState.mo.after
Only in converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium: BaseTwoPhaseSteadyState.mo.before
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseVarState.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseVarState.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseVarState.mo"	2022-03-10 09:57:37.904144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseVarState.mo"	2022-03-10 09:58:39.348151897 +0000
@@ -1,131 +1,110 @@
-within ThermalSeparation.BalanceEquations.Base.NonEquilibrium;
-model BaseTwoPhaseVarState "phases balanced seperately, states optional"
-
-extends
-    ThermalSeparation.BalanceEquations.Base.NonEquilibrium.BaseBalanceEquationsNonEq;
-
-  input SI.MolarInternalEnergy u_v[n](each stateSelect=StateSelect.default);
-  input SI.MolarInternalEnergy u_l[n](each stateSelect=StateSelect.default);
-
-protected
-  Real eps_liq_state[n]=eps_liq;//(each stateSelect=StateSelect.prefer)=eps_liq;
-
-equation
-stat=false;
-
-/*** MOLE BALANCES ***/
-
-//    if n == 1 then
-//      bool_eps[1] = if (eps_liq[1]<1e-5 and Vdot_l_in<1e-8) then true else false;
-//    else
-//      bool_eps[1] = if eps_liq[1]<1e-5 and Vdot_l[2]<1e-8 then true else false;
-//
-//      for j in 2:n-1 loop
-//        bool_eps[j] = if eps_liq[j]<1e-5 and Vdot_l[j+1]<1e-8 then true else false;
-//      end for;
-//      bool_eps[n] = if (eps_liq[n]<1e-5 and Vdot_l_in<1e-8) then true else false;
-//    end if;
-
-if n==1 then
-
-   // component balance for vapour
- A*H/n*eps* der(eps_vap[1]*c_v[1,:]) =  Ndot_v_in*x_upStreamIn_act  -Ndot_v[n]*x_upStreamOut_act + Ndot_v_transfer[1,:] + Vdot_v_feed[1]*c_v_feed[1,:] + Ndot_source_startUp[1] * x_v[1,:];
-    // component balance for liquid
- A*H/n*eps* der(eps_liq[1]*c_l[1,:]) = Ndot_l_in * x_downStreamIn_act  -Ndot_l[1]* x_downStreamOut_act + Ndot_l_transfer[1,:] + Ndot_reac[1,:] + Vdot_l_feed[1]*c_l_feed[1,:] - Vdot_le[1]*c_l[1,:];
-
-  // total mole balance for liquid and vapour
-   if eps_liq[1]<1e-5 and Vdot_l_in<1e-8 then
-       //bool_eps[1]=true;
-       der(eps_liq[1])=0;
-   else
-   //bool_eps[1]=false;
-    A*H/n*eps* der(eps_liq[1]/propsLiq[1].v) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-   //    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-   end if;
-       A*H/n*eps* der(eps_vap[1]*rho_v[1]/MM_v[1]) = Vdot_v_in*rho_v_in/MM_v_in -  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_v_transfer[1,:]) + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1] + Ndot_source_startUp[1];
-  else
-
-    /** Begin lowest stage (n=1) **/
-
-     // component balance for vapour
-    A*H/n*eps* der(eps_vap[1]*c_v[1,:]) = Ndot_v_in*x_upStreamIn_act - Vdot_v[1] * c_v[1,:] + Ndot_v_transfer[1,:] + Vdot_v_feed[1]*c_v_feed[1,:] + Ndot_source_startUp[1]*x_v[1,:];
-      // component balance for liquid
-      A*H/n*eps* der(eps_liq[1]*c_l[1,:]) = Vdot_l[2]*c_l[2,:]    -Ndot_l[1] * x_downStreamOut_act + Ndot_l_transfer[1,:] + Ndot_reac[1,:] + Vdot_l_feed[1]*c_l_feed[1,:] - Vdot_le[1]*c_l[1,:];
-
-    // total mole balance for liquid and vapour
-
-     if eps_liq[1]<1e-5 and Vdot_l[2]<1e-8 then
-      // bool_eps[1]=true;
-       der(eps_liq[1])=0;
-   else
-     //bool_eps[1]=false;
-      A*H/n*eps* der(eps_liq[1]/propsLiq[1].v) =  Vdot_l[2]*rho_l[2]/MM_l[2] -Ndot_l[1] + sum(Ndot_l_transfer[1,:]) + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-     //    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l[2]*rho_l[2]/MM_l[2] -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-     end if;
-          A*H/n*eps* der(eps_vap[1]*rho_v[1]/MM_v[1]) = Ndot_v_in -  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_v_transfer[1,:]) + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1] + Ndot_source_startUp[1];
-    /** End lowest stage (n=1) **/
-
-    /** Begin stages 2 to n-1 **/
-    for j in 2:n-1 loop
-      for i in 1:nSV loop
-       // component balance for vapour
-        A*H/n*eps* der(eps_vap[j]*c_v[j,i]) = Vdot_v[j-1]*c_v[j-1,i] - Vdot_v[j] * c_v[j,i] + Ndot_v_transfer[j,i] + Vdot_v_feed[j]*c_v_feed[j,i] + Ndot_source_startUp[j]*x_v[j,i];
-      end for;
-      for i in 1:nSL loop
-        // component balance for liquid
-        A*H/n*eps* der(eps_liq[j]*c_l[j,i]) = Vdot_l[j+1]*c_l[j+1,i] - Vdot_l[j] * c_l[j,i] + Ndot_l_transfer[j,i]+ Ndot_reac[j,i]+ Vdot_l_feed[j]*c_l_feed[j,i] + Vdot_le[j-1]*c_l[j-1,i] - Vdot_le[j]*c_l[j,i];
-      end for;
-     // total mole balance for liquid and vapour
-     if eps_liq[j]<1e-5 and Vdot_l[j+1]<1e-8 then
-       //bool_eps[j]=true;
-      der(eps_liq[j])=0;
-     else
-       //bool_eps[j]=false;
-     A*H/n*eps* der(eps_liq[j]/propsLiq[j].v) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(Ndot_reac[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
-     //   A*H/n*eps* der(eps_liq[j]*rho_l[j]/MM_l[j]) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(reaction.Ndot[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
-     end if;
-
-   A*H/n*eps* der(eps_vap[j]*rho_v[j]/MM_v[j]) = Vdot_v[j-1]*rho_v[j-1]/MM_v[j-1] -  Vdot_v[j]*rho_v[j]/MM_v[j]  + sum(Ndot_v_transfer[j,:])+ Vdot_v_feed[j]*rho_v_feed[j]/MM_v_feed[j] + Ndot_source_startUp[j];
-     end for;
-    /** End stages 2 to n-1 **/
-
-    /** Begin highest stage (n=n) **/
-
-     // component balance for vapour
-      A*H/n*eps* der(eps_vap[n]*c_v[n,:]) = Vdot_v[n-1]*c_v[n-1,:]  -Ndot_v[n]*x_upStreamOut_act + Ndot_v_transfer[n,:] + Vdot_v_feed[n]*c_v_feed[n,:]  + Ndot_source_startUp[n]*x_v[n,:];
-      // component balance for liquid
-     A*H/n*eps* der(eps_liq[n]*c_l[n,:]) = Ndot_l_in * x_downStreamIn_act - Vdot_l[n] * c_l[n,:] + Ndot_l_transfer[n,:]+ Ndot_reac[n,:] + Vdot_l_feed[n]*c_l_feed[n,:] + Vdot_le[n-1]*c_l[n-1,:];
-    // total mole balance for liquid and vapour
-
-     if eps_liq[n]<1e-5 and Vdot_l_in<1e-8 then
-       //bool_eps[n]=true;
-      der(eps_liq[n])=0;
-     else
-       //bool_eps[n]=false;
-     A*H/n*eps* der(eps_liq[n]/propsLiq[n].v) = Ndot_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(Ndot_reac[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
-     //   A*H/n*eps* der(eps_liq[n]*rho_l[n]/MM_l[n]) = Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(reaction.Ndot[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
-     end if;
-
-    A*H/n*eps* der(eps_vap[n]*rho_v[n]/MM_v[n]) = Vdot_v[n-1]*rho_v[n-1]/MM_v[n-1] -Ndot_v[n] + sum(Ndot_v_transfer[n,:])+ Vdot_v_feed[n]*rho_v_feed[n]/MM_v_feed[n] + Ndot_source_startUp[n];
-  /** End highest stage (n=n) **/
-  end if;
-
-/*** ENERGY BALANCE ***/
-  if n==1 then
-    A*H/n*eps * der(eps_liq[1]*sum(c_l[1,:])*u_l[1]) + A*H/n*(1-eps) * rho_solid[1]*c_solid*der(T[1]) =sum(-Ndot_v_transfer[1,:].* delta_hv[1,:])+ Ndot_l_in*h_downStreamIn_act   -Ndot_l[1]*h_downStreamOut_act  - Qdot_wall[1] + Edot_l_transfer[1]  + Vdot_l_feed[1]*sum(c_l_feed[1,:])*h_l_feed[1] - Vdot_le[1]*sum(c_l[1,:])*h_l[1] +Qdot_reac[1];
-    A*H/n*eps * der(eps_vap[1]*sum(c_v[1,:])*u_v[1])  = Ndot_v_in*h_upStreamIn_act   -Ndot_v[n]*h_upStreamOut_act +Edot_v_transfer[1]  + Vdot_v_feed[1]*sum(c_v_feed[1,:])*h_v_feed[1] + Ndot_source_startUp[1]*h_v[1];
-  else
-    A*H/n*eps * der(eps_liq[1]*sum(c_l[1,:])*u_l[1]) + A*H/n*(1-eps) * rho_solid[1]*c_solid*der(T[1]) = sum(-Ndot_v_transfer[1,:].* delta_hv[1,:])+Vdot_l[2]*sum(c_l[2,:])*h_l[2] -Ndot_l[1]*h_downStreamOut_act - Qdot_wall[1] + Edot_l_transfer[1]  + Vdot_l_feed[1]*sum(c_l_feed[1,:])*h_l_feed[1] - Vdot_le[1]*sum(c_l[1,:])*h_l[1] + Qdot_reac[1];
-      for j in 2:n-1 loop
-    A*H/n*eps * der(eps_liq[j]*sum(c_l[j,:])*u_l[j])  + A*H/n*(1-eps) * rho_solid[j]*c_solid*der(T[j]) = sum(-Ndot_v_transfer[j,:].* delta_hv[j,:])+  Vdot_l[j+1]*sum(c_l[j+1,:])*h_l[j+1] - Vdot_l[j]*sum(c_l[j,:])*h_l[j] -Qdot_wall[j]+Edot_l_transfer[j] + Vdot_l_feed[j]*sum(c_l_feed[j,:])*h_l_feed[j] +Vdot_le[j-1]*sum(c_l[j-1,:])*h_l[j-1] - Vdot_le[j]*sum(c_l[j,:])*h_l[j] + Qdot_reac[j];
-     end for;
-    A*H/n*eps * der(eps_liq[n]*sum(c_l[n,:])*u_l[n])  + A*H/n*(1-eps) * rho_solid[n]*c_solid*der(T[n]) =sum(-Ndot_v_transfer[n,:].* delta_hv[n,:])+ Ndot_l_in*h_downStreamIn_act - Vdot_l[n]*sum(c_l[n,:])*h_l[n] - Qdot_wall[n] + Edot_l_transfer[n] + Vdot_l_feed[n]*sum(c_l_feed[n,:])*h_l_feed[n] + Vdot_le[n-1]*sum(c_l[n-1,:])*h_l[n-1]+ Qdot_reac[n];
-
-    A*H/n*eps * der(eps_vap[1]*sum(c_v[1,:])*u_v[1])  =  Ndot_v_in*h_upStreamIn_act - Vdot_v[1]*sum(c_v[1,:])*h_v[1] +Edot_v_transfer[1]  + Vdot_v_feed[1]*sum(c_v_feed[1,:])*h_v_feed[1] + Ndot_source_startUp[1]*h_v[1];
-    for j in 2:n-1 loop
-    A*H/n*eps * der(eps_vap[j]*sum(c_v[j,:])*u_v[j])  =Vdot_v[j-1] * sum(c_v[j-1,:])*propsVap[j-1].h  - Vdot_v[j]*sum(c_v[j,:])*h_v[j] +Edot_v_transfer[j] + Vdot_v_feed[j]*sum(c_v_feed[j,:])*h_v_feed[j]  + Ndot_source_startUp[j]*h_v[j];
-    end for;
-  A*H/n*eps * der(eps_vap[n]*sum(c_v[n,:])*u_v[n]) = Vdot_v[n-1] * sum(c_v[n-1,:])*propsVap[n-1].h  -Ndot_v[n]*h_upStreamOut_act +Edot_v_transfer[n] + Vdot_v_feed[n]*sum(c_v_feed[n,:])*h_v_feed[n] + Ndot_source_startUp[n]*h_v[n];
-  end if;
-
-end BaseTwoPhaseVarState;
+within ThermalSeparation.BalanceEquations.Base.NonEquilibrium;
+
+model BaseTwoPhaseVarState "phases balanced seperately, states optional"
+  extends ThermalSeparation.BalanceEquations.Base.NonEquilibrium.BaseBalanceEquationsNonEq;
+  input SI.MolarInternalEnergy u_v[n](each stateSelect = StateSelect.default);
+  input SI.MolarInternalEnergy u_l[n](each stateSelect = StateSelect.default);
+protected
+  Real eps_liq_state[n] = eps_liq;
+  //(each stateSelect=StateSelect.prefer)=eps_liq;
+equation
+  stat = false;
+/*** MOLE BALANCES ***/
+//    if n == 1 then
+//      bool_eps[1] = if (eps_liq[1]<1e-5 and Vdot_l_in<1e-8) then true else false;
+//    else
+//      bool_eps[1] = if eps_liq[1]<1e-5 and Vdot_l[2]<1e-8 then true else false;
+//
+//      for j in 2:n-1 loop
+//        bool_eps[j] = if eps_liq[j]<1e-5 and Vdot_l[j+1]<1e-8 then true else false;
+//      end for;
+//      bool_eps[n] = if (eps_liq[n]<1e-5 and Vdot_l_in<1e-8) then true else false;
+//    end if;
+  if n == 1 then
+// component balance for vapour
+    A * H / n * eps * der(eps_vap[1] * c_v[1, :]) = Ndot_v_in * x_upStreamIn_act - Ndot_v[n] * x_upStreamOut_act + Ndot_v_transfer[1, :] + Vdot_v_feed[1] * c_v_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :];
+// component balance for liquid
+    A * H / n * eps * der(eps_liq[1] * c_l[1, :]) = Ndot_l_in * x_downStreamIn_act - Ndot_l[1] * x_downStreamOut_act + Ndot_l_transfer[1, :] + Ndot_reac[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour
+    if eps_liq[1] < 1e-5 and Vdot_l_in < 1e-8 then
+//bool_eps[1]=true;
+      der(eps_liq[1]) = 0;
+    else
+//bool_eps[1]=false;
+      A * H / n * eps * der(eps_liq[1] / propsLiq[1].v) = Vdot_l_in * rho_l_in / MM_l_in - Vdot_l[1] * rho_l[1] / MM_l[1] + sum(Ndot_l_transfer[1, :]) + sum(Ndot_reac[1, :]) + Vdot_l_feed[1] * rho_l_feed[1] / MM_l_feed[1] - Vdot_le[1] * rho_l[1] / MM_l[1];
+//    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
+    end if;
+    A * H / n * eps * der(eps_vap[1] * rho_v[1] / MM_v[1]) = Vdot_v_in * rho_v_in / MM_v_in - Vdot_v[1] * rho_v[1] / MM_v[1] + sum(Ndot_v_transfer[1, :]) + Vdot_v_feed[1] * rho_v_feed[1] / MM_v_feed[1] + Ndot_source_startUp[1];
+  else
+/** Begin lowest stage (n=1) **/
+// component balance for vapour
+    A * H / n * eps * der(eps_vap[1] * c_v[1, :]) = Ndot_v_in * x_upStreamIn_act - Vdot_v[1] * c_v[1, :] + Ndot_v_transfer[1, :] + Vdot_v_feed[1] * c_v_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :];
+// component balance for liquid
+    A * H / n * eps * der(eps_liq[1] * c_l[1, :]) = Vdot_l[2] * c_l[2, :] - Ndot_l[1] * x_downStreamOut_act + Ndot_l_transfer[1, :] + Ndot_reac[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour
+    if eps_liq[1] < 1e-5 and Vdot_l[2] < 1e-8 then
+// bool_eps[1]=true;
+      der(eps_liq[1]) = 0;
+    else
+//bool_eps[1]=false;
+      A * H / n * eps * der(eps_liq[1] / propsLiq[1].v) = Vdot_l[2] * rho_l[2] / MM_l[2] - Ndot_l[1] + sum(Ndot_l_transfer[1, :]) + sum(Ndot_reac[1, :]) + Vdot_l_feed[1] * rho_l_feed[1] / MM_l_feed[1] - Vdot_le[1] * rho_l[1] / MM_l[1];
+//    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l[2]*rho_l[2]/MM_l[2] -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
+    end if;
+    A * H / n * eps * der(eps_vap[1] * rho_v[1] / MM_v[1]) = Ndot_v_in - Vdot_v[1] * rho_v[1] / MM_v[1] + sum(Ndot_v_transfer[1, :]) + Vdot_v_feed[1] * rho_v_feed[1] / MM_v_feed[1] + Ndot_source_startUp[1];
+/** End lowest stage (n=1) **/
+/** Begin stages 2 to n-1 **/
+    for j in 2:n - 1 loop
+      for i in 1:nSV loop
+// component balance for vapour
+        A * H / n * eps * der(eps_vap[j] * c_v[j, i]) = Vdot_v[j - 1] * c_v[j - 1, i] - Vdot_v[j] * c_v[j, i] + Ndot_v_transfer[j, i] + Vdot_v_feed[j] * c_v_feed[j, i] + Ndot_source_startUp[j] * x_v[j, i];
+      end for;
+      for i in 1:nSL loop
+// component balance for liquid
+        A * H / n * eps * der(eps_liq[j] * c_l[j, i]) = Vdot_l[j + 1] * c_l[j + 1, i] - Vdot_l[j] * c_l[j, i] + Ndot_l_transfer[j, i] + Ndot_reac[j, i] + Vdot_l_feed[j] * c_l_feed[j, i] + Vdot_le[j - 1] * c_l[j - 1, i] - Vdot_le[j] * c_l[j, i];
+      end for;
+// total mole balance for liquid and vapour
+      if eps_liq[j] < 1e-5 and Vdot_l[j + 1] < 1e-8 then
+//bool_eps[j]=true;
+        der(eps_liq[j]) = 0;
+      else
+//bool_eps[j]=false;
+        A * H / n * eps * der(eps_liq[j] / propsLiq[j].v) = Vdot_l[j + 1] * rho_l[j + 1] / MM_l[j + 1] - Vdot_l[j] * rho_l[j] / MM_l[j] + sum(Ndot_l_transfer[j, :]) + sum(Ndot_reac[j, :]) + Vdot_l_feed[j] * rho_l_feed[j] / MM_l_feed[j] + Vdot_le[j - 1] * rho_l[j - 1] / MM_l[j - 1] - Vdot_le[j] * rho_l[j] / MM_l[j];
+//   A*H/n*eps* der(eps_liq[j]*rho_l[j]/MM_l[j]) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(reaction.Ndot[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
+      end if;
+      A * H / n * eps * der(eps_vap[j] * rho_v[j] / MM_v[j]) = Vdot_v[j - 1] * rho_v[j - 1] / MM_v[j - 1] - Vdot_v[j] * rho_v[j] / MM_v[j] + sum(Ndot_v_transfer[j, :]) + Vdot_v_feed[j] * rho_v_feed[j] / MM_v_feed[j] + Ndot_source_startUp[j];
+    end for;
+/** End stages 2 to n-1 **/
+/** Begin highest stage (n=n) **/
+// component balance for vapour
+    A * H / n * eps * der(eps_vap[n] * c_v[n, :]) = Vdot_v[n - 1] * c_v[n - 1, :] - Ndot_v[n] * x_upStreamOut_act + Ndot_v_transfer[n, :] + Vdot_v_feed[n] * c_v_feed[n, :] + Ndot_source_startUp[n] * x_v[n, :];
+// component balance for liquid
+    A * H / n * eps * der(eps_liq[n] * c_l[n, :]) = Ndot_l_in * x_downStreamIn_act - Vdot_l[n] * c_l[n, :] + Ndot_l_transfer[n, :] + Ndot_reac[n, :] + Vdot_l_feed[n] * c_l_feed[n, :] + Vdot_le[n - 1] * c_l[n - 1, :];
+// total mole balance for liquid and vapour
+    if eps_liq[n] < 1e-5 and Vdot_l_in < 1e-8 then
+//bool_eps[n]=true;
+      der(eps_liq[n]) = 0;
+    else
+//bool_eps[n]=false;
+      A * H / n * eps * der(eps_liq[n] / propsLiq[n].v) = Ndot_l_in - Vdot_l[n] * rho_l[n] / MM_l[n] + sum(Ndot_l_transfer[n, :]) + sum(Ndot_reac[n, :]) + Vdot_l_feed[n] * rho_l_feed[n] / MM_l_feed[n] + Vdot_le[n - 1] * rho_l[n - 1] / MM_l[n - 1];
+//   A*H/n*eps* der(eps_liq[n]*rho_l[n]/MM_l[n]) = Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(reaction.Ndot[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
+    end if;
+    A * H / n * eps * der(eps_vap[n] * rho_v[n] / MM_v[n]) = Vdot_v[n - 1] * rho_v[n - 1] / MM_v[n - 1] - Ndot_v[n] + sum(Ndot_v_transfer[n, :]) + Vdot_v_feed[n] * rho_v_feed[n] / MM_v_feed[n] + Ndot_source_startUp[n];
+/** End highest stage (n=n) **/
+  end if;
+/*** ENERGY BALANCE ***/
+  if n == 1 then
+    A * H / n * eps * der(eps_liq[1] * sum(c_l[1, :]) * u_l[1]) + A * H / n * (1 - eps) * rho_solid[1] * c_solid * der(T[1]) = sum(-Ndot_v_transfer[1, :] .* delta_hv[1, :]) + Ndot_l_in * h_downStreamIn_act - Ndot_l[1] * h_downStreamOut_act - Qdot_wall[1] + Edot_l_transfer[1] + Vdot_l_feed[1] * sum(c_l_feed[1, :]) * h_l_feed[1] - Vdot_le[1] * sum(c_l[1, :]) * h_l[1] + Qdot_reac[1];
+    A * H / n * eps * der(eps_vap[1] * sum(c_v[1, :]) * u_v[1]) = Ndot_v_in * h_upStreamIn_act - Ndot_v[n] * h_upStreamOut_act + Edot_v_transfer[1] + Vdot_v_feed[1] * sum(c_v_feed[1, :]) * h_v_feed[1] + Ndot_source_startUp[1] * h_v[1];
+  else
+    A * H / n * eps * der(eps_liq[1] * sum(c_l[1, :]) * u_l[1]) + A * H / n * (1 - eps) * rho_solid[1] * c_solid * der(T[1]) = sum(-Ndot_v_transfer[1, :] .* delta_hv[1, :]) + Vdot_l[2] * sum(c_l[2, :]) * h_l[2] - Ndot_l[1] * h_downStreamOut_act - Qdot_wall[1] + Edot_l_transfer[1] + Vdot_l_feed[1] * sum(c_l_feed[1, :]) * h_l_feed[1] - Vdot_le[1] * sum(c_l[1, :]) * h_l[1] + Qdot_reac[1];
+    for j in 2:n - 1 loop
+      A * H / n * eps * der(eps_liq[j] * sum(c_l[j, :]) * u_l[j]) + A * H / n * (1 - eps) * rho_solid[j] * c_solid * der(T[j]) = sum(-Ndot_v_transfer[j, :] .* delta_hv[j, :]) + Vdot_l[j + 1] * sum(c_l[j + 1, :]) * h_l[j + 1] - Vdot_l[j] * sum(c_l[j, :]) * h_l[j] - Qdot_wall[j] + Edot_l_transfer[j] + Vdot_l_feed[j] * sum(c_l_feed[j, :]) * h_l_feed[j] + Vdot_le[j - 1] * sum(c_l[j - 1, :]) * h_l[j - 1] - Vdot_le[j] * sum(c_l[j, :]) * h_l[j] + Qdot_reac[j];
+    end for;
+    A * H / n * eps * der(eps_liq[n] * sum(c_l[n, :]) * u_l[n]) + A * H / n * (1 - eps) * rho_solid[n] * c_solid * der(T[n]) = sum(-Ndot_v_transfer[n, :] .* delta_hv[n, :]) + Ndot_l_in * h_downStreamIn_act - Vdot_l[n] * sum(c_l[n, :]) * h_l[n] - Qdot_wall[n] + Edot_l_transfer[n] + Vdot_l_feed[n] * sum(c_l_feed[n, :]) * h_l_feed[n] + Vdot_le[n - 1] * sum(c_l[n - 1, :]) * h_l[n - 1] + Qdot_reac[n];
+    A * H / n * eps * der(eps_vap[1] * sum(c_v[1, :]) * u_v[1]) = Ndot_v_in * h_upStreamIn_act - Vdot_v[1] * sum(c_v[1, :]) * h_v[1] + Edot_v_transfer[1] + Vdot_v_feed[1] * sum(c_v_feed[1, :]) * h_v_feed[1] + Ndot_source_startUp[1] * h_v[1];
+    for j in 2:n - 1 loop
+      A * H / n * eps * der(eps_vap[j] * sum(c_v[j, :]) * u_v[j]) = Vdot_v[j - 1] * sum(c_v[j - 1, :]) * propsVap[j - 1].h - Vdot_v[j] * sum(c_v[j, :]) * h_v[j] + Edot_v_transfer[j] + Vdot_v_feed[j] * sum(c_v_feed[j, :]) * h_v_feed[j] + Ndot_source_startUp[j] * h_v[j];
+    end for;
+    A * H / n * eps * der(eps_vap[n] * sum(c_v[n, :]) * u_v[n]) = Vdot_v[n - 1] * sum(c_v[n - 1, :]) * propsVap[n - 1].h - Ndot_v[n] * h_upStreamOut_act + Edot_v_transfer[n] + Vdot_v_feed[n] * sum(c_v_feed[n, :]) * h_v_feed[n] + Ndot_source_startUp[n] * h_v[n];
+  end if;
+end BaseTwoPhaseVarState;
\ No newline at end of file
Only in converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium: BaseTwoPhaseVarState.mo.after
Only in converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium: BaseTwoPhaseVarState.mo.before
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseVarStateFixEps.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseVarStateFixEps.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseVarStateFixEps.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium/BaseTwoPhaseVarStateFixEps.mo"	2022-03-10 09:58:39.304151892 +0000
@@ -1,129 +1,109 @@
-within ThermalSeparation.BalanceEquations.Base.NonEquilibrium;
-model BaseTwoPhaseVarStateFixEps
-  "phases balanced seperately, states optional, eps_liq fixed"
-
-extends
-    ThermalSeparation.BalanceEquations.Base.NonEquilibrium.BaseBalanceEquationsNonEq;
-
-  input SI.MolarInternalEnergy u_v[n](stateSelect=StateSelect.default);
-  input SI.MolarInternalEnergy u_l[n](stateSelect=StateSelect.default);
-  parameter Real eps_liq_user=0.28;
-
-protected
-  Real eps_liq_state[n]=eps_liq;//( stateSelect=StateSelect.prefer)=eps_liq;
-
-equation
-stat=false;
-
-/*** MOLE BALANCES ***/
-if n==1 then
-
-   // component balance for vapour
- A*H/n*eps* der(eps_vap[1]*c_v[1,:]) =  Ndot_v_in*x_upStreamIn_act  -Ndot_v[n]*x_upStreamOut_act + Ndot_v_transfer[1,:] + Vdot_v_feed[1]*c_v_feed[1,:] + Ndot_source_startUp[1] * x_v[1,:];
-    // component balance for liquid
- A*H/n*eps* der(eps_liq[1]*c_l[1,:]) = Ndot_l_in * x_downStreamIn_act  -Ndot_l[1]* x_downStreamOut_act + Ndot_l_transfer[1,:] + Ndot_reac[1,:] + Vdot_l_feed[1]*c_l_feed[1,:] - Vdot_le[1]*c_l[1,:];
-
-  // total mole balance for liquid and vapour
-   if eps_liq[1]<1e-5 and Vdot_l_in<1e-8 then
-       //bool_eps[1]=true;
-       // der(eps_liq[1])=0;
-       eps_liq[1]=eps_liq_user;
-   else
-   //bool_eps[1]=false;
-   eps_liq[1]=eps_liq_user;
-   // A*H/n*eps* der(eps_liq[1]/propsLiq[1].v) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-   //    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-   end if;
-       A*H/n*eps* der(eps_vap[1]*rho_v[1]/MM_v[1]) = Vdot_v_in*rho_v_in/MM_v_in -  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_v_transfer[1,:]) + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1] + Ndot_source_startUp[1];
-  else
-
-    /** Begin lowest stage (n=1) **/
-
-     // component balance for vapour
-    A*H/n*eps* der(eps_vap[1]*c_v[1,:]) = Ndot_v_in*x_upStreamIn_act - Vdot_v[1] * c_v[1,:] + Ndot_v_transfer[1,:] + Vdot_v_feed[1]*c_v_feed[1,:] + Ndot_source_startUp[1]*x_v[1,:];
-      // component balance for liquid
-      A*H/n*eps* der(eps_liq[1]*c_l[1,:]) = Vdot_l[2]*c_l[2,:]    -Ndot_l[1] * x_downStreamOut_act + Ndot_l_transfer[1,:] + Ndot_reac[1,:] + Vdot_l_feed[1]*c_l_feed[1,:] - Vdot_le[1]*c_l[1,:];
-
-    // total mole balance for liquid and vapour
-
-     if eps_liq[1]<1e-5 and Vdot_l[2]<1e-8 then
-       //bool_eps[1]=true;
-       // der(eps_liq[1])=0;
-       eps_liq[1]=eps_liq_user;
-   else
-     //bool_eps[1]=false;
-     eps_liq[1]=eps_liq_user;
-     // A*H/n*eps* der(eps_liq[1]/propsLiq[1].v) =  Vdot_l[2]*rho_l[2]/MM_l[2] -Ndot_l[1] + sum(Ndot_l_transfer[1,:]) + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-     //    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l[2]*rho_l[2]/MM_l[2] -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-     end if;
-          A*H/n*eps* der(eps_vap[1]*rho_v[1]/MM_v[1]) = Ndot_v_in -  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_v_transfer[1,:]) + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1] + Ndot_source_startUp[1];
-    /** End lowest stage (n=1) **/
-
-    /** Begin stages 2 to n-1 **/
-    for j in 2:n-1 loop
-      for i in 1:nSV loop
-       // component balance for vapour
-        A*H/n*eps* der(eps_vap[j]*c_v[j,i]) = Vdot_v[j-1]*c_v[j-1,i] - Vdot_v[j] * c_v[j,i] + Ndot_v_transfer[j,i] + Vdot_v_feed[j]*c_v_feed[j,i] + Ndot_source_startUp[j]*x_v[j,i];
-      end for;
-      for i in 1:nSL loop
-        // component balance for liquid
-        A*H/n*eps* der(eps_liq[j]*c_l[j,i]) = Vdot_l[j+1]*c_l[j+1,i] - Vdot_l[j] * c_l[j,i] + Ndot_l_transfer[j,i]+ Ndot_reac[j,i]+ Vdot_l_feed[j]*c_l_feed[j,i] + Vdot_le[j-1]*c_l[j-1,i] - Vdot_le[j]*c_l[j,i];
-      end for;
-     // total mole balance for liquid and vapour
-     if eps_liq[j]<1e-5 and Vdot_l[j+1]<1e-8 then
-       bool_eps[j]=true;
-      // der(eps_liq[j])=0;
-      eps_liq[j]=eps_liq_user;
-     else
-       bool_eps[j]=false;
-     eps_liq[j]=eps_liq_user;
-     // A*H/n*eps* der(eps_liq[j]/propsLiq[j].v) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(Ndot_reac[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
-     //   A*H/n*eps* der(eps_liq[j]*rho_l[j]/MM_l[j]) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(reaction.Ndot[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
-     end if;
-
-   A*H/n*eps* der(eps_vap[j]*rho_v[j]/MM_v[j]) = Vdot_v[j-1]*rho_v[j-1]/MM_v[j-1] -  Vdot_v[j]*rho_v[j]/MM_v[j]  + sum(Ndot_v_transfer[j,:])+ Vdot_v_feed[j]*rho_v_feed[j]/MM_v_feed[j] + Ndot_source_startUp[j];
-     end for;
-    /** End stages 2 to n-1 **/
-
-    /** Begin highest stage (n=n) **/
-
-     // component balance for vapour
-      A*H/n*eps* der(eps_vap[n]*c_v[n,:]) = Vdot_v[n-1]*c_v[n-1,:]  -Ndot_v[n]*x_upStreamOut_act + Ndot_v_transfer[n,:] + Vdot_v_feed[n]*c_v_feed[n,:]  + Ndot_source_startUp[n]*x_v[n,:];
-      // component balance for liquid
-     A*H/n*eps* der(eps_liq[n]*c_l[n,:]) = Ndot_l_in * x_downStreamIn_act - Vdot_l[n] * c_l[n,:] + Ndot_l_transfer[n,:]+ Ndot_reac[n,:] + Vdot_l_feed[n]*c_l_feed[n,:] + Vdot_le[n-1]*c_l[n-1,:];
-    // total mole balance for liquid and vapour
-
-     if eps_liq[n]<1e-5 and Vdot_l_in<1e-8 then
-       bool_eps[n]=true;
-      // der(eps_liq[n])=0;
-      eps_liq[n]=eps_liq_user;
-     else
-       bool_eps[n]=false;
-     eps_liq[n]=eps_liq_user;
-     // A*H/n*eps* der(eps_liq[n]/propsLiq[n].v) = Ndot_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(Ndot_reac[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
-     //   A*H/n*eps* der(eps_liq[n]*rho_l[n]/MM_l[n]) = Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(reaction.Ndot[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
-     end if;
-
-    A*H/n*eps* der(eps_vap[n]*rho_v[n]/MM_v[n]) = Vdot_v[n-1]*rho_v[n-1]/MM_v[n-1] -Ndot_v[n] + sum(Ndot_v_transfer[n,:])+ Vdot_v_feed[n]*rho_v_feed[n]/MM_v_feed[n] + Ndot_source_startUp[n];
-  /** End highest stage (n=n) **/
-  end if;
-
-/*** ENERGY BALANCE ***/
-  if n==1 then
-    A*H/n*eps * der(eps_liq[1]*sum(c_l[1,:])*u_l[1]) + A*H/n*(1-eps) * rho_solid[1]*c_solid*der(T[1]) =sum(-Ndot_v_transfer[1,:].* delta_hv[1,:])+ Ndot_l_in*h_downStreamIn_act   -Ndot_l[1]*h_downStreamOut_act  - Qdot_wall[1] + Edot_l_transfer[1]  + Vdot_l_feed[1]*sum(c_l_feed[1,:])*h_l_feed[1] - Vdot_le[1]*sum(c_l[1,:])*h_l[1] +Qdot_reac[1];
-    A*H/n*eps * der(eps_vap[1]*sum(c_v[1,:])*u_v[1])  = Ndot_v_in*h_upStreamIn_act   -Ndot_v[n]*h_upStreamOut_act +Edot_v_transfer[1]  + Vdot_v_feed[1]*sum(c_v_feed[1,:])*h_v_feed[1] + Ndot_source_startUp[1]*h_v[1];
-  else
-    A*H/n*eps * der(eps_liq[1]*sum(c_l[1,:])*u_l[1]) + A*H/n*(1-eps) * rho_solid[1]*c_solid*der(T[1]) = sum(-Ndot_v_transfer[1,:].* delta_hv[1,:])+Vdot_l[2]*sum(c_l[2,:])*h_l[2] -Ndot_l[1]*h_downStreamOut_act - Qdot_wall[1] + Edot_l_transfer[1]  + Vdot_l_feed[1]*sum(c_l_feed[1,:])*h_l_feed[1] - Vdot_le[1]*sum(c_l[1,:])*h_l[1] + Qdot_reac[1];
-      for j in 2:n-1 loop
-    A*H/n*eps * der(eps_liq[j]*sum(c_l[j,:])*u_l[j])  + A*H/n*(1-eps) * rho_solid[j]*c_solid*der(T[j]) = sum(-Ndot_v_transfer[j,:].* delta_hv[j,:])+  Vdot_l[j+1]*sum(c_l[j+1,:])*h_l[j+1] - Vdot_l[j]*sum(c_l[j,:])*h_l[j] -Qdot_wall[j]+Edot_l_transfer[j] + Vdot_l_feed[j]*sum(c_l_feed[j,:])*h_l_feed[j] +Vdot_le[j-1]*sum(c_l[j-1,:])*h_l[j-1] - Vdot_le[j]*sum(c_l[j,:])*h_l[j] + Qdot_reac[j];
-     end for;
-    A*H/n*eps * der(eps_liq[n]*sum(c_l[n,:])*u_l[n])  + A*H/n*(1-eps) * rho_solid[n]*c_solid*der(T[n]) =sum(-Ndot_v_transfer[n,:].* delta_hv[n,:])+ Ndot_l_in*h_downStreamIn_act - Vdot_l[n]*sum(c_l[n,:])*h_l[n] - Qdot_wall[n] + Edot_l_transfer[n] + Vdot_l_feed[n]*sum(c_l_feed[n,:])*h_l_feed[n] + Vdot_le[n-1]*sum(c_l[n-1,:])*h_l[n-1]+ Qdot_reac[n];
-
-    A*H/n*eps * der(eps_vap[1]*sum(c_v[1,:])*u_v[1])  =  Ndot_v_in*h_upStreamIn_act - Vdot_v[1]*sum(c_v[1,:])*h_v[1] +Edot_v_transfer[1]  + Vdot_v_feed[1]*sum(c_v_feed[1,:])*h_v_feed[1] + Ndot_source_startUp[1]*h_v[1];
-    for j in 2:n-1 loop
-    A*H/n*eps * der(eps_vap[j]*sum(c_v[j,:])*u_v[j])  =Vdot_v[j-1] * sum(c_v[j-1,:])*propsVap[j-1].h  - Vdot_v[j]*sum(c_v[j,:])*h_v[j] +Edot_v_transfer[j] + Vdot_v_feed[j]*sum(c_v_feed[j,:])*h_v_feed[j]  + Ndot_source_startUp[j]*h_v[j];
-    end for;
-  A*H/n*eps * der(eps_vap[n]*sum(c_v[n,:])*u_v[n]) = Vdot_v[n-1] * sum(c_v[n-1,:])*propsVap[n-1].h  -Ndot_v[n]*h_upStreamOut_act +Edot_v_transfer[n] + Vdot_v_feed[n]*sum(c_v_feed[n,:])*h_v_feed[n] + Ndot_source_startUp[n]*h_v[n];
-  end if;
-
-end BaseTwoPhaseVarStateFixEps;
+within ThermalSeparation.BalanceEquations.Base.NonEquilibrium;
+
+model BaseTwoPhaseVarStateFixEps "phases balanced seperately, states optional, eps_liq fixed"
+  extends ThermalSeparation.BalanceEquations.Base.NonEquilibrium.BaseBalanceEquationsNonEq;
+  input SI.MolarInternalEnergy u_v[n](stateSelect = StateSelect.default);
+  input SI.MolarInternalEnergy u_l[n](stateSelect = StateSelect.default);
+  parameter Real eps_liq_user = 0.28;
+protected
+  Real eps_liq_state[n] = eps_liq;
+  //( stateSelect=StateSelect.prefer)=eps_liq;
+equation
+  stat = false;
+/*** MOLE BALANCES ***/
+  if n == 1 then
+// component balance for vapour
+    A * H / n * eps * der(eps_vap[1] * c_v[1, :]) = Ndot_v_in * x_upStreamIn_act - Ndot_v[n] * x_upStreamOut_act + Ndot_v_transfer[1, :] + Vdot_v_feed[1] * c_v_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :];
+// component balance for liquid
+    A * H / n * eps * der(eps_liq[1] * c_l[1, :]) = Ndot_l_in * x_downStreamIn_act - Ndot_l[1] * x_downStreamOut_act + Ndot_l_transfer[1, :] + Ndot_reac[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour
+    if eps_liq[1] < 1e-5 and Vdot_l_in < 1e-8 then
+//bool_eps[1]=true;
+// der(eps_liq[1])=0;
+      eps_liq[1] = eps_liq_user;
+    else
+//bool_eps[1]=false;
+      eps_liq[1] = eps_liq_user;
+// A*H/n*eps* der(eps_liq[1]/propsLiq[1].v) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
+//    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
+    end if;
+    A * H / n * eps * der(eps_vap[1] * rho_v[1] / MM_v[1]) = Vdot_v_in * rho_v_in / MM_v_in - Vdot_v[1] * rho_v[1] / MM_v[1] + sum(Ndot_v_transfer[1, :]) + Vdot_v_feed[1] * rho_v_feed[1] / MM_v_feed[1] + Ndot_source_startUp[1];
+  else
+/** Begin lowest stage (n=1) **/
+// component balance for vapour
+    A * H / n * eps * der(eps_vap[1] * c_v[1, :]) = Ndot_v_in * x_upStreamIn_act - Vdot_v[1] * c_v[1, :] + Ndot_v_transfer[1, :] + Vdot_v_feed[1] * c_v_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :];
+// component balance for liquid
+    A * H / n * eps * der(eps_liq[1] * c_l[1, :]) = Vdot_l[2] * c_l[2, :] - Ndot_l[1] * x_downStreamOut_act + Ndot_l_transfer[1, :] + Ndot_reac[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour
+    if eps_liq[1] < 1e-5 and Vdot_l[2] < 1e-8 then
+//bool_eps[1]=true;
+// der(eps_liq[1])=0;
+      eps_liq[1] = eps_liq_user;
+    else
+//bool_eps[1]=false;
+      eps_liq[1] = eps_liq_user;
+// A*H/n*eps* der(eps_liq[1]/propsLiq[1].v) =  Vdot_l[2]*rho_l[2]/MM_l[2] -Ndot_l[1] + sum(Ndot_l_transfer[1,:]) + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
+//    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l[2]*rho_l[2]/MM_l[2] -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
+    end if;
+    A * H / n * eps * der(eps_vap[1] * rho_v[1] / MM_v[1]) = Ndot_v_in - Vdot_v[1] * rho_v[1] / MM_v[1] + sum(Ndot_v_transfer[1, :]) + Vdot_v_feed[1] * rho_v_feed[1] / MM_v_feed[1] + Ndot_source_startUp[1];
+/** End lowest stage (n=1) **/
+/** Begin stages 2 to n-1 **/
+    for j in 2:n - 1 loop
+      for i in 1:nSV loop
+// component balance for vapour
+        A * H / n * eps * der(eps_vap[j] * c_v[j, i]) = Vdot_v[j - 1] * c_v[j - 1, i] - Vdot_v[j] * c_v[j, i] + Ndot_v_transfer[j, i] + Vdot_v_feed[j] * c_v_feed[j, i] + Ndot_source_startUp[j] * x_v[j, i];
+      end for;
+      for i in 1:nSL loop
+// component balance for liquid
+        A * H / n * eps * der(eps_liq[j] * c_l[j, i]) = Vdot_l[j + 1] * c_l[j + 1, i] - Vdot_l[j] * c_l[j, i] + Ndot_l_transfer[j, i] + Ndot_reac[j, i] + Vdot_l_feed[j] * c_l_feed[j, i] + Vdot_le[j - 1] * c_l[j - 1, i] - Vdot_le[j] * c_l[j, i];
+      end for;
+// total mole balance for liquid and vapour
+      if eps_liq[j] < 1e-5 and Vdot_l[j + 1] < 1e-8 then
+        bool_eps[j] = true;
+// der(eps_liq[j])=0;
+        eps_liq[j] = eps_liq_user;
+      else
+        bool_eps[j] = false;
+        eps_liq[j] = eps_liq_user;
+// A*H/n*eps* der(eps_liq[j]/propsLiq[j].v) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(Ndot_reac[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
+//   A*H/n*eps* der(eps_liq[j]*rho_l[j]/MM_l[j]) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(reaction.Ndot[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
+      end if;
+      A * H / n * eps * der(eps_vap[j] * rho_v[j] / MM_v[j]) = Vdot_v[j - 1] * rho_v[j - 1] / MM_v[j - 1] - Vdot_v[j] * rho_v[j] / MM_v[j] + sum(Ndot_v_transfer[j, :]) + Vdot_v_feed[j] * rho_v_feed[j] / MM_v_feed[j] + Ndot_source_startUp[j];
+    end for;
+/** End stages 2 to n-1 **/
+/** Begin highest stage (n=n) **/
+// component balance for vapour
+    A * H / n * eps * der(eps_vap[n] * c_v[n, :]) = Vdot_v[n - 1] * c_v[n - 1, :] - Ndot_v[n] * x_upStreamOut_act + Ndot_v_transfer[n, :] + Vdot_v_feed[n] * c_v_feed[n, :] + Ndot_source_startUp[n] * x_v[n, :];
+// component balance for liquid
+    A * H / n * eps * der(eps_liq[n] * c_l[n, :]) = Ndot_l_in * x_downStreamIn_act - Vdot_l[n] * c_l[n, :] + Ndot_l_transfer[n, :] + Ndot_reac[n, :] + Vdot_l_feed[n] * c_l_feed[n, :] + Vdot_le[n - 1] * c_l[n - 1, :];
+// total mole balance for liquid and vapour
+    if eps_liq[n] < 1e-5 and Vdot_l_in < 1e-8 then
+      bool_eps[n] = true;
+// der(eps_liq[n])=0;
+      eps_liq[n] = eps_liq_user;
+    else
+      bool_eps[n] = false;
+      eps_liq[n] = eps_liq_user;
+// A*H/n*eps* der(eps_liq[n]/propsLiq[n].v) = Ndot_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(Ndot_reac[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
+//   A*H/n*eps* der(eps_liq[n]*rho_l[n]/MM_l[n]) = Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(reaction.Ndot[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
+    end if;
+    A * H / n * eps * der(eps_vap[n] * rho_v[n] / MM_v[n]) = Vdot_v[n - 1] * rho_v[n - 1] / MM_v[n - 1] - Ndot_v[n] + sum(Ndot_v_transfer[n, :]) + Vdot_v_feed[n] * rho_v_feed[n] / MM_v_feed[n] + Ndot_source_startUp[n];
+/** End highest stage (n=n) **/
+  end if;
+/*** ENERGY BALANCE ***/
+  if n == 1 then
+    A * H / n * eps * der(eps_liq[1] * sum(c_l[1, :]) * u_l[1]) + A * H / n * (1 - eps) * rho_solid[1] * c_solid * der(T[1]) = sum(-Ndot_v_transfer[1, :] .* delta_hv[1, :]) + Ndot_l_in * h_downStreamIn_act - Ndot_l[1] * h_downStreamOut_act - Qdot_wall[1] + Edot_l_transfer[1] + Vdot_l_feed[1] * sum(c_l_feed[1, :]) * h_l_feed[1] - Vdot_le[1] * sum(c_l[1, :]) * h_l[1] + Qdot_reac[1];
+    A * H / n * eps * der(eps_vap[1] * sum(c_v[1, :]) * u_v[1]) = Ndot_v_in * h_upStreamIn_act - Ndot_v[n] * h_upStreamOut_act + Edot_v_transfer[1] + Vdot_v_feed[1] * sum(c_v_feed[1, :]) * h_v_feed[1] + Ndot_source_startUp[1] * h_v[1];
+  else
+    A * H / n * eps * der(eps_liq[1] * sum(c_l[1, :]) * u_l[1]) + A * H / n * (1 - eps) * rho_solid[1] * c_solid * der(T[1]) = sum(-Ndot_v_transfer[1, :] .* delta_hv[1, :]) + Vdot_l[2] * sum(c_l[2, :]) * h_l[2] - Ndot_l[1] * h_downStreamOut_act - Qdot_wall[1] + Edot_l_transfer[1] + Vdot_l_feed[1] * sum(c_l_feed[1, :]) * h_l_feed[1] - Vdot_le[1] * sum(c_l[1, :]) * h_l[1] + Qdot_reac[1];
+    for j in 2:n - 1 loop
+      A * H / n * eps * der(eps_liq[j] * sum(c_l[j, :]) * u_l[j]) + A * H / n * (1 - eps) * rho_solid[j] * c_solid * der(T[j]) = sum(-Ndot_v_transfer[j, :] .* delta_hv[j, :]) + Vdot_l[j + 1] * sum(c_l[j + 1, :]) * h_l[j + 1] - Vdot_l[j] * sum(c_l[j, :]) * h_l[j] - Qdot_wall[j] + Edot_l_transfer[j] + Vdot_l_feed[j] * sum(c_l_feed[j, :]) * h_l_feed[j] + Vdot_le[j - 1] * sum(c_l[j - 1, :]) * h_l[j - 1] - Vdot_le[j] * sum(c_l[j, :]) * h_l[j] + Qdot_reac[j];
+    end for;
+    A * H / n * eps * der(eps_liq[n] * sum(c_l[n, :]) * u_l[n]) + A * H / n * (1 - eps) * rho_solid[n] * c_solid * der(T[n]) = sum(-Ndot_v_transfer[n, :] .* delta_hv[n, :]) + Ndot_l_in * h_downStreamIn_act - Vdot_l[n] * sum(c_l[n, :]) * h_l[n] - Qdot_wall[n] + Edot_l_transfer[n] + Vdot_l_feed[n] * sum(c_l_feed[n, :]) * h_l_feed[n] + Vdot_le[n - 1] * sum(c_l[n - 1, :]) * h_l[n - 1] + Qdot_reac[n];
+    A * H / n * eps * der(eps_vap[1] * sum(c_v[1, :]) * u_v[1]) = Ndot_v_in * h_upStreamIn_act - Vdot_v[1] * sum(c_v[1, :]) * h_v[1] + Edot_v_transfer[1] + Vdot_v_feed[1] * sum(c_v_feed[1, :]) * h_v_feed[1] + Ndot_source_startUp[1] * h_v[1];
+    for j in 2:n - 1 loop
+      A * H / n * eps * der(eps_vap[j] * sum(c_v[j, :]) * u_v[j]) = Vdot_v[j - 1] * sum(c_v[j - 1, :]) * propsVap[j - 1].h - Vdot_v[j] * sum(c_v[j, :]) * h_v[j] + Edot_v_transfer[j] + Vdot_v_feed[j] * sum(c_v_feed[j, :]) * h_v_feed[j] + Ndot_source_startUp[j] * h_v[j];
+    end for;
+    A * H / n * eps * der(eps_vap[n] * sum(c_v[n, :]) * u_v[n]) = Vdot_v[n - 1] * sum(c_v[n - 1, :]) * propsVap[n - 1].h - Ndot_v[n] * h_upStreamOut_act + Edot_v_transfer[n] + Vdot_v_feed[n] * sum(c_v_feed[n, :]) * h_v_feed[n] + Ndot_source_startUp[n] * h_v[n];
+  end if;
+end BaseTwoPhaseVarStateFixEps;
\ No newline at end of file
Only in converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium: BaseTwoPhaseVarStateFixEps.mo.after
Only in converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/NonEquilibrium: BaseTwoPhaseVarStateFixEps.mo.before
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/OldSteadyStateExample.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/OldSteadyStateExample.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/OldSteadyStateExample.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/Base/OldSteadyStateExample.mo"	2022-03-10 09:58:39.268151888 +0000
@@ -3,10 +3,9 @@
 
   model ProPen_RB_SteadyState
     "separation of alkanes, using a packed column, steady state balance equations"
-    //Lauftest: 1.2.
-    //Lauftest: 25.1.
-    //Lauftest: 12.1. (3s, Kevin)
-
+    //Lauftest: 1.2.
+    //Lauftest: 25.1.
+    //Lauftest: 12.1. (3s, Kevin)
   ThermalSeparation.Components.SourcesSinks.SourceLiquid
                                                 sourceLiquid(
       redeclare package MediumLiquid =
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/TrayColumn/BaseTray.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/TrayColumn/BaseTray.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/TrayColumn/BaseTray.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/BalanceEquations/TrayColumn/BaseTray.mo"	2022-03-10 09:58:39.116151869 +0000
@@ -1,6 +1,6 @@
 within ThermalSeparation.BalanceEquations.TrayColumn;
 partial model BaseTray
 
- input Modelica.SIunits.Height h_start[:];
+ input Modelica.Units.SI.Height h_start[:];
 
 end BaseTray;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSimp/OneStageSimp.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSimp/OneStageSimp.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSimp/OneStageSimp.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSimp/OneStageSimp.mo"	2022-03-10 09:58:39.052151861 +0000
@@ -15,38 +15,38 @@
 
   Real K[nS] = thermoEquilibrium.K "equilibrium constant";
 
-  parameter Modelica.SIunits.HeatFlowRate Q_kon_fixed=1e5;
+  parameter Modelica.Units.SI.HeatFlowRate Q_kon_fixed=1e5;
   parameter Real beta_l=7e2 "liquid mass transfer coefficient" annotation(Dialog(group="Shell side parameters"));
   parameter Real beta_v=7e2 "vapour mass transfer coefficient" annotation(Dialog(group="Shell side parameters"));
   parameter Real alpha_l=5e5 "liquid heat transfer coefficient" annotation(Dialog(group="Shell side parameters"));
   parameter Real alpha_v=5e5 "vapour heat transfer coefficient" annotation(Dialog(group="Shell side parameters"));
 
-  Modelica.SIunits.MolarFlowRate ndot_l_interface[nS];
-  Modelica.SIunits.MolarFlowRate ndot_v_interface[nS];
-  Modelica.SIunits.MolarFlowRate ndot_from_l[nSL];
-  Modelica.SIunits.MolarFlowRate ndot_from_v[nSV];
-
-  Modelica.SIunits.Temperature T_l_in;
-  Modelica.SIunits.Temperature T_v(stateSelect=StateSelect.default);
-  Modelica.SIunits.Temperature Tstar;
-
-  Modelica.SIunits.MoleFraction x_l_in[nSL];
-  Modelica.SIunits.MoleFraction x_v[nSV];
-  Modelica.SIunits.MoleFraction x_l_star[nSL];
-  Modelica.SIunits.MoleFraction x_v_star[nSV];
-  Modelica.SIunits.MoleFraction x_from_l[nSL];
-  Modelica.SIunits.MoleFraction x_to_l[nSL];
-  Modelica.SIunits.MoleFraction x_from_v[nSV];
-  Modelica.SIunits.MoleFraction x_to_v[nSV];
+  Modelica.Units.SI.MolarFlowRate ndot_l_interface[nS];
+  Modelica.Units.SI.MolarFlowRate ndot_v_interface[nS];
+  Modelica.Units.SI.MolarFlowRate ndot_from_l[nSL];
+  Modelica.Units.SI.MolarFlowRate ndot_from_v[nSV];
+
+  Modelica.Units.SI.Temperature T_l_in;
+  Modelica.Units.SI.Temperature T_v(stateSelect=StateSelect.default);
+  Modelica.Units.SI.Temperature Tstar;
+
+  Modelica.Units.SI.MoleFraction x_l_in[nSL];
+  Modelica.Units.SI.MoleFraction x_v[nSV];
+  Modelica.Units.SI.MoleFraction x_l_star[nSL];
+  Modelica.Units.SI.MoleFraction x_v_star[nSV];
+  Modelica.Units.SI.MoleFraction x_from_l[nSL];
+  Modelica.Units.SI.MoleFraction x_to_l[nSL];
+  Modelica.Units.SI.MoleFraction x_from_v[nSV];
+  Modelica.Units.SI.MoleFraction x_to_v[nSV];
 
-  Modelica.SIunits.MolarMass MM_l_in=mediumLiquidIn.MM;
-  Modelica.SIunits.MolarMass MM_v=mediumVapour.MM;
+  Modelica.Units.SI.MolarMass MM_l_in=mediumLiquidIn.MM;
+  Modelica.Units.SI.MolarMass MM_v=mediumVapour.MM;
 
-  Modelica.SIunits.Density rho_l_in=mediumLiquidIn.d;
-  Modelica.SIunits.Density rho_v=mediumVapour.d;
+  Modelica.Units.SI.Density rho_l_in=mediumLiquidIn.d;
+  Modelica.Units.SI.Density rho_v=mediumVapour.d;
 
-  Modelica.SIunits.Concentration c_l_in[nSL];
-  Modelica.SIunits.Concentration c_v[nSV];
+  Modelica.Units.SI.Concentration c_l_in[nSL];
+  Modelica.Units.SI.Concentration c_v[nSV];
 
   ThermalSeparation.Units.MolarEnthalpy h_l_in;//mediumLiquidIn.h;
   ThermalSeparation.Units.MolarEnthalpy h_v = mediumVapour.h;
@@ -56,15 +56,15 @@
   ThermalSeparation.Units.MolarEnthalpy h_to_v=mediumVapour.h;//enthalpy_VapToPB.h;
   ThermalSeparation.Units.MolarEnthalpy h_to_l=mediumLiquid.h;//enthalpy_LiqToPB.h;
 
-  Modelica.SIunits.HeatFlowRate qdot_v_interface;
-  Modelica.SIunits.HeatFlowRate qdot_l_interface;
-  Modelica.SIunits.HeatFlowRate qdot_v_conv;
-  Modelica.SIunits.HeatFlowRate qdot_l_conv;
-  Modelica.SIunits.HeatFlowRate qdot_v_cond;
-  Modelica.SIunits.HeatFlowRate qdot_l_cond;
+  Modelica.Units.SI.HeatFlowRate qdot_v_interface;
+  Modelica.Units.SI.HeatFlowRate qdot_l_interface;
+  Modelica.Units.SI.HeatFlowRate qdot_v_conv;
+  Modelica.Units.SI.HeatFlowRate qdot_l_conv;
+  Modelica.Units.SI.HeatFlowRate qdot_v_cond;
+  Modelica.Units.SI.HeatFlowRate qdot_l_cond;
 
-  Modelica.SIunits.VolumeFlowRate vdot_v_out;
-  Modelica.SIunits.VolumeFlowRate vdot_l_in;
+  Modelica.Units.SI.VolumeFlowRate vdot_v_out;
+  Modelica.Units.SI.VolumeFlowRate vdot_l_in;
 
   SI.MoleFraction x_vap_liq[nS] "total molar fractions";
   Real n_tot[nS] "total molar holdup";
@@ -79,12 +79,12 @@
 
 /* geometry */
 
-  parameter Modelica.SIunits.Area A=0.5 "crossectional area" annotation(Dialog(tab="Geometry"));
-  parameter Modelica.SIunits.Height H=1.3 "height" annotation(Dialog(tab="Geometry"));
+  parameter Modelica.Units.SI.Area A=0.5 "crossectional area" annotation(Dialog(tab="Geometry"));
+  parameter Modelica.Units.SI.Height H=1.3 "height" annotation(Dialog(tab="Geometry"));
 
-  Modelica.SIunits.Height h_liq "liquid level inside condenser";
-  parameter Modelica.SIunits.Length h_w=H/10 "weir height" annotation(Dialog(tab="Geometry"));
-  parameter Modelica.SIunits.Length h_lw=A*0.7 "weir length" annotation(Dialog(tab="Geometry"));
+  Modelica.Units.SI.Height h_liq "liquid level inside condenser";
+  parameter Modelica.Units.SI.Length h_w=H/10 "weir height" annotation(Dialog(tab="Geometry"));
+  parameter Modelica.Units.SI.Length h_lw=A*0.7 "weir length" annotation(Dialog(tab="Geometry"));
 
 MediumLiquid.FugacityCoefficient satFugacityLiq(T=Tstar, p=p, p_sat=p_sat);
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSump/HeatTransferModel.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSump/HeatTransferModel.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSump/HeatTransferModel.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSump/HeatTransferModel.mo"	2022-03-10 09:58:12.528148502 +0000
@@ -200,8 +200,8 @@
   SI.Velocity v(start=0.1); //velocity of steam
   Real E; //         amplification factor
   Real psi;
-  SI.CoefficientOfHeatTransfer alpha_i(start=1e2);// valid for laminar and turbulent flow; VDI-Wärmeatlas
-  SI.CoefficientOfHeatTransfer alpha_a(start=1e4);//for bulk boiling in pressure vessels (natural convection); Stephan, Baehr, "Wärme- und Stoffübertragung"
+  SI.CoefficientOfHeatTransfer alpha_i(start=1e2);// valid for laminar and turbulent flow; VDI-WÃ¤rmeatlas
+  SI.CoefficientOfHeatTransfer alpha_a(start=1e4);//for bulk boiling in pressure vessels (natural convection); Stephan, Baehr, "WÃ¤rme- und StoffÃ¼bertragung"
   Real Nu_turb_total;//Nusselt number; valid for laminar and turbulent flow
   Real Nu_lam;
   Real Nu_lam_1;
@@ -224,7 +224,7 @@
   Real d;
   Real e;
   Real f;
-  Real m; //tabulated value - VDI Wärmeatlas
+  Real m; //tabulated value - VDI WÃ¤rmeatlas
   Real f_well;
   SI.MassFlowRate mdot_cond;
   SI.ThermalConductivity lambda_water=0.66;
@@ -372,8 +372,8 @@
   SI.Velocity v=velocity.y; //velocity of steam
   Real E; //         amplification factor
   Real psi;
-  SI.CoefficientOfHeatTransfer alpha_i(start=1e2);// valid for laminar and turbulent flow; VDI-Wärmeatlas
-  SI.CoefficientOfHeatTransfer alpha_a(start=1e4);//for bulk boiling in pressure vessels (natural convection); Stephan, Baehr, "Wärme- und Stoffübertragung"
+  SI.CoefficientOfHeatTransfer alpha_i(start=1e2);// valid for laminar and turbulent flow; VDI-WÃ¤rmeatlas
+  SI.CoefficientOfHeatTransfer alpha_a(start=1e4);//for bulk boiling in pressure vessels (natural convection); Stephan, Baehr, "WÃ¤rme- und StoffÃ¼bertragung"
   Real Nu_turb_total;//Nusselt number; valid for laminar and turbulent flow
   Real Nu_lam;
   Real Nu_lam_1;
@@ -397,7 +397,7 @@
   Real d;
   Real e;
   Real f;
-  Real m; //tabulated value - VDI Wärmeatlas
+  Real m; //tabulated value - VDI WÃ¤rmeatlas
   Real f_well;
   parameter Real n=80; //number of tubes inside the heat exchanger
   SI.MassFlowRate mdot_cond;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSump/Sump_Steam_1_2.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSump/Sump_Steam_1_2.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSump/Sump_Steam_1_2.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSump/Sump_Steam_1_2.mo"	2022-03-10 09:58:12.528148502 +0000
@@ -25,7 +25,7 @@
 parameter Boolean inertLiquid[nSL] = fill(false,nSL)
     "true for each component which is inert";
 
-    // vorläufig konstant
+    // vorlÃ¤ufig konstant
 //parameter Real gamma=1;
 //parameter Real phi=1;
 //parameter Real phi_sat=1;
@@ -137,7 +137,7 @@
 
 equation
 
-//Medienübergabe
+//MedienÃ¼bergabe
 
    MM_v = mediumVapour.MM;//max(1e-6,sum(x_v_in.*MediumVapour.MMX));
    rho_v = mediumVapour.d;
@@ -211,7 +211,7 @@
 
 //Enthalpy Balance
     der(HU_l*u_l+HU_v*u_v)=Vdot_in_l*rho_l_in/MM_l_in*h_l_in-Vdot_out_l*rho_l/MM_l*h_l-Vdot_out_v*rho_v/MM_v*h_v+Qdot_in-Qdot_out
-    "Wärmeaufnahme des Stahls fehlt noch";
+    "WÃ¤rmeaufnahme des Stahls fehlt noch";
     T_l=T_v;
     T_system=T_l;
 
@@ -220,7 +220,7 @@
 
     p_out_l_port=p_system+rho_l*g*height_l;
 
-    //p_system=p_out_v_port; //Ist für Schaltung mit Kolonne überflüssig
+    //p_system=p_out_v_port; //Ist fÃ¼r Schaltung mit Kolonne Ã¼berflÃ¼ssig
 
     //p_system=p_in;
         V_l=HU_l*MM_l/rho_l;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSump/Sump_Steam_2_4.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSump/Sump_Steam_2_4.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSump/Sump_Steam_2_4.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnSump/Sump_Steam_2_4.mo"	2022-03-10 09:58:12.528148502 +0000
@@ -25,7 +25,7 @@
 parameter Boolean inertLiquid[nSL] = fill(false,nSL)
     "true for each component which is inert";
 
-    // vorläufig konstant
+    // vorlÃ¤ufig konstant
 //parameter Real gamma=1;
 //parameter Real phi=1;
 //parameter Real phi_sat=1;
@@ -147,7 +147,7 @@
 
 equation
 
-//Medienübergabe
+//MedienÃ¼bergabe
 
   mediumVapour.p=p_system;
   mediumVapour.T=T_system;
@@ -230,7 +230,7 @@
 
 //Enthalpy Balance
     der(HU_l*u_l+HU_v*u_v)=Vdot_in_l*rho_l_in/MM_l_in*h_l_in-Vdot_out_l*rho_l/MM_l*h_l-Vdot_out_v*rho_v/MM_v*h_v+Qdot_in-Qdot_out
-    "Wärmeaufnahme des Stahls fehlt noch";
+    "WÃ¤rmeaufnahme des Stahls fehlt noch";
     T_l=T_v;
     T_system=T_l;
 
@@ -241,7 +241,7 @@
 
     p_out_l_port=p_system+rho_l*g*height_l;
 
-    //p_system=p_out_v_port; //Ist für Schaltung mit Kolonne überflüssig
+    //p_system=p_out_v_port; //Ist fÃ¼r Schaltung mit Kolonne Ã¼berflÃ¼ssig
 
     //p_system=p_in;
         V_l=HU_l*MM_l/rho_l;
@@ -378,6 +378,6 @@
 </ul></p>
 <p>Die gleichen Gr&ouml;&szlig;en, die unbekannt f&uuml;r die Austritte sind, sind vorgegeben aus dem untersten Boden der Kolonne f&uuml;r den Eintritt in den Verdampfer. Die zugef&uuml;hrte W&auml;rme <i>Qdot_in</i>, sowie die sich aus den Ma&szlig;en des Beh&auml;lters ergebenden Geometrievariablen, also die Fl&auml;che <i>A </i>und die H&ouml;he <i>h </i>werden vorgegeben. Au&szlig;erdem wird wird der gew&uuml;nschte F&uuml;llstand, &uuml;ber den der Ausfluss der Fl&uuml;ssigkeit geregelt wird <i>h_w</i>, festgelegt. </p>
 <p>Eine Verlustw&auml;rme nach au&szlig;en zur Umgebung wird vernachl&auml;ssigt. Weitere Annahmen sind, dass der Eintrittsdruck der Fl&uuml;ssigkeit dem Systemdruck im Verdampfer entspricht und somit auch dem Austrittsdruck des Gases.</p>
-<p>Check sagt: 5 Unbekannte zuviel. Das Modell läuft aber trotzdem. Grund: Zählweise der Unbekannten in den Konnektoren. Beispielsweise sieht der Input Konnektor nicht alle Größen als bekannt an. Er will entweder eine Flow- oder eine Potentialvariable haben und liefert entsprechend die andere. Die korrekte Formulierung ist aber unintuitiv und müllt den Quellcode voll.</p> 
+<p>Check sagt: 5 Unbekannte zuviel. Das Modell lÃ¤uft aber trotzdem. Grund: ZÃ¤hlweise der Unbekannten in den Konnektoren. Beispielsweise sieht der Input Konnektor nicht alle GrÃ¶ÃŸen als bekannt an. Er will entweder eine Flow- oder eine Potentialvariable haben und liefert entsprechend die andere. Die korrekte Formulierung ist aber unintuitiv und mÃ¼llt den Quellcode voll.</p> 
 </html>"));
 end Sump_Steam_2_4;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/BaseColumn.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/BaseColumn.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/BaseColumn.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/BaseColumn.mo"	2022-03-10 09:58:39.020151857 +0000
@@ -8,7 +8,7 @@
   parameter Integer n(min=1)=1
     "packed column: number of discrete elements in the section; plate column: number of trays in one section";
 
-//Initialization
+//Initialization
   parameter SI.Pressure p_v_start_inlet = 1.9e5 annotation(Dialog(tab="Initialization"));
   parameter SI.Pressure p_v_start_outlet = 1.8e5 annotation(Dialog(tab="Initialization"));
   final parameter SI.Pressure p_v_start[n] = if n==1 then {p_v_start_outlet} else linspace(p_v_start_inlet,p_v_start_outlet,n);
@@ -34,20 +34,20 @@
   parameter SI.Temperature T_liq_start_top = 300 annotation(Dialog(tab="Initialization"));
   parameter SI.Temperature T_vapour_start= 300 annotation(Dialog(tab="Initialization"));
   parameter SI.Temperature T_liquid_start= 300 annotation(Dialog(tab="Initialization"));
- //for equilibrium models, vapour start temperature always equals liquid start temperature
-//   final parameter SI.Temperature T_v_start[n]= if EQ then (if T_l_profile then linspace(T_liq_start_bottom, T_liq_start_top, n) else ones(n)*T_liquid_start) else (if T_v_profile and not n==1 then linspace(T_vap_start_bottom, T_vap_start_top, n) else (if T_v_profile and n==1 then ones(n)*(T_vap_start_bottom+ T_vap_start_top)/2 else ones(n)*T_vapour_start));
-//   final parameter SI.Temperature T_l_start[n]= if EQ then (if T_l_profile then linspace(T_liq_start_bottom, T_liq_start_top, n) else ones(n)*T_liquid_start) else (if T_l_profile and not n==1 then linspace(T_liq_start_bottom, T_liq_start_top, n) else (if T_l_profile and n==1 then ones(n)*(T_liq_start_bottom+ T_liq_start_top)/2 else ones(n)*T_liquid_start));
+ //for equilibrium models, vapour start temperature always equals liquid start temperature
+  //   final parameter SI.Temperature T_v_start[n]= if EQ then (if T_l_profile then linspace(T_liq_start_bottom, T_liq_start_top, n) else ones(n)*T_liquid_start) else (if T_v_profile and not n==1 then linspace(T_vap_start_bottom, T_vap_start_top, n) else (if T_v_profile and n==1 then ones(n)*(T_vap_start_bottom+ T_vap_start_top)/2 else ones(n)*T_vapour_start));
+  //   final parameter SI.Temperature T_l_start[n]= if EQ then (if T_l_profile then linspace(T_liq_start_bottom, T_liq_start_top, n) else ones(n)*T_liquid_start) else (if T_l_profile and not n==1 then linspace(T_liq_start_bottom, T_liq_start_top, n) else (if T_l_profile and n==1 then ones(n)*(T_liq_start_bottom+ T_liq_start_top)/2 else ones(n)*T_liquid_start));
   final parameter SI.Temperature T_v_start[n] = if (T_v_profile and not n==1) then linspace(T_vap_start_bottom, T_vap_start_top, n) else (if (T_v_profile and n==1) then ones(n)*(T_vap_start_bottom+ T_vap_start_top)/2 else ones(n)*T_vapour_start);
   final parameter SI.Temperature T_l_start[n] = if (T_l_profile and not n==1) then linspace(T_liq_start_bottom, T_liq_start_top, n) else (if (T_l_profile and n==1) then ones(n)*(T_liq_start_bottom+ T_liq_start_top)/2 else ones(n)*T_liquid_start);
 
 Boolean useHomotopy=false annotation(Dialog(tab="Initialization", group="Homotopy"));
 
-// replaceable model HomotopyMethod =
-//       ThermalSeparation.Components.Columns.BaseClasses.Initialization.Homotopy2.BaseHomotopy
-//       (                                                                           nS=nS, useHomotopy=useHomotopy)
-//                              constrainedby
-//     ThermalSeparation.Components.Columns.BaseClasses.Initialization.Homotopy2.BaseHomotopy
-//                                                                         annotation(Dialog(enable=useHomotopy,tab="Initialization", group="Homotopy"),choicesAllMatching=true);
+// replaceable model HomotopyMethod =
+  //       ThermalSeparation.Components.Columns.BaseClasses.Initialization.Homotopy2.BaseHomotopy
+  //       (                                                                           nS=nS, useHomotopy=useHomotopy)
+  //                              constrainedby
+  //     ThermalSeparation.Components.Columns.BaseClasses.Initialization.Homotopy2.BaseHomotopy
+  //                                                                         annotation(Dialog(enable=useHomotopy,tab="Initialization", group="Homotopy"),choicesAllMatching=true);
 
 replaceable model HomotopyMethod =
       ThermalSeparation.Components.Columns.BaseClasses.Initialization.Homotopy.NoHomotopy
@@ -56,14 +56,14 @@
 
 HomotopyMethod homotopyMethod(nS=nS, useHomotopy=useHomotopy);
 
-//Result-Record
+//Result-Record
  Results results(n=n, nSL=nSL, nSV=nSV, T_l=T_l, x_l=x_l, x_v=x_v,  x_l_star=x_l_star, x_v_star=x_v_star,c_l = c_l, c_v=c_v, p_v=p_v, Vdot_l=Vdot_l, Vdot_v=Vdot_v, eps_liq = eps_liq, startUp=startUp);
 
-//Equilibrium or Non-Equilibrium model?
+//Equilibrium or Non-Equilibrium model?
   parameter Boolean EQ= false
     "equilibrium model is used, no mass transfer, value provided by film model" annotation(Dialog(enable=false));
-//Medium
-parameter Integer mapping[nS,2] = {{i,i} for i in 1:nS}
+ //Medium
+  parameter Integer mapping[nS,2] = {{i,i} for i in 1:nS}
     "parameter to map the different medium vectors one to another";
 parameter Boolean inertVapour[nSV] = fill(false,nSV)
     "true for each component which is inert in the vapour phase";
@@ -112,13 +112,15 @@
   SI.MolarMass MM_l[n](start=fill(0.018,n))= mediumLiquid.MM
     "molar mass of the liquid mixture";
   SI.MolarMass MM_l_in= mediumLiquidIn.MM;
-  ThermalSeparation.Units.MolarEnthalpy h_l[n];//= mediumLiquid.h;
-  ThermalSeparation.Units.MolarEnthalpy h_l_in;//=mediumLiquidIn.h;
+  ThermalSeparation.Units.MolarEnthalpy h_l[n];
+ //= mediumLiquid.h;
+  ThermalSeparation.Units.MolarEnthalpy h_l_in;
+ //=mediumLiquidIn.h;
   SI.MolarInternalEnergy u_l[n](each stateSelect=StateSelect.default) =  mediumLiquid.u;
   MediumLiquid.ThermodynamicProperties[n] propsLiq= mediumLiquid.properties;
   MediumLiquid.ThermodynamicProperties propsLiqIn= mediumLiquidIn.properties;
 
-//Variables upStream
+//Variables upStream
   SI.Concentration c_v_in[nSV];
   SI.Concentration c_v[n,nSV](each start=10,each stateSelect=StateSelect.default) annotation(Dialog(group="Initialization",showStartAttribute=true));
   SI.MoleFraction x_v_in[nSV];
@@ -135,7 +137,7 @@
     "p_v[j] = pressure on the j-th stage, p_v[n+1] is the pressure in the first element of the sucesseding component";
   SI.Temperature T_v[n](start=T_v_start);
 
-  //Variables downStream
+//Variables downStream
   SI.Concentration c_l_in[nSL]
     "molar concentration in the liquid at the liquid outlet of each stage";
   SI.Concentration c_l[n,nSL](each start=1, each stateSelect=StateSelect.default) annotation(Dialog(group="Initialization",showStartAttribute=true));
@@ -151,11 +153,11 @@
   ThermalSeparation.Units.MolarEnthalpy h_downStreamIn_act;
   ThermalSeparation.Units.MolarEnthalpy h_downStreamOut_act;
 
-  //Model for reaction: to be supplied by extending class
+//Model for reaction: to be supplied by extending class
   SI.MolarFlowRate Ndot_reac[n,nSL];
   SI.HeatFlowRate Qdot_reac[n];
 
-  //instances of connectores to next stage
+//instances of connectores to next stage
   ThermalSeparation.Interfaces.GasPortIn          upStreamIn(
                                                     redeclare package Medium =
         MediumVapour)               annotation (Placement(transformation(extent={{-80,
@@ -177,7 +179,7 @@
           extent={{60,-100},{80,-80}}, rotation=0), iconTransformation(extent={
             {60,-100},{80,-80}})));
 
-  //initial equation for eps_liq is supplied in the extending class!
+//initial equation for eps_liq is supplied in the extending class!
   SI.VolumeFraction eps_liq[n](each stateSelect=StateSelect.default,each start=eps_liq_start)
     "liquid volume fraction";
   SI.VolumeFraction eps_vap[n](start=fill(0.99,n))
@@ -185,7 +187,7 @@
   SI.Temperature T[n];
   SI.HeatFlowRate Qdot_wall[n] "heat flow rate to wall";
 
-  //to be supplied in extending class
+//to be supplied in extending class
   SI.MolarFlowRate Ndot_v_transfer[        n,nSV](start=fill(-0.1,n,nSV));
   SI.MolarFlowRate Ndot_l_transfer[        n,nSL](start=fill(0.1,n,nSL));
 
@@ -218,11 +220,11 @@
  replaceable model ThermoEquilibrium =
       ThermalSeparation.PhaseEquilibrium.RealGasActivityCoeffLiquid                                  constrainedby ThermalSeparation.PhaseEquilibrium.BasePhaseEquilibrium
     "model for phase equilibrium"                                                         annotation(choicesAllMatching=true);
-//     ThermoEquilibrium bubblePressure[n](x_vap_liq=x_vap_liq,each nS=nS,  each mapping =                            mapping,
-//     redeclare replaceable package MediumVapour =   MediumVapour,
-//   redeclare replaceable package MediumLiquid =
-//      MediumLiquid, p=ones(n)*p_initial, T=T_l, x_v=x_v, x_l=x_l, p_sat=p_sat_bulk,  v_v=MM_v./rho_v);
 
+//     ThermoEquilibrium bubblePressure[n](x_vap_liq=x_vap_liq,each nS=nS,  each mapping =                            mapping,
+  //     redeclare replaceable package MediumVapour =   MediumVapour,
+  //   redeclare replaceable package MediumLiquid =
+  //      MediumLiquid, p=ones(n)*p_initial, T=T_l, x_v=x_v, x_l=x_l, p_sat=p_sat_bulk,  v_v=MM_v./rho_v);
     ThermoEquilibrium bubblePressure[n](x_vap_liq=x_vap_liq,each nS=nS,  each mapping =                            mapping,
     redeclare replaceable package MediumVapour =   MediumVapour,
   redeclare replaceable package MediumLiquid =
@@ -238,21 +240,23 @@
   parameter SI.SpecificHeatCapacity c_solid;
 
  /***variables for reorganisation of mediums in the medium vector ***/
-//parameter Integer mL( fixed=false);
-// parameter Integer mV(fixed=false);
 
+//parameter Integer mL( fixed=false);
+
+// parameter Integer mV(fixed=false);
 public
   Boolean bool_eps[n];
 
 /*** entrainment ***/
-  SI.VolumeFlowRate Vdot_le[n] "liquid volume flow entrained by vapour"; // has to be supplied in extending class
+  SI.VolumeFlowRate Vdot_le[n] "liquid volume flow entrained by vapour";   // has to be supplied in extending class
 
 /*** StartUp ***/
   parameter Boolean considerStartUp = false
     "true if StartUp is to be considered" annotation(Dialog(tab="StartUp"));
   Boolean before_transition[n]=fill(false,n);
 
-  SI.Pressure p_initial = 1e5;//upStreamOut.p "initial pressure in column";
+  SI.Pressure p_initial = 1e5;
+ //upStreamOut.p "initial pressure in column";
   parameter Real friggelfaktor = 0.0002e5 annotation(Dialog(tab="StartUp"));
   parameter Real k=0.2e-3 "large value for steep omega" annotation(Dialog(tab="StartUp"));
   SI.Pressure p_bub[n]= bubblePressure.p_bubble "mixture bubble pressure";
@@ -289,7 +293,7 @@
 
 
 /*** monitoring ***/
-  //only for monitoring purpose: is the sum of the x really equal to one?
+  //only for monitoring purpose: is the sum of the x really equal to one?
  Real sum_xl[n] = sum(x_l[:,i] for i in 1:nSL);
  Real sum_xv[ n] = sum(x_v[:,i] for i in 1:nSV);
  SI.MolarFlowRate Ndot_trans[nSL] = sum(Ndot_l_transfer[j,:] for j in 1:n);
@@ -320,7 +324,7 @@
                                               n](each u_s = p_initial,
       each yMax=100,
       each k=0.5,
-     each initType=Modelica.Blocks.Types.InitPID.InitialOutput,
+     each initType=Modelica.Blocks.Types.Init.InitialOutput,
     each Ti=1,
     each Td=1)                                                         annotation (Placement(transformation(extent={{-24,-12},{-4,8}})));
 
@@ -362,23 +366,20 @@
     for i in 1:nS loop
     n_tot[j,i]= (c_v[j,mapping[i,1]].* (1-eps_liq[j]) + c_l[j,mapping[i,2]].* eps_liq[j])*H*A/n;
     end for;
+  end for;
+ for j in 1:n loop
+// PID[j].u_m = if considerStartUp  then p_v[j]  else p_initial;
+    PID[j].u_m = if considerStartUp and startUp[j] then p_v[j] else if considerStartUp and not startUp[j] then p_initial else p_initial;
   end for;
-
-          for j in 1:n loop
-     // PID[j].u_m = if considerStartUp  then p_v[j]  else p_initial;
-            PID[j].u_m = if considerStartUp and startUp[j] then p_v[j] else if considerStartUp and not startUp[j] then p_initial else p_initial;
-
-      end for;
   /***monitoring ***/
   for j in 1:n loop
   X_v[j,:]=x_v[j,:]/MM_v[j].*MediumVapour.MMX[:];
   X_l[j,:]=x_l[j,:]/MM_l[j].*MediumLiquid.MMX[:];
     n_i_liq[j,:]=c_l[j,:].*eps_liq[j]*A*H/n*eps;
     n_i_vap[j,:]=c_v[j,:].*eps_vap[j]*A*H/n*eps;
-  end for;
-
-  //Verknpfung der Konnektorgren mit Variablen
-  //upstream
+  end for;
+//Verknpfung der Konnektorgren mit Variablen
+//upstream
   x_v_in = inStream(upStreamIn.x_outflow);
   h_v_in = inStream(upStreamIn.h_outflow);
   c_v_in = x_v_in / MM_v_in *rho_v_in;
@@ -410,10 +411,10 @@
   upStreamIn.p = p_v_in;
   upStreamOut.p = p_hyd[n+1];
   upStreamIn.Ndot = Ndot_v_in;
-  upStreamOut.Ndot = -Ndot_v[n];
- //upStreamOut.p_medium = p_hyd[n];
-  //downstream
-  downStreamIn.p = p_hyd[n+1];
+  upStreamOut.Ndot = -Ndot_v[n];
+//upStreamOut.p_medium = p_hyd[n];
+//downstream
+  downStreamIn.p = p_hyd[n + 1];
   downStreamIn.Ndot = Ndot_l_in;
   downStreamOut.Ndot = -Ndot_l[1];
 
@@ -425,90 +426,79 @@
 for j in 1:n loop
   n_mol_L_i[j,:]=n_mol_L[j]*x_l[j,:];
   n_mol_V_i[j,:]=n_mol_V[j]*x_v[j,:];
-end for;
-
-  /***eps_liq > 1: Betriebsendpunkt erreicht, allerdings ist beim Anfahrvorgang u.U. eps_liq = 1 ***/
-  for j in 1:n loop
- // assert(eps_liq[j] < 0.99, "liquid volume fraction eps_liq gets larger than 1, the column can not be operated at this point!");
-  end for;
-
-/*** StartUp ***/
-
-if considerStartUp then
-  for j in 1:n loop
-    when p_bub[j] + friggelfaktor >= p_initial then // der Druck, den auch das Medienmodell sieht, friggelfaktor, weil sonst Umschalten zu spt
-      startUp[j] = false;
-    end when;
-//      if p_bub[j] <= p_v[j] then
-//        omega[j] = min(1,1 + tanh(k*(p_bub[j] + friggelfaktor - p_initial)));
-//      else
-//        omega[j] = 1;
-//      end if;
-     omega[j] =  min(1,1 + tanh(k*(p_bub[j]+ friggelfaktor   - p_initial)));
- //   p_hyd[j] = if startUp[j] then p_initial else p_v[j];
-    p_hyd[j] =  (p_initial * (1 - omega[j])) + p_v[j] * omega[j];
-
-         if startUp[j] then
-   Ndot_source_startUp[j]=PID[j].y;
-     else
-      Ndot_source_startUp[j]=0;
-     end if;
-
-    end for;
-    p_hyd[n+1] = p_v[n+1];
-
-else
-      startUp = fill(false,n);
-      omega = ones(n);
-      p_hyd = p_v;
-      Ndot_source_startUp=zeros(n);
-end if;
-
-/*** calculation of molar fraction using the pressure and the molar concentration ***/
-for j in 1:n loop
-
-  for i in 1:nS loop
-    // x_l[j,i] = if use_v then c_l[j,i] * mediumLiquid[j].v else c_l[j,i] * MM_l[j] /rho_l[j];
-    x_l[j,i] = c_l[j,i]  * mediumLiquid[j].v;
-    x_v[j,i] = c_v[j,i] * MM_v[j] /rho_v[j];
-  end for;
-  for i in 1:nL loop
-    x_l[j,i+nS] =  c_l[j,i+nS] *mediumLiquid[j].v;
-    //x_l[j,i+nS] = if use_v then c_l[j,i+nS] *mediumLiquid[j].v else c_l[j,i+nS] * MM_l[j] /rho_l[j];
-  end for;
-  for i in 1:nV loop
-    x_v[j,i+nS] = c_v[j,i+nS] * MM_v[j] /rho_v[j];
-  end for;
+end for;
+/***eps_liq > 1: Betriebsendpunkt erreicht, allerdings ist beim Anfahrvorgang u.U. eps_liq = 1 ***/
+  for j in 1:n loop
+// assert(eps_liq[j] < 0.99, "liquid volume fraction eps_liq gets larger than 1, the column can not be operated at this point!");
+  end for;
+/*** StartUp ***/
+  if considerStartUp then
+    for j in 1:n loop
+      when p_bub[j] + friggelfaktor >= p_initial then
+// der Druck, den auch das Medienmodell sieht, friggelfaktor, weil sonst Umschalten zu spt
+        startUp[j] = false;
+      end when;
+//      if p_bub[j] <= p_v[j] then
+//        omega[j] = min(1,1 + tanh(k*(p_bub[j] + friggelfaktor - p_initial)));
+//      else
+//        omega[j] = 1;
+//      end if;
+      omega[j] = min(1, 1 + tanh(k * (p_bub[j] + friggelfaktor - p_initial)));
+//   p_hyd[j] = if startUp[j] then p_initial else p_v[j];
+      p_hyd[j] = p_initial * (1 - omega[j]) + p_v[j] * omega[j];
+      if startUp[j] then
+        Ndot_source_startUp[j] = PID[j].y;
+      else
+        Ndot_source_startUp[j] = 0;
+      end if;
+    end for;
+    p_hyd[n + 1] = p_v[n + 1];
+  else
+    startUp = fill(false, n);
+    omega = ones(n);
+    p_hyd = p_v;
+    Ndot_source_startUp = zeros(n);
+  end if;
+/*** calculation of molar fraction using the pressure and the molar concentration ***/
+  for j in 1:n loop
+    for i in 1:nS loop
+// x_l[j,i] = if use_v then c_l[j,i] * mediumLiquid[j].v else c_l[j,i] * MM_l[j] /rho_l[j];
+      x_l[j, i] = c_l[j, i] * mediumLiquid[j].v;
+      x_v[j, i] = c_v[j, i] * MM_v[j] / rho_v[j];
+    end for;
+    for i in 1:nL loop
+      x_l[j, i + nS] = c_l[j, i + nS] * mediumLiquid[j].v;
+//x_l[j,i+nS] = if use_v then c_l[j,i+nS] *mediumLiquid[j].v else c_l[j,i+nS] * MM_l[j] /rho_l[j];
+    end for;
+    for i in 1:nV loop
+      x_v[j, i + nS] = c_v[j, i + nS] * MM_v[j] / rho_v[j];
+    end for;
   end for;
   for i in 1:nSL loop
 
-end for;
-
-  for j in 1:n loop
-//     sum(x_l[j,:])=1;
-//     sum(x_v[j,:])=1;
-    eps_vap[j] = 1- eps_liq[j];
+end for;
+ for j in 1:n loop
+//     sum(x_l[j,:])=1;
+//     sum(x_v[j,:])=1;
+    eps_vap[j] = 1 - eps_liq[j];
   end for;
 
 /*** thermal equilibrium of liquid phase and column internals ***/
- T=T_l;
-
-  //Saturation Pressure
-  for j in 1:n loop
-    p_sat_bulk[j,:]={mediumLiquid[j].p_sat[i] for i in 1:nSL};
-   /// p_sat[j,:]={mediumLiquid[j].p_sat[i] for i in 1:nSL};
-   //   p_sat[j,:]={mediumLiquidStar[j].p_sat[i] for i in 1:nSL};
+ T=T_l;
+//Saturation Pressure
+  for j in 1:n loop
+    p_sat_bulk[j, :] = {mediumLiquid[j].p_sat[i] for i in 1:nSL};
+/// p_sat[j,:]={mediumLiquid[j].p_sat[i] for i in 1:nSL};
+//   p_sat[j,:]={mediumLiquidStar[j].p_sat[i] for i in 1:nSL};
   end for;
 
 for j in 1:n loop
     n_mol_V[j] = A*H/n*eps*eps_vap[j]* sum(c_v[j,:]);
     n_mol_L[j] = A*H/n*eps*eps_liq[j]* sum(c_l[j,:]);
 end for;
-
-//   for i in 1:nS-1 loop
-//     (n_mol_L[1]*x_l_star[1,mapping[i,2]]+n_mol_V[1]*x_v_star[1,mapping[i,1]])/(n_mol_L[1]+n_mol_V[1]) = check[mapping[i,1]];
-//   end for;
-
+//   for i in 1:nS-1 loop
+//     (n_mol_L[1]*x_l_star[1,mapping[i,2]]+n_mol_V[1]*x_v_star[1,mapping[i,1]])/(n_mol_L[1]+n_mol_V[1]) = check[mapping[i,1]];
+//   end for;
 initial equation
   annotation (Diagram(graphics),
                        Icon(coordinateSystem(preserveAspectRatio=false, extent=
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/BaseColumn_external.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/BaseColumn_external.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/BaseColumn_external.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/BaseColumn_external.mo"	2022-03-10 09:58:38.924151844 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Components.Columns.BaseClasses;
+within ThermalSeparation.Components.Columns.BaseClasses;
 partial model BaseColumn_external "Gesamtmolbilanz, x, h, Ndot im Konnektor"
   import ThermalSeparation;
 
@@ -8,7 +8,7 @@
   parameter Integer n(min=1)=1
     "packed column: number of discrete elements in the section; plate column: number of trays in one section";
 
-//Initialization
+//Initialization
   parameter SI.Pressure p_v_start_inlet = 1.9e5 annotation(Dialog(tab="Initialization"));
   parameter SI.Pressure p_v_start_outlet = 1.8e5 annotation(Dialog(tab="Initialization"));
   final parameter SI.Pressure p_v_start[n] = if n==1 then {p_v_start_outlet} else linspace(p_v_start_inlet,p_v_start_outlet,n);
@@ -34,20 +34,20 @@
   parameter SI.Temperature T_liq_start_top = 300 annotation(Dialog(tab="Initialization"));
   parameter SI.Temperature T_vapour_start= 300 annotation(Dialog(tab="Initialization"));
   parameter SI.Temperature T_liquid_start= 300 annotation(Dialog(tab="Initialization"));
- //for equilibrium models, vapour start temperature always equals liquid start temperature
-//   final parameter SI.Temperature T_v_start[n]= if EQ then (if T_l_profile then linspace(T_liq_start_bottom, T_liq_start_top, n) else ones(n)*T_liquid_start) else (if T_v_profile and not n==1 then linspace(T_vap_start_bottom, T_vap_start_top, n) else (if T_v_profile and n==1 then ones(n)*(T_vap_start_bottom+ T_vap_start_top)/2 else ones(n)*T_vapour_start));
-//   final parameter SI.Temperature T_l_start[n]= if EQ then (if T_l_profile then linspace(T_liq_start_bottom, T_liq_start_top, n) else ones(n)*T_liquid_start) else (if T_l_profile and not n==1 then linspace(T_liq_start_bottom, T_liq_start_top, n) else (if T_l_profile and n==1 then ones(n)*(T_liq_start_bottom+ T_liq_start_top)/2 else ones(n)*T_liquid_start));
+ //for equilibrium models, vapour start temperature always equals liquid start temperature
+  //   final parameter SI.Temperature T_v_start[n]= if EQ then (if T_l_profile then linspace(T_liq_start_bottom, T_liq_start_top, n) else ones(n)*T_liquid_start) else (if T_v_profile and not n==1 then linspace(T_vap_start_bottom, T_vap_start_top, n) else (if T_v_profile and n==1 then ones(n)*(T_vap_start_bottom+ T_vap_start_top)/2 else ones(n)*T_vapour_start));
+  //   final parameter SI.Temperature T_l_start[n]= if EQ then (if T_l_profile then linspace(T_liq_start_bottom, T_liq_start_top, n) else ones(n)*T_liquid_start) else (if T_l_profile and not n==1 then linspace(T_liq_start_bottom, T_liq_start_top, n) else (if T_l_profile and n==1 then ones(n)*(T_liq_start_bottom+ T_liq_start_top)/2 else ones(n)*T_liquid_start));
   final parameter SI.Temperature T_v_start[n] = if (T_v_profile and not n==1) then linspace(T_vap_start_bottom, T_vap_start_top, n) else (if (T_v_profile and n==1) then ones(n)*(T_vap_start_bottom+ T_vap_start_top)/2 else ones(n)*T_vapour_start);
   final parameter SI.Temperature T_l_start[n] = if (T_l_profile and not n==1) then linspace(T_liq_start_bottom, T_liq_start_top, n) else (if (T_l_profile and n==1) then ones(n)*(T_liq_start_bottom+ T_liq_start_top)/2 else ones(n)*T_liquid_start);
 
-//Result-Record
-Results results(n=n, nSL=nSL, nSV=nSV, T_l=T_l, x_l=x_l, x_v=x_v,  x_l_star=x_l_star, x_v_star=x_v_star,c_l = c_l, c_v=c_v, p_v=p_v, Vdot_l=Vdot_l, Vdot_v=Vdot_v, eps_liq = eps_liq, startUp=startUp);
+//Result-Record
+  Results results(n=n, nSL=nSL, nSV=nSV, T_l=T_l, x_l=x_l, x_v=x_v,  x_l_star=x_l_star, x_v_star=x_v_star,c_l = c_l, c_v=c_v, p_v=p_v, Vdot_l=Vdot_l, Vdot_v=Vdot_v, eps_liq = eps_liq, startUp=startUp);
 
-//Equilibrium or Non-Equilibrium model?
+//Equilibrium or Non-Equilibrium model?
   parameter Boolean EQ= false
     "equilibrium model is used, no mass transfer, value provided by film model" annotation(Dialog(enable=false));
-//Medium
-parameter Integer mapping[nS,2] = {{i,i} for i in 1:nS}
+ //Medium
+  parameter Integer mapping[nS,2] = {{i,i} for i in 1:nS}
     "parameter to map the different medium vectors one to another";
 parameter Boolean inertVapour[nSV] = fill(false,nSV)
     "true for each component which is inert in the vapour phase";
@@ -104,7 +104,7 @@
   ThermalSeparation.Units.MolarEnthalpy h_l_in=mediumLiquidIn.h;
   SI.MolarInternalEnergy u_l[n](stateSelect=StateSelect.default) =  mediumLiquid.u;
 
-//Variables upStream
+//Variables upStream
   SI.Concentration c_v_in[nSV];
   SI.Concentration c_v[n,nSV](stateSelect=StateSelect.default) annotation(Dialog(group="Initialization",showStartAttribute=true));
   SI.MoleFraction x_v_in[nSV];
@@ -117,7 +117,7 @@
     "p_v[j] = pressure on the j-th stage, p_v[n+1] is the pressure in the first element of the sucesseding component";
   SI.Temperature T_v[n](nominal=fill(350,n),start=fill(350,n));
 
-  //Variables downStream
+//Variables downStream
   SI.Concentration c_l_in[nSL]
     "molar concentration in the liquid at the liquid outlet of each stage";
   SI.Concentration c_l[n,nSL](stateSelect=StateSelect.default) annotation(Dialog(group="Initialization",showStartAttribute=true));
@@ -130,11 +130,11 @@
   SI.Temperature T_l[n];
   SI.Concentration c_l_star[n,nSL];
 
-  //Model for reaction: to be supplied by extending class
+//Model for reaction: to be supplied by extending class
   SI.MolarFlowRate Ndot_reac[n,nSL];
   SI.HeatFlowRate Qdot_reac[n];
 
-  //instances of connectores to next stage
+//instances of connectores to next stage
   ThermalSeparation.Interfaces.GasPortIn          upStreamIn(
                                                     redeclare package Medium =
         MediumVapour)               annotation (Placement(transformation(extent=
@@ -152,7 +152,7 @@
         MediumLiquid)                    annotation (Placement(transformation(
           extent={{50,-100},{70,-80}}, rotation=0)));
 
-  //initial equation for eps_liq is supplied in the extending class!
+//initial equation for eps_liq is supplied in the extending class!
   SI.VolumeFraction eps_liq[        n]( stateSelect=StateSelect.prefer)
     "liquid volume fraction";
   SI.VolumeFraction eps_vap[        n](start=fill(0.99,n))
@@ -160,7 +160,7 @@
   SI.Temperature T[n];
   SI.HeatFlowRate Qdot_wall[n] "heat flow rate to wall";
 
-  //to be supplied in extending class
+//to be supplied in extending class
   SI.MolarFlowRate Ndot_v_transfer[        n,nSV](start=fill(-0.1,n,nSV));
   SI.MolarFlowRate Ndot_l_transfer[        n,nSL](start=fill(0.1,n,nSL));
 
@@ -212,20 +212,22 @@
   parameter SI.SpecificHeatCapacity c_solid;
 
  /***variables for reorganisation of mediums in the medium vector ***/
-//parameter Integer mL( fixed=false);
-// parameter Integer mV(fixed=false);
 
+//parameter Integer mL( fixed=false);
+
+// parameter Integer mV(fixed=false);
 public
   Boolean bool_eps[n];
 
 /*** entrainment ***/
-  SI.VolumeFlowRate Vdot_le[n] "liquid volume flow entrained by vapour"; // has to be supplied in extending class
+  SI.VolumeFlowRate Vdot_le[n] "liquid volume flow entrained by vapour";   // has to be supplied in extending class
 
 /*** StartUp ***/
   parameter Boolean considerStartUp = false
     "true if StartUp is to be considered" annotation(Dialog(tab="StartUp"));
 
-  SI.Pressure p_initial = 1e5;//upStreamOut.p "initial pressure in column";
+  SI.Pressure p_initial = 1e5;
+ //upStreamOut.p "initial pressure in column";
   parameter Real friggelfaktor = 0.0002e5 annotation(Dialog(tab="StartUp"));
   parameter Real k=0.2e-3 "large value for steep omega" annotation(Dialog(tab="StartUp"));
   SI.Pressure p_bub[n]= bubblePressure.p_bubble "mixture bubble pressure";
@@ -236,7 +238,7 @@
     "dummy molar flow rate to account for discharge of inert gas during startUp";
 
 /*** monitoring ***/
-  //only for monitoring purpose: is the sum of the x really equal to one?
+  //only for monitoring purpose: is the sum of the x really equal to one?
  Real sum_xl[n] = sum(x_l[:,i] for i in 1:nSL);
  Real sum_xv[ n] = sum(x_v[:,i] for i in 1:nSV);
  Real sum_xl_star[ n] = sum(x_l_star[:,i] for i in 1:nSL);
@@ -276,7 +278,7 @@
                                               n](each u_s = p_initial,
       yMax=100,
       k=0.5,
-     initType=Modelica.Blocks.Types.InitPID.InitialOutput)   annotation (Placement(transformation(extent={{-24,-12},{-4,8}})));
+     initType=Modelica.Blocks.Types.Init.InitialOutput)   annotation (Placement(transformation(extent={{-24,-12},{-4,8}})));
 
 initial algorithm
 
@@ -309,22 +311,20 @@
     end for;
 end if;
 
-equation
-          for j in 1:n loop
-     // PID[j].u_m = if considerStartUp  then p_v[j]  else p_initial;
-            PID[j].u_m = if considerStartUp and startUp[j] then p_v[j] else if considerStartUp and not startUp[j] then p_initial else p_initial;
-
-      end for;
+equation
+ for j in 1:n loop
+// PID[j].u_m = if considerStartUp  then p_v[j]  else p_initial;
+    PID[j].u_m = if considerStartUp and startUp[j] then p_v[j] else if considerStartUp and not startUp[j] then p_initial else p_initial;
+  end for;
   /***monitoring ***/
   for j in 1:n loop
   X_v[j,:]=x_v[j,:]/MM_v[j].*MediumVapour.MMX[:];
   X_l[j,:]=x_l[j,:]/MM_l[j].*MediumLiquid.MMX[:];
     n_i_liq[j,:]=c_l[j,:].*eps_liq[j]*A*H/n*eps;
     n_i_vap[j,:]=c_v[j,:].*eps_vap[j]*A*H/n*eps;
-  end for;
-
-  //VerknÃ¼pfung der KonnektorgrÃ¶ÃŸen mit Variablen
-  //upstream
+  end for;
+//VerknÃ¼pfung der KonnektorgrÃ¶ÃŸen mit Variablen
+//upstream
   x_v_in = inStream(upStreamIn.x_outflow);
   h_v_in = inStream(upStreamIn.h_outflow);
   c_v_in = x_v_in / MM_v_in *rho_v_in;
@@ -346,166 +346,146 @@
   upStreamIn.p = p_v_in;
   upStreamOut.p = p_hyd[n+1];
   upStreamIn.Ndot = Ndot_v_in;
-  upStreamOut.Ndot = -Ndot_v[n];
- //upStreamOut.p_medium = p_hyd[n];
-  //downstream
-  downStreamIn.p = p_hyd[n+1];
+  upStreamOut.Ndot = -Ndot_v[n];
+//upStreamOut.p_medium = p_hyd[n];
+//downstream
+  downStreamIn.p = p_hyd[n + 1];
   downStreamIn.Ndot = Ndot_l_in;
   downStreamOut.Ndot = -Ndot_l[1];
 
   Vdot_v= Ndot_v ./ rho_v .*MM_v "total molar flow rate vapour";
 Vdot_v_in= Ndot_v_in / rho_v_in*MM_v_in "total molar flow rate vapour";
 Vdot_l= Ndot_l ./ rho_l .*MM_l "total molar flow rate liquid";
-Vdot_l_in= Ndot_l_in / rho_l_in*MM_l_in "total molar flow rate vapour";
-
-  /***eps_liq > 1: Betriebsendpunkt erreicht, allerdings ist beim Anfahrvorgang u.U. eps_liq = 1 ***/
-  for j in 1:n loop
- // assert(eps_liq[j] < 0.99, "liquid volume fraction eps_liq gets larger than 1, the column can not be operated at this point!");
-  end for;
-
-/*** StartUp ***/
-
-if considerStartUp then
-  for j in 1:n loop
-    when p_bub[j] + friggelfaktor >= p_initial then // der Druck, den auch das Medienmodell sieht, friggelfaktor, weil sonst Umschalten zu spÃ¤t
-      startUp[j] = false;
-    end when;
-//      if p_bub[j] <= p_v[j] then
-//        omega[j] = min(1,1 + tanh(k*(p_bub[j] + friggelfaktor - p_initial)));
-//      else
-//        omega[j] = 1;
-//      end if;
-     omega[j] =  min(1,1 + tanh(k*(p_bub[j]+ friggelfaktor   - p_initial)));
- //   p_hyd[j] = if startUp[j] then p_initial else p_v[j];
-    p_hyd[j] =  (p_initial * (1 - omega[j])) + p_v[j] * omega[j];
-
-         if startUp[j] then
-   Ndot_source_startUp[j]=PID[j].y;
-     else
-      Ndot_source_startUp[j]=0;
-     end if;
-
-    end for;
-    p_hyd[n+1] = p_v[n+1];
-
-else
-      startUp = fill(false,n);
-      omega = ones(n);
-      p_hyd = p_v;
-      Ndot_source_startUp=zeros(n);
-end if;
-
-/*** calculation of molar fraction using the pressure and the molar concentration ***/
-for j in 1:n loop
-
-    c_l_star[j,:] =x_l_star[j,:] / MM_l_star[j]*rho_l_star[j];
-    c_v_star[j,:] =x_v_star[j,:] / MM_v_star[j]*rho_v_star[j];
-    // c_l_star[j,i] = (x_l_star[j,i]+x_l[j,i])/2 / MM_l_star[j]*rho_l_star[j];
-  for i in 1:nS loop
-    // x_l[j,i] = if use_v then c_l[j,i] * mediumLiquid[j].v else c_l[j,i] * MM_l[j] /rho_l[j];
-    x_l[j,i] = c_l[j,i]  * mediumLiquid[j].v;
-    x_v[j,i] = c_v[j,i] * MM_v[j] /rho_v[j];
-  end for;
-  for i in 1:nL loop
-    x_l[j,i+nS] =  c_l[j,i+nS] *mediumLiquid[j].v;
-    //x_l[j,i+nS] = if use_v then c_l[j,i+nS] *mediumLiquid[j].v else c_l[j,i+nS] * MM_l[j] /rho_l[j];
-  end for;
-  for i in 1:nV loop
-    x_v[j,i+nS] = c_v[j,i+nS] * MM_v[j] /rho_v[j];
-  end for;
+Vdot_l_in= Ndot_l_in / rho_l_in*MM_l_in "total molar flow rate vapour";
+/***eps_liq > 1: Betriebsendpunkt erreicht, allerdings ist beim Anfahrvorgang u.U. eps_liq = 1 ***/
+  for j in 1:n loop
+// assert(eps_liq[j] < 0.99, "liquid volume fraction eps_liq gets larger than 1, the column can not be operated at this point!");
+  end for;
+/*** StartUp ***/
+  if considerStartUp then
+    for j in 1:n loop
+      when p_bub[j] + friggelfaktor >= p_initial then
+// der Druck, den auch das Medienmodell sieht, friggelfaktor, weil sonst Umschalten zu spÃ¤t
+        startUp[j] = false;
+      end when;
+//      if p_bub[j] <= p_v[j] then
+//        omega[j] = min(1,1 + tanh(k*(p_bub[j] + friggelfaktor - p_initial)));
+//      else
+//        omega[j] = 1;
+//      end if;
+      omega[j] = min(1, 1 + tanh(k * (p_bub[j] + friggelfaktor - p_initial)));
+//   p_hyd[j] = if startUp[j] then p_initial else p_v[j];
+      p_hyd[j] = p_initial * (1 - omega[j]) + p_v[j] * omega[j];
+      if startUp[j] then
+        Ndot_source_startUp[j] = PID[j].y;
+      else
+        Ndot_source_startUp[j] = 0;
+      end if;
+    end for;
+    p_hyd[n + 1] = p_v[n + 1];
+  else
+    startUp = fill(false, n);
+    omega = ones(n);
+    p_hyd = p_v;
+    Ndot_source_startUp = zeros(n);
+  end if;
+/*** calculation of molar fraction using the pressure and the molar concentration ***/
+  for j in 1:n loop
+    c_l_star[j, :] = x_l_star[j, :] / MM_l_star[j] * rho_l_star[j];
+    c_v_star[j, :] = x_v_star[j, :] / MM_v_star[j] * rho_v_star[j];
+// c_l_star[j,i] = (x_l_star[j,i]+x_l[j,i])/2 / MM_l_star[j]*rho_l_star[j];
+    for i in 1:nS loop
+// x_l[j,i] = if use_v then c_l[j,i] * mediumLiquid[j].v else c_l[j,i] * MM_l[j] /rho_l[j];
+      x_l[j, i] = c_l[j, i] * mediumLiquid[j].v;
+      x_v[j, i] = c_v[j, i] * MM_v[j] / rho_v[j];
+    end for;
+    for i in 1:nL loop
+      x_l[j, i + nS] = c_l[j, i + nS] * mediumLiquid[j].v;
+//x_l[j,i+nS] = if use_v then c_l[j,i+nS] *mediumLiquid[j].v else c_l[j,i+nS] * MM_l[j] /rho_l[j];
+    end for;
+    for i in 1:nV loop
+      x_v[j, i + nS] = c_v[j, i + nS] * MM_v[j] / rho_v[j];
+    end for;
   end for;
   for i in 1:nSL loop
 
-end for;
-/*** MOLE BALANCES ***/
-if n==1 then
-
-   // component balance for vapour
-  A*H/n*eps* der(eps_vap[1]*c_v[1,:]) =  upStreamIn.Ndot*actualStream(upStreamIn.x_outflow) + upStreamOut.Ndot*actualStream(upStreamOut.x_outflow) + Ndot_v_transfer[1,:] + Vdot_v_feed[1]*c_v_feed[1,:] + Ndot_source_startUp[1] * x_v[1,:];
-    // component balance for liquid
- A*H/n*eps* der(eps_liq[1]*c_l[1,:]) = downStreamIn.Ndot * actualStream(downStreamIn.x_outflow) + downStreamOut.Ndot* actualStream(downStreamOut.x_outflow) + Ndot_l_transfer[1,:] + Ndot_reac[1,:] + Vdot_l_feed[1]*c_l_feed[1,:] - Vdot_le[1]*c_l[1,:];
-
-  // total mole balance for liquid and vapour
-  if eps_liq[1]<1e-5 and Vdot_l_in<1e-8 then
-     bool_eps[1]=true;
-     der(eps_liq[1])=0;
- else
-   bool_eps[1]=false;
-    A*H/n*eps* der(eps_liq[1]/mediumLiquid[1].v) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-   //    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-   end if;
-       A*H/n*eps* der(eps_vap[1]*rho_v[1]/MM_v[1]) = Vdot_v_in*rho_v_in/MM_v_in -  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_v_transfer[1,:]) + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1] + Ndot_source_startUp[1];
-else
-
-  /** Begin lowest stage (n=1) **/
-
-   // component balance for vapour
-  A*H/n*eps* der(eps_vap[1]*c_v[1,:]) = upStreamIn.Ndot*actualStream(upStreamIn.x_outflow) - Vdot_v[1] * c_v[1,:] + Ndot_v_transfer[1,:] + Vdot_v_feed[1]*c_v_feed[1,:] + Ndot_source_startUp[1]*x_v[1,:];
-    // component balance for liquid
-    A*H/n*eps* der(eps_liq[1]*c_l[1,:]) = Vdot_l[2]*c_l[2,:]  +  downStreamOut.Ndot * actualStream(downStreamOut.x_outflow) + Ndot_l_transfer[1,:] + Ndot_reac[1,:] + Vdot_l_feed[1]*c_l_feed[1,:] - Vdot_le[1]*c_l[1,:];
-
-  // total mole balance for liquid and vapour
-
-   if eps_liq[1]<1e-5 and Vdot_l[2]<1e-8 then
-     bool_eps[1]=true;
-     der(eps_liq[1])=0;
- else
-   bool_eps[1]=false;
-    A*H/n*eps* der(eps_liq[1]/mediumLiquid[1].v) =  Vdot_l[2]*rho_l[2]/MM_l[2] +downStreamOut.Ndot + sum(Ndot_l_transfer[1,:]) + sum(Ndot_reac[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-   //    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l[2]*rho_l[2]/MM_l[2] -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-   end if;
-        A*H/n*eps* der(eps_vap[1]*rho_v[1]/MM_v[1]) = upStreamIn.Ndot -  Vdot_v[1]*rho_v[1]/MM_v[1] + sum(Ndot_v_transfer[1,:]) + Vdot_v_feed[1]*rho_v_feed[1]/MM_v_feed[1] + Ndot_source_startUp[1];
-  /** End lowest stage (n=1) **/
-
-  /** Begin stages 2 to n-1 **/
-  for j in 2:n-1 loop
-    for i in 1:nSV loop
-     // component balance for vapour
-      A*H/n*eps* der(eps_vap[j]*c_v[j,i]) = Vdot_v[j-1]*c_v[j-1,i] - Vdot_v[j] * c_v[j,i] + Ndot_v_transfer[j,i] + Vdot_v_feed[j]*c_v_feed[j,i] + Ndot_source_startUp[j]*x_v[j,i];
-    end for;
-    for i in 1:nSL loop
-      // component balance for liquid
-      A*H/n*eps* der(eps_liq[j]*c_l[j,i]) = Vdot_l[j+1]*c_l[j+1,i] - Vdot_l[j] * c_l[j,i] + Ndot_l_transfer[j,i]+ Ndot_reac[j,i]+ Vdot_l_feed[j]*c_l_feed[j,i] + Vdot_le[j-1]*c_l[j-1,i] - Vdot_le[j]*c_l[j,i];
-    end for;
-   // total mole balance for liquid and vapour
-   if eps_liq[j]<1e-5 and Vdot_l[j+1]<1e-8 then
-     bool_eps[j]=true;
-    der(eps_liq[j])=0;
-   else
-     bool_eps[j]=false;
-   A*H/n*eps* der(eps_liq[j]/mediumLiquid[j].v) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(Ndot_reac[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
-   //   A*H/n*eps* der(eps_liq[j]*rho_l[j]/MM_l[j]) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(reaction.Ndot[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
-   end if;
-
- A*H/n*eps* der(eps_vap[j]*rho_v[j]/MM_v[j]) = Vdot_v[j-1]*rho_v[j-1]/MM_v[j-1] -  Vdot_v[j]*rho_v[j]/MM_v[j]  + sum(Ndot_v_transfer[j,:])+ Vdot_v_feed[j]*rho_v_feed[j]/MM_v_feed[j] + Ndot_source_startUp[j];
-   end for;
-  /** End stages 2 to n-1 **/
-
-  /** Begin highest stage (n=n) **/
-
-   // component balance for vapour
-    A*H/n*eps* der(eps_vap[n]*c_v[n,:]) = Vdot_v[n-1]*c_v[n-1,:] + upStreamOut.Ndot*actualStream(upStreamOut.x_outflow) + Ndot_v_transfer[n,:] + Vdot_v_feed[n]*c_v_feed[n,:]  + Ndot_source_startUp[n]*x_v[n,:];
-    // component balance for liquid
-   A*H/n*eps* der(eps_liq[n]*c_l[n,:]) = downStreamIn.Ndot * actualStream(downStreamIn.x_outflow) - Vdot_l[n] * c_l[n,:] + Ndot_l_transfer[n,:]+ Ndot_reac[n,:] + Vdot_l_feed[n]*c_l_feed[n,:] + Vdot_le[n-1]*c_l[n-1,:];
-  // total mole balance for liquid and vapour
-
-   if eps_liq[n]<1e-5 and Vdot_l_in<1e-8 then
-     bool_eps[n]=true;
-    der(eps_liq[n])=0;
-   else
-     bool_eps[n]=false;
-   A*H/n*eps* der(eps_liq[n]/mediumLiquid[n].v) = downStreamIn.Ndot -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(Ndot_reac[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
-   //   A*H/n*eps* der(eps_liq[n]*rho_l[n]/MM_l[n]) = Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(reaction.Ndot[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
-   end if;
-
-  A*H/n*eps* der(eps_vap[n]*rho_v[n]/MM_v[n]) = Vdot_v[n-1]*rho_v[n-1]/MM_v[n-1] +upStreamOut.Ndot + sum(Ndot_v_transfer[n,:])+ Vdot_v_feed[n]*rho_v_feed[n]/MM_v_feed[n] + Ndot_source_startUp[n];
-/** End highest stage (n=n) **/
-end if;
-
-  for j in 1:n loop
-//     sum(x_l[j,:])=1;
-//     sum(x_v[j,:])=1;
-    eps_vap[j] = 1- eps_liq[j];
+end for;
+/*** MOLE BALANCES ***/
+  if n == 1 then
+// component balance for vapour
+    A * H / n * eps * der(eps_vap[1] * c_v[1, :]) = upStreamIn.Ndot * actualStream(upStreamIn.x_outflow) + upStreamOut.Ndot * actualStream(upStreamOut.x_outflow) + Ndot_v_transfer[1, :] + Vdot_v_feed[1] * c_v_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :];
+// component balance for liquid
+    A * H / n * eps * der(eps_liq[1] * c_l[1, :]) = downStreamIn.Ndot * actualStream(downStreamIn.x_outflow) + downStreamOut.Ndot * actualStream(downStreamOut.x_outflow) + Ndot_l_transfer[1, :] + Ndot_reac[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour
+    if eps_liq[1] < 1e-5 and Vdot_l_in < 1e-8 then
+      bool_eps[1] = true;
+      der(eps_liq[1]) = 0;
+    else
+      bool_eps[1] = false;
+      A * H / n * eps * der(eps_liq[1] / mediumLiquid[1].v) = Vdot_l_in * rho_l_in / MM_l_in - Vdot_l[1] * rho_l[1] / MM_l[1] + sum(Ndot_l_transfer[1, :]) + sum(Ndot_reac[1, :]) + Vdot_l_feed[1] * rho_l_feed[1] / MM_l_feed[1] - Vdot_le[1] * rho_l[1] / MM_l[1];
+//    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
+    end if;
+    A * H / n * eps * der(eps_vap[1] * rho_v[1] / MM_v[1]) = Vdot_v_in * rho_v_in / MM_v_in - Vdot_v[1] * rho_v[1] / MM_v[1] + sum(Ndot_v_transfer[1, :]) + Vdot_v_feed[1] * rho_v_feed[1] / MM_v_feed[1] + Ndot_source_startUp[1];
+  else
+/** Begin lowest stage (n=1) **/
+// component balance for vapour
+    A * H / n * eps * der(eps_vap[1] * c_v[1, :]) = upStreamIn.Ndot * actualStream(upStreamIn.x_outflow) - Vdot_v[1] * c_v[1, :] + Ndot_v_transfer[1, :] + Vdot_v_feed[1] * c_v_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :];
+// component balance for liquid
+    A * H / n * eps * der(eps_liq[1] * c_l[1, :]) = Vdot_l[2] * c_l[2, :] + downStreamOut.Ndot * actualStream(downStreamOut.x_outflow) + Ndot_l_transfer[1, :] + Ndot_reac[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour
+    if eps_liq[1] < 1e-5 and Vdot_l[2] < 1e-8 then
+      bool_eps[1] = true;
+      der(eps_liq[1]) = 0;
+    else
+      bool_eps[1] = false;
+      A * H / n * eps * der(eps_liq[1] / mediumLiquid[1].v) = Vdot_l[2] * rho_l[2] / MM_l[2] + downStreamOut.Ndot + sum(Ndot_l_transfer[1, :]) + sum(Ndot_reac[1, :]) + Vdot_l_feed[1] * rho_l_feed[1] / MM_l_feed[1] - Vdot_le[1] * rho_l[1] / MM_l[1];
+//    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l[2]*rho_l[2]/MM_l[2] -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
+    end if;
+    A * H / n * eps * der(eps_vap[1] * rho_v[1] / MM_v[1]) = upStreamIn.Ndot - Vdot_v[1] * rho_v[1] / MM_v[1] + sum(Ndot_v_transfer[1, :]) + Vdot_v_feed[1] * rho_v_feed[1] / MM_v_feed[1] + Ndot_source_startUp[1];
+/** End lowest stage (n=1) **/
+/** Begin stages 2 to n-1 **/
+    for j in 2:n - 1 loop
+      for i in 1:nSV loop
+// component balance for vapour
+        A * H / n * eps * der(eps_vap[j] * c_v[j, i]) = Vdot_v[j - 1] * c_v[j - 1, i] - Vdot_v[j] * c_v[j, i] + Ndot_v_transfer[j, i] + Vdot_v_feed[j] * c_v_feed[j, i] + Ndot_source_startUp[j] * x_v[j, i];
+      end for;
+      for i in 1:nSL loop
+// component balance for liquid
+        A * H / n * eps * der(eps_liq[j] * c_l[j, i]) = Vdot_l[j + 1] * c_l[j + 1, i] - Vdot_l[j] * c_l[j, i] + Ndot_l_transfer[j, i] + Ndot_reac[j, i] + Vdot_l_feed[j] * c_l_feed[j, i] + Vdot_le[j - 1] * c_l[j - 1, i] - Vdot_le[j] * c_l[j, i];
+      end for;
+// total mole balance for liquid and vapour
+      if eps_liq[j] < 1e-5 and Vdot_l[j + 1] < 1e-8 then
+        bool_eps[j] = true;
+        der(eps_liq[j]) = 0;
+      else
+        bool_eps[j] = false;
+        A * H / n * eps * der(eps_liq[j] / mediumLiquid[j].v) = Vdot_l[j + 1] * rho_l[j + 1] / MM_l[j + 1] - Vdot_l[j] * rho_l[j] / MM_l[j] + sum(Ndot_l_transfer[j, :]) + sum(Ndot_reac[j, :]) + Vdot_l_feed[j] * rho_l_feed[j] / MM_l_feed[j] + Vdot_le[j - 1] * rho_l[j - 1] / MM_l[j - 1] - Vdot_le[j] * rho_l[j] / MM_l[j];
+//   A*H/n*eps* der(eps_liq[j]*rho_l[j]/MM_l[j]) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(reaction.Ndot[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
+      end if;
+      A * H / n * eps * der(eps_vap[j] * rho_v[j] / MM_v[j]) = Vdot_v[j - 1] * rho_v[j - 1] / MM_v[j - 1] - Vdot_v[j] * rho_v[j] / MM_v[j] + sum(Ndot_v_transfer[j, :]) + Vdot_v_feed[j] * rho_v_feed[j] / MM_v_feed[j] + Ndot_source_startUp[j];
+    end for;
+/** End stages 2 to n-1 **/
+/** Begin highest stage (n=n) **/
+// component balance for vapour
+    A * H / n * eps * der(eps_vap[n] * c_v[n, :]) = Vdot_v[n - 1] * c_v[n - 1, :] + upStreamOut.Ndot * actualStream(upStreamOut.x_outflow) + Ndot_v_transfer[n, :] + Vdot_v_feed[n] * c_v_feed[n, :] + Ndot_source_startUp[n] * x_v[n, :];
+// component balance for liquid
+    A * H / n * eps * der(eps_liq[n] * c_l[n, :]) = downStreamIn.Ndot * actualStream(downStreamIn.x_outflow) - Vdot_l[n] * c_l[n, :] + Ndot_l_transfer[n, :] + Ndot_reac[n, :] + Vdot_l_feed[n] * c_l_feed[n, :] + Vdot_le[n - 1] * c_l[n - 1, :];
+// total mole balance for liquid and vapour
+    if eps_liq[n] < 1e-5 and Vdot_l_in < 1e-8 then
+      bool_eps[n] = true;
+      der(eps_liq[n]) = 0;
+    else
+      bool_eps[n] = false;
+      A * H / n * eps * der(eps_liq[n] / mediumLiquid[n].v) = downStreamIn.Ndot - Vdot_l[n] * rho_l[n] / MM_l[n] + sum(Ndot_l_transfer[n, :]) + sum(Ndot_reac[n, :]) + Vdot_l_feed[n] * rho_l_feed[n] / MM_l_feed[n] + Vdot_le[n - 1] * rho_l[n - 1] / MM_l[n - 1];
+//   A*H/n*eps* der(eps_liq[n]*rho_l[n]/MM_l[n]) = Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(reaction.Ndot[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
+    end if;
+    A * H / n * eps * der(eps_vap[n] * rho_v[n] / MM_v[n]) = Vdot_v[n - 1] * rho_v[n - 1] / MM_v[n - 1] + upStreamOut.Ndot + sum(Ndot_v_transfer[n, :]) + Vdot_v_feed[n] * rho_v_feed[n] / MM_v_feed[n] + Ndot_source_startUp[n];
+/** End highest stage (n=n) **/
+  end if;
+ for j in 1:n loop
+//     sum(x_l[j,:])=1;
+//     sum(x_v[j,:])=1;
+    eps_vap[j] = 1 - eps_liq[j];
   end for;
 /*** ENERGY BALANCE ***/
 if n==1 then
@@ -524,13 +504,12 @@
   end for;
 A*H/n*eps * der(eps_vap[n]*sum(c_v[n,:])*u_v[n]) = Vdot_v[n-1] * sum(c_v[n-1,:])*mediumVapour[n-1].h + upStreamOut.Ndot*actualStream(upStreamOut.h_outflow) +Edot_v_transfer[n] + Vdot_v_feed[n]*sum(c_v_feed[n,:])*h_v_feed[n] + Ndot_source_startUp[n]*h_v[n];
 end if;
-  T=T_l;
-
-  //Saturation Pressure
-  for j in 1:n loop
-    p_sat_bulk[j,:]={mediumLiquid[j].p_sat[i] for i in 1:nSL};
-   /// p_sat[j,:]={mediumLiquid[j].p_sat[i] for i in 1:nSL};
-      p_sat[j,:]={mediumLiquidStar[j].p_sat[i] for i in 1:nSL};
+  T=T_l;
+//Saturation Pressure
+  for j in 1:n loop
+    p_sat_bulk[j, :] = {mediumLiquid[j].p_sat[i] for i in 1:nSL};
+/// p_sat[j,:]={mediumLiquid[j].p_sat[i] for i in 1:nSL};
+    p_sat[j, :] = {mediumLiquidStar[j].p_sat[i] for i in 1:nSL};
   end for;
 
 for j in 1:n loop
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/FeedColumn.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/FeedColumn.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/FeedColumn.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/FeedColumn.mo"	2022-03-10 09:58:38.812151831 +0000
@@ -1,13 +1,14 @@
 within ThermalSeparation.Components.Columns.BaseClasses;
 partial model FeedColumn
   "column with optional liquid and or vapour feed inlets"
- //extends BaseColumn;
+ //extends BaseColumn;
  extends ThermalSeparation.Components.Columns.BaseClasses.BaseColumn;
-// extends ThermalSeparation.Components.Columns.BaseClasses.BaseColumn_external;
-/***LIQUID FEED ***/
 
-//protected
-model InternalFeedPort "internal model for conditional stream connectors"
+// extends ThermalSeparation.Components.Columns.BaseClasses.BaseColumn_external;
+  /***LIQUID FEED ***/
+ //protected
+
+ model InternalFeedPort "internal model for conditional stream connectors"
   ThermalSeparation.Interfaces.LiquidPortOut          feedLiquidInternal;
   ThermalSeparation.Interfaces.GasPortOut          feedVapourInternal;
 end InternalFeedPort;
@@ -33,15 +34,18 @@
         MediumLiquid) if hasLiquidFeed
                      annotation (Placement(transformation(
           extent={{-94,-14},{-74,6}}, rotation=0), iconTransformation(extent={{
-            -94,-14},{-74,6}}))); // ;
-
+            -94,-14},{-74,6}}))); 
+// ;
   ThermalSeparation.Utilities.MediumLink mediumLink[n];
   MediumLiquid.BaseProperties mediumLiquidFeed[numberLiquidFeeds](each T0=T_ref, each p=p_v[n+1],h=actualStream(feedLiquid_dummy.h_outflow), x=actualStream(feedLiquid_dummy.x_outflow)) if                  hasLiquidFeed;
 
 /***VAPOUR FEED ***/
-//   ThermalSeparation.Interfaces.GasPortOut[n] feedVapourInternal(redeclare each
-//       package Medium =
-//         MediumVapour,                                                                                       x(start=x_v_start), c(start=c_v));
+
+//   ThermalSeparation.Interfaces.GasPortOut[n] feedVapourInternal(redeclare each
+
+//       package Medium =
+
+//         MediumVapour,                                                                                       x(start=x_v_start), c(start=c_v));
 protected
   parameter Integer[n-numberVapourFeedsInternal] testV(each fixed=false);
   parameter Integer[n] test2V(each fixed=false);
@@ -59,9 +63,9 @@
   parameter Integer[numberVapourFeeds] stageVapourFeed={1}
     "number of stage where feed enters the column" annotation(Dialog(enable = hasVapourFeed,tab="Feed", group="Vapour Feed"));
   final parameter Integer numberVapourFeedsInternal(min=0,max=n) = if hasVapourFeed then numberVapourFeeds else 0;
-//   ThermalSeparation.Utilities.LinkVapourSink[n] linkVapour(redeclare each
-//       package Medium =
-//         MediumVapour,   p=p_v[1:n]);
+ //   ThermalSeparation.Utilities.LinkVapourSink[n] linkVapour(redeclare each
+  //       package Medium =
+  //         MediumVapour,   p=p_v[1:n]);
   ThermalSeparation.Interfaces.GasPortIn[numberVapourFeeds]
                                                    feedVapour(redeclare each package
               Medium =
@@ -72,8 +76,7 @@
   ThermalSeparation.Utilities.MediumLink mediumVapourLink[n];
   MediumVapour.BaseProperties mediumVapourFeed[numberVapourFeeds](each T0=T_ref, each p=p_v[n+1],    c=c_v_feed_used, h=actualStream(feedVapour_dummy.h_outflow), x=actualStream(feedVapour_dummy.x_outflow),  x_star=actualStream(feedVapour_dummy.x_outflow)) if                   hasVapourFeed;
 
- // Modelica.Blocks.Interfaces.RealInput h_help;
-
+// Modelica.Blocks.Interfaces.RealInput h_help;
   ThermalSeparation.Interfaces.GasPortIn[numberVapourFeeds] feedVapour_dummy(redeclare each package Medium =
         MediumVapour);
   ThermalSeparation.Interfaces.LiquidPortIn[numberLiquidFeeds] feedLiquid_dummy(redeclare each package Medium =
@@ -126,88 +129,89 @@
 h_l_feed[j] = inStream(internalFeedPort[j].feedLiquidInternal.h_outflow);
 rho_l_feed[j] = mediumLink[j].mediumConIn.rho;
 MM_l_feed[j] = mediumLink[j].mediumConIn.MM;
-end for;
-
-/***LIQUID FEED ***/
-//conditional connectors feed
-for j in 1:numberLiquidFeeds loop
-  connect(feedLiquid[j],internalFeedPort[stageLiquidFeed[j]].feedLiquidInternal);
-  connect(mediumLink[stageLiquidFeed[j]].mediumConIn,mediumLiquidFeed[j].mediumConOut);
-end for;
+end for;
+/***LIQUID FEED ***/
+//conditional connectors feed
+  for j in 1:numberLiquidFeeds loop
+    connect(feedLiquid[j], internalFeedPort[stageLiquidFeed[j]].feedLiquidInternal);
+    connect(mediumLink[stageLiquidFeed[j]].mediumConIn, mediumLiquidFeed[j].mediumConOut);
+  end for;
 for j in 1:n loop
   internalFeedPort[j].feedLiquidInternal.p = p_v[j];
-end for;
-if hasLiquidFeed then
-   for j in 1:(n-numberLiquidFeeds) loop
-//      internalFeedPort[aux1[j]].feedLiquidInternal.h_outflow =1e5;// h_l[aux1[j]];//1e5;
-//      internalFeedPort[aux1[j]].feedLiquidInternal.x_outflow = 1/nSL * ones(nSL);//x_l[aux1[j],:];//1/nSL * ones(nSL);//
-     mediumLink[nonFeed_stages_l[j]].mediumConIn.h = 1;
-     mediumLink[nonFeed_stages_l[j]].mediumConIn.rho = 1;
-     mediumLink[nonFeed_stages_l[j]].mediumConIn.MM = 1;
-   end for;
-//    for j in 1:numberLiquidFeeds loop
-//      internalFeedPort[stageLiquidFeed[j]].feedLiquidInternal.h_outflow = h_l[stageLiquidFeed[j]];//1e5;
-//      internalFeedPort[stageLiquidFeed[j]].feedLiquidInternal.x_outflow = x_l[stageLiquidFeed[j],:];//1/nSL * ones(nSL);
-//    end for;
-  for j in 1:n loop
-    internalFeedPort[j].feedLiquidInternal.h_outflow = h_l[j];//1e5;
-    internalFeedPort[j].feedLiquidInternal.x_outflow = x_l[j,:];//nSL * ones(nSL);
-
-//      mediumLink[j].mediumConIn.h = 1;
-//      mediumLink[j].mediumConIn.rho = 1;
-//      mediumLink[j].mediumConIn.MM = 1;
-  end for;
-else
-  for j in 1:n loop
-    internalFeedPort[j].feedLiquidInternal.h_outflow = h_l[j];//1e5;
-    internalFeedPort[j].feedLiquidInternal.x_outflow = x_l[j,:];//nSL * ones(nSL);
-
-    mediumLink[j].mediumConIn.h = 1;
-    mediumLink[j].mediumConIn.rho = 1;
-    mediumLink[j].mediumConIn.MM = 1;
+end for;
+ if hasLiquidFeed then
+    for j in 1:n - numberLiquidFeeds loop
+//      internalFeedPort[aux1[j]].feedLiquidInternal.h_outflow =1e5;// h_l[aux1[j]];//1e5;
+//      internalFeedPort[aux1[j]].feedLiquidInternal.x_outflow = 1/nSL * ones(nSL);//x_l[aux1[j],:];//1/nSL * ones(nSL);//
+      mediumLink[nonFeed_stages_l[j]].mediumConIn.h = 1;
+      mediumLink[nonFeed_stages_l[j]].mediumConIn.rho = 1;
+      mediumLink[nonFeed_stages_l[j]].mediumConIn.MM = 1;
+    end for;
+//    for j in 1:numberLiquidFeeds loop
+//      internalFeedPort[stageLiquidFeed[j]].feedLiquidInternal.h_outflow = h_l[stageLiquidFeed[j]];//1e5;
+//      internalFeedPort[stageLiquidFeed[j]].feedLiquidInternal.x_outflow = x_l[stageLiquidFeed[j],:];//1/nSL * ones(nSL);
+//    end for;
+    for j in 1:n loop
+      internalFeedPort[j].feedLiquidInternal.h_outflow = h_l[j];
+//1e5;
+      internalFeedPort[j].feedLiquidInternal.x_outflow = x_l[j, :];
+//nSL * ones(nSL);
+//      mediumLink[j].mediumConIn.h = 1;
+//      mediumLink[j].mediumConIn.rho = 1;
+//      mediumLink[j].mediumConIn.MM = 1;
+    end for;
+  else
+    for j in 1:n loop
+      internalFeedPort[j].feedLiquidInternal.h_outflow = h_l[j];
+//1e5;
+      internalFeedPort[j].feedLiquidInternal.x_outflow = x_l[j, :];
+//nSL * ones(nSL);
+      mediumLink[j].mediumConIn.h = 1;
+      mediumLink[j].mediumConIn.rho = 1;
+      mediumLink[j].mediumConIn.MM = 1;
+    end for;
+  end if;
+/***VAPOUR FEED ***/
+//conditional connectors feed
+  for j in 1:numberVapourFeeds loop
+    connect(feedVapour[j], internalFeedPort[stageVapourFeed[j]].feedVapourInternal);
+    connect(mediumVapourLink[stageVapourFeed[j]].mediumConIn, mediumVapourFeed[j].mediumConOut);
   end for;
-end if;
-
-/***VAPOUR FEED ***/
-//conditional connectors feed
-for j in 1:numberVapourFeeds loop
-  connect(feedVapour[j],internalFeedPort[stageVapourFeed[j]].feedVapourInternal);
-  connect(mediumVapourLink[stageVapourFeed[j]].mediumConIn,mediumVapourFeed[j].mediumConOut);
-end for;
 for j in 1:n loop
   internalFeedPort[j].feedVapourInternal.p = p_v[j];
-end for;
-if hasVapourFeed then
-for j in 1:(n-numberVapourFeeds) loop
-  //internalFeedPort[testV[j]].feedVapourInternal.h_outflow = 1e5;//h_v[testV[j]];//1e5;//
-  //internalFeedPort[testV[j]].feedVapourInternal.x_outflow = 1/nSV * ones(nSV);//x_v[testV[j],:];//1/nSV * ones(nSV);//
-
-  mediumVapourLink[nonFeed_stages_v[j]].mediumConIn.h = 1;
-  mediumVapourLink[nonFeed_stages_v[j]].mediumConIn.rho = 1;
-  mediumVapourLink[nonFeed_stages_v[j]].mediumConIn.MM = 1;
-end for;
- for j in 1:n loop
-    internalFeedPort[j].feedVapourInternal.h_outflow = h_v[j];//1e5;
-    internalFeedPort[j].feedVapourInternal.x_outflow = x_v[j,:];//nSL * ones(nSL);
-
-    // mediumVapourLink[j].mediumConIn.h = 1;
-    // mediumVapourLink[j].mediumConIn.rho = 1;
-    // mediumVapourLink[j].mediumConIn.MM = 1;
-  end for;
-//   for j in 1:numberVapourFeeds loop
-//     internalFeedPort[stageVapourFeed[j]].feedVapourInternal.h_outflow = h_v[stageVapourFeed[j]];//1e5;
-//     internalFeedPort[stageVapourFeed[j]].feedVapourInternal.x_outflow = x_v[stageVapourFeed[j],:];//
-//   end for;
-else
-  for j in 1:n loop
-    internalFeedPort[j].feedVapourInternal.h_outflow = h_v[j];//1e5;
-    internalFeedPort[j].feedVapourInternal.x_outflow = x_v[j,:];//nSL * ones(nSL);
-
-    mediumVapourLink[j].mediumConIn.h = 1;
-    mediumVapourLink[j].mediumConIn.rho = 1;
-    mediumVapourLink[j].mediumConIn.MM = 1;
-  end for;
-end if;
+end for;
+ if hasVapourFeed then
+    for j in 1:n - numberVapourFeeds loop
+//internalFeedPort[testV[j]].feedVapourInternal.h_outflow = 1e5;//h_v[testV[j]];//1e5;//
+//internalFeedPort[testV[j]].feedVapourInternal.x_outflow = 1/nSV * ones(nSV);//x_v[testV[j],:];//1/nSV * ones(nSV);//
+      mediumVapourLink[nonFeed_stages_v[j]].mediumConIn.h = 1;
+      mediumVapourLink[nonFeed_stages_v[j]].mediumConIn.rho = 1;
+      mediumVapourLink[nonFeed_stages_v[j]].mediumConIn.MM = 1;
+    end for;
+    for j in 1:n loop
+      internalFeedPort[j].feedVapourInternal.h_outflow = h_v[j];
+//1e5;
+      internalFeedPort[j].feedVapourInternal.x_outflow = x_v[j, :];
+//nSL * ones(nSL);
+// mediumVapourLink[j].mediumConIn.h = 1;
+// mediumVapourLink[j].mediumConIn.rho = 1;
+// mediumVapourLink[j].mediumConIn.MM = 1;
+    end for;
+//   for j in 1:numberVapourFeeds loop
+//     internalFeedPort[stageVapourFeed[j]].feedVapourInternal.h_outflow = h_v[stageVapourFeed[j]];//1e5;
+//     internalFeedPort[stageVapourFeed[j]].feedVapourInternal.x_outflow = x_v[stageVapourFeed[j],:];//
+//   end for;
+  else
+    for j in 1:n loop
+      internalFeedPort[j].feedVapourInternal.h_outflow = h_v[j];
+//1e5;
+      internalFeedPort[j].feedVapourInternal.x_outflow = x_v[j, :];
+//nSL * ones(nSL);
+      mediumVapourLink[j].mediumConIn.h = 1;
+      mediumVapourLink[j].mediumConIn.rho = 1;
+      mediumVapourLink[j].mediumConIn.MM = 1;
+    end for;
+  end if;
 
 for i in 1:numberVapourFeeds loop
     c_v_feed_used[i]= c_v_feed[stageVapourFeed[i],:];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/Initialization/Homotopy/BaseHomotopy.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/Initialization/Homotopy/BaseHomotopy.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/Initialization/Homotopy/BaseHomotopy.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/Initialization/Homotopy/BaseHomotopy.mo"	2022-03-10 09:58:38.768151825 +0000
@@ -8,18 +8,18 @@
  parameter Integer n=1 "number of stages" annotation(Dialog(tab="Propagated by column model",enable=false));
  Boolean useHomotopy=false;
 
- Modelica.SIunits.MolarFlowRate Ndot_l_inter[n,nSL]=fill(0,n,nSL)
+ Modelica.Units.SI.MolarFlowRate Ndot_l_inter[n,nSL]=fill(0,n,nSL)
     "nominal molar flow across liquid phase boundary";
- Modelica.SIunits.MolarFlowRate Ndot_v_inter[n,nSV]=fill(0,n,nSV)
+ Modelica.Units.SI.MolarFlowRate Ndot_v_inter[n,nSV]=fill(0,n,nSV)
     "nominal molar flow across vapour phase boundary";
- Modelica.SIunits.HeatFlowRate Edot_l_inter[n]=fill(0,n)
+ Modelica.Units.SI.HeatFlowRate Edot_l_inter[n]=fill(0,n)
     "nominal heat flow rate across liquid phase boundary";
- Modelica.SIunits.HeatFlowRate Edot_v_inter[n]=fill(0,n)
+ Modelica.Units.SI.HeatFlowRate Edot_v_inter[n]=fill(0,n)
     "nominal heat flow rate across vapour phase boundary";
- Modelica.SIunits.Pressure dp=0.1e5 "nominal pressure loss";
+ Modelica.Units.SI.Pressure dp=0.1e5 "nominal pressure loss";
  Real K[nS]=fill(1,nS) "nominal equilibrium constant";
- Modelica.SIunits.Density rho_liq=1000 "nominal liquid density";
- Modelica.SIunits.Density rho_vap=1 "nominal vapour density";
+ Modelica.Units.SI.Density rho_liq=1000 "nominal liquid density";
+ Modelica.Units.SI.Density rho_vap=1 "nominal vapour density";
  ThermalSeparation.Units.MolarEnthalpy h_liq=2e3 "nominal liquid emthalpy";
  ThermalSeparation.Units.MolarEnthalpy h_vap=1.5e4 "nominal vapour enthalpy";
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/Initialization/Homotopy/UseHomotopy.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/Initialization/Homotopy/UseHomotopy.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/Initialization/Homotopy/UseHomotopy.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/Initialization/Homotopy/UseHomotopy.mo"	2022-03-10 09:58:38.752151822 +0000
@@ -24,18 +24,18 @@
 Boolean bool_rho=if not whichHomotopy[5] then false else true "true is homotopy is applied on liquid and vapour density";
 Boolean bool_h=if not whichHomotopy[6] then false else true "true is homotopy is applied on liquid and vapour enthalpy";
 
-parameter Modelica.SIunits.MolarFlowRate Ndot_l_inter_nom[n,nSL]=fill(0,n,nSL)
+parameter Modelica.Units.SI.MolarFlowRate Ndot_l_inter_nom[n,nSL]=fill(0,n,nSL)
     "nominal molar flow across liquid phase boundary"                                                                        annotation(Dialog(group="Nominal values - used if respective whichHomotopy is set true"));
-parameter Modelica.SIunits.MolarFlowRate Ndot_v_inter_nom[n,nSV]=fill(0,n,nSV)
+parameter Modelica.Units.SI.MolarFlowRate Ndot_v_inter_nom[n,nSV]=fill(0,n,nSV)
     "nominal molar flow across vapour phase boundary"                                                                         annotation(Dialog(group="Nominal values - used if respective whichHomotopy is set true"));
-parameter Modelica.SIunits.HeatFlowRate Edot_l_inter_nom[n]=fill(0,n)
+parameter Modelica.Units.SI.HeatFlowRate Edot_l_inter_nom[n]=fill(0,n)
     "nominal heat flow rate across liquid phase boundary"                                                                annotation(Dialog(group="Nominal values - used if respective whichHomotopy is set true"));
-parameter Modelica.SIunits.HeatFlowRate Edot_v_inter_nom[n]=fill(0,n)
+parameter Modelica.Units.SI.HeatFlowRate Edot_v_inter_nom[n]=fill(0,n)
     "nominal heat flow rate across vapour phase boundary"                                                                annotation(Dialog(group="Nominal values - used if respective whichHomotopy is set true"));
-parameter Modelica.SIunits.Pressure dp_nom=0.1e5 "nominal pressure loss" annotation(Dialog(group="Nominal values - used if respective whichHomotopy is set true"));
+parameter Modelica.Units.SI.Pressure dp_nom=0.1e5 "nominal pressure loss" annotation(Dialog(group="Nominal values - used if respective whichHomotopy is set true"));
 parameter Real K_nom[nS]=fill(1,nS) "nominal equilibrium constant" annotation(Dialog(group="Nominal values - used if respective whichHomotopy is set true"));
-parameter Modelica.SIunits.Density rho_liq_nom=1000 "nominal liquid density"              annotation(Dialog(group="Nominal values - used if respective whichHomotopy is set true"));
-parameter Modelica.SIunits.Density rho_vap_nom=1 "nominal vapour density"          annotation(Dialog(group="Nominal values - used if respective whichHomotopy is set true"));
+parameter Modelica.Units.SI.Density rho_liq_nom=1000 "nominal liquid density"              annotation(Dialog(group="Nominal values - used if respective whichHomotopy is set true"));
+parameter Modelica.Units.SI.Density rho_vap_nom=1 "nominal vapour density"          annotation(Dialog(group="Nominal values - used if respective whichHomotopy is set true"));
 parameter ThermalSeparation.Units.MolarEnthalpy h_liq_nom=2e3 "nominal liquid emthalpy"              annotation(Dialog(group="Nominal values - used if respective whichHomotopy is set true"));
 parameter ThermalSeparation.Units.MolarEnthalpy h_vap_nom=1.5e4 "nominal vapour enthalpy"          annotation(Dialog(group="Nominal values - used if respective whichHomotopy is set true"));
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/package.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/BaseClasses/package.mo"	2022-03-10 09:58:38.692151816 +0000
@@ -5,7 +5,7 @@
     parameter SI.Temperature T_ref = systemTS.T_ref "reference temperature" annotation (
       Dialog(tab = "Advanced"));
     parameter Integer n(min = 1) = 1 "packed column: number of discrete elements in the section; plate column: number of trays in one section";
-    //Initialization
+    //Initialization
     parameter SI.Pressure p_v_start_inlet = 1.9e5 annotation (
       Dialog(tab = "Initialization"));
     parameter SI.Pressure p_v_start_outlet = 1.8e5 annotation (
@@ -48,22 +48,22 @@
       Dialog(tab = "Initialization"));
     parameter SI.Temperature T_liquid_start = 300 annotation (
       Dialog(tab = "Initialization"));
-    //for equilibrium models, vapour start temperature always equals liquid start temperature
-    //   final parameter SI.Temperature T_v_start[n]= if EQ then (if T_l_profile then linspace(T_liq_start_bottom, T_liq_start_top, n) else ones(n)*T_liquid_start) else (if T_v_profile and not n==1 then linspace(T_vap_start_bottom, T_vap_start_top, n) else (if T_v_profile and n==1 then ones(n)*(T_vap_start_bottom+ T_vap_start_top)/2 else ones(n)*T_vapour_start));
-    //   final parameter SI.Temperature T_l_start[n]= if EQ then (if T_l_profile then linspace(T_liq_start_bottom, T_liq_start_top, n) else ones(n)*T_liquid_start) else (if T_l_profile and not n==1 then linspace(T_liq_start_bottom, T_liq_start_top, n) else (if T_l_profile and n==1 then ones(n)*(T_liq_start_bottom+ T_liq_start_top)/2 else ones(n)*T_liquid_start));
+    //for equilibrium models, vapour start temperature always equals liquid start temperature
+    //   final parameter SI.Temperature T_v_start[n]= if EQ then (if T_l_profile then linspace(T_liq_start_bottom, T_liq_start_top, n) else ones(n)*T_liquid_start) else (if T_v_profile and not n==1 then linspace(T_vap_start_bottom, T_vap_start_top, n) else (if T_v_profile and n==1 then ones(n)*(T_vap_start_bottom+ T_vap_start_top)/2 else ones(n)*T_vapour_start));
+    //   final parameter SI.Temperature T_l_start[n]= if EQ then (if T_l_profile then linspace(T_liq_start_bottom, T_liq_start_top, n) else ones(n)*T_liquid_start) else (if T_l_profile and not n==1 then linspace(T_liq_start_bottom, T_liq_start_top, n) else (if T_l_profile and n==1 then ones(n)*(T_liq_start_bottom+ T_liq_start_top)/2 else ones(n)*T_liquid_start));
     final parameter SI.Temperature T_v_start[n] = if T_v_profile and not n == 1 then linspace(T_vap_start_bottom, T_vap_start_top, n) else if T_v_profile and n == 1 then ones(n) * (T_vap_start_bottom + T_vap_start_top) / 2 else ones(n) * T_vapour_start;
     final parameter SI.Temperature T_l_start[n] = if T_l_profile and not n == 1 then linspace(T_liq_start_bottom, T_liq_start_top, n) else if T_l_profile and n == 1 then ones(n) * (T_liq_start_bottom + T_liq_start_top) / 2 else ones(n) * T_liquid_start;
-    // Homotopy-Method
+    // Homotopy-Method
     replaceable model HomotopyMethod = ThermalSeparation.Components.Columns.BaseClasses.Initialization.Homotopy.NoHomotopy constrainedby ThermalSeparation.Components.Columns.BaseClasses.Initialization.Homotopy.BaseHomotopy "activate homotopy and set nominal values" annotation (
        Dialog(tab = "Initialization", group = "Homotopy"),
        choicesAllMatching = true);
     HomotopyMethod homotopyMethod(nS = nS, n = n, nSV = nSV, nSL = nSL);
-    //Result-Record
+    //Result-Record
     Results results(n = n, nSL = nSL, nSV = nSV, T_l = T_l, x_l = x_l, x_v = x_v, x_l_star = x_l_star, x_v_star = x_v_star, c_l = c_l, c_v = c_v, p_v = p_v, Vdot_l = Vdot_l, Vdot_v = Vdot_v, eps_liq = eps_liq, startUp = startUp);
-    //Equilibrium or Non-Equilibrium model?
+    //Equilibrium or Non-Equilibrium model?
     parameter Boolean EQ = false "equilibrium model is used, no mass transfer, value provided by film model" annotation (
       Dialog(enable = false));
-    //Medium
+    //Medium
     parameter Integer mapping[nS, 2] = {{i, i} for i in 1:nS} "parameter to map the different medium vectors one to another";
     parameter Boolean inertVapour[nSV] = fill(false, nSV) "true for each component which is inert in the vapour phase";
     parameter Boolean inertLiquid[nSL] = fill(false, nSL) "true for each component which is inert in the liquid phase";
@@ -88,32 +88,32 @@
     final parameter Integer nSV = MediumVapour.nSubstance;
     /*** vapour properties ***/
     SI.Density rho_v[n] = if homotopyMethod.bool_rho and homotopyMethod.useHomotopy then homotopy(actual = mediumVapour.d, simplified = fill(homotopyMethod.rho_vap, n)) else mediumVapour.d "mixture vapour density";
-    // SI.Density rho_v[n]= mediumVapour.d "mixture vapour density";
+    // SI.Density rho_v[n]= mediumVapour.d "mixture vapour density";
     SI.Density rho_v_in = mediumVapourIn.d;
     SI.MolarMass MM_v[n](start = 0.028 * ones(n), each stateSelect = StateSelect.prefer) = mediumVapour.MM "molar mass of the vapour mixture ";
     SI.MolarMass MM_v_in(start = 0.03) = mediumVapourIn.MM;
     ThermalSeparation.Units.MolarEnthalpy h_v[n] = if homotopyMethod.bool_h and homotopyMethod.useHomotopy then homotopy(actual = mediumVapour.h, simplified = fill(homotopyMethod.h_vap, n)) else mediumVapour.h;
-    //ThermalSeparation.Units.MolarEnthalpy h_v[n] = mediumVapour.h;
+    //ThermalSeparation.Units.MolarEnthalpy h_v[n] = mediumVapour.h;
     ThermalSeparation.Units.MolarEnthalpy h_v_in = mediumVapourIn.h;
     SI.MolarInternalEnergy u_v[n](each stateSelect = StateSelect.default) = mediumVapour.u;
     SI.Concentration c_v_star[n, nSV](each start = 1);
     SI.Density rho_v_star[n] = mediumVapourStar.d;
     /*** liquid properties ***/
     SI.Density rho_l[n] = if homotopyMethod.bool_rho and homotopyMethod.useHomotopy then homotopy(actual = mediumLiquid.d, simplified = fill(homotopyMethod.rho_liq, n)) else mediumLiquid.d "mixture liquid density";
-    //   SI.Density rho_l[n] = mediumLiquid.d "mixture liquid density";
+    //   SI.Density rho_l[n] = mediumLiquid.d "mixture liquid density";
     SI.Density rho_l_in = mediumLiquidIn.d;
     SI.Density rho_l_star[n] = mediumLiquidStar.d;
     SI.MolarMass MM_l[n](start = fill(0.018, n)) = mediumLiquid.MM "molar mass of the liquid mixture";
     SI.MolarMass MM_l_in = mediumLiquidIn.MM;
     SI.MolarMass MM_l_star[n] = mediumLiquidStar.MM;
     ThermalSeparation.Units.MolarEnthalpy h_l[n];
-    //=if homotopyMethod.bool_h and homotopyMethod.useHomotopy then homotopy(actual=mediumLiquid.h,simplified=fill(homotopyMethod.h_liq,n)) else mediumLiquid.h;
-    //ThermalSeparation.Units.MolarEnthalpy h_l[n];
+    //=if homotopyMethod.bool_h and homotopyMethod.useHomotopy then homotopy(actual=mediumLiquid.h,simplified=fill(homotopyMethod.h_liq,n)) else mediumLiquid.h;
+    //ThermalSeparation.Units.MolarEnthalpy h_l[n];
     ThermalSeparation.Units.MolarEnthalpy h_l_in;
-    //=mediumLiquidIn.h;
+    //=mediumLiquidIn.h;
     ThermalSeparation.Units.MolarEnthalpy h_l_star[n];
     SI.MolarInternalEnergy u_l[n](each stateSelect = StateSelect.default) = mediumLiquid.u;
-    //Variables upStream
+    //Variables upStream
     SI.Concentration c_v_in[nSV](each start = 1);
     SI.Concentration c_v[n, nSV](each stateSelect = StateSelect.default, each start = 1) annotation (
       Dialog(group = "Initialization", showStartAttribute = true));
@@ -125,7 +125,7 @@
     SI.Temperature T_v_in(start = T_v_start[1]);
     SI.Pressure p_v[n + 1](start = fill(1.0e5, n + 1)) "p_v[j] = pressure on the j-th stage, p_v[n+1] is the pressure in the first element of the sucesseding component";
     SI.Temperature T_v[n](nominal = fill(350, n), start = fill(350, n));
-    //Variables downStream
+    //Variables downStream
     SI.Concentration c_l_in[nSL] "molar concentration in the liquid at the liquid outlet of each stage";
     SI.Concentration c_l[n, nSL](each stateSelect = StateSelect.default) annotation (
       Dialog(group = "Initialization", showStartAttribute = true));
@@ -136,10 +136,10 @@
     SI.Temperature T_l_in(start = T_l_start[n]);
     SI.Temperature T_l[n](start = T_l_start);
     SI.Concentration c_l_star[n, nSL];
-    //Model for reaction: to be supplied by extending class
+    //Model for reaction: to be supplied by extending class
     SI.MolarFlowRate Ndot_reac[n, nSL];
     SI.HeatFlowRate Qdot_reac[n];
-    //instances of connectores to next stage
+    //instances of connectores to next stage
     ThermalSeparation.Interfaces.GasPortIn upStreamIn(redeclare package Medium = MediumVapour) annotation (
       Placement(transformation(extent = {{-80, -100}, {-60, -80}}, rotation = 0), iconTransformation(extent = {{-80, -100}, {-60, -80}})));
     ThermalSeparation.Interfaces.GasPortOut upStreamOut(redeclare package Medium = MediumVapour) annotation (
@@ -148,12 +148,12 @@
       Placement(transformation(extent = {{60, 80}, {80, 100}}, rotation = 0), iconTransformation(extent = {{60, 80}, {80, 100}})));
     ThermalSeparation.Interfaces.LiquidPortOut downStreamOut(redeclare package Medium = MediumLiquid) annotation (
       Placement(transformation(extent = {{60, -100}, {80, -80}}, rotation = 0), iconTransformation(extent = {{60, -100}, {80, -80}})));
-    //initial equation for eps_liq is supplied in the extending class!
+    //initial equation for eps_liq is supplied in the extending class!
     SI.VolumeFraction eps_liq[n](each stateSelect = StateSelect.default) "liquid volume fraction";
     SI.VolumeFraction eps_vap[n](start = fill(0.99, n)) "vapour volume fraction";
     SI.Temperature T[n](start = T_l_start);
     SI.HeatFlowRate Qdot_wall[n] "heat flow rate to wall";
-    //to be supplied in extending class
+    //to be supplied in extending class
     SI.MolarFlowRate Ndot_v_transfer[n, nSV](start = fill(-0.1, n, nSV));
     SI.MolarFlowRate Ndot_l_transfer[n, nSL](start = fill(0.1, n, nSL));
     SI.HeatFlowRate Edot_l_transfer[n];
@@ -187,13 +187,13 @@
     parameter SI.Density rho_solid[n];
     parameter SI.SpecificHeatCapacity c_solid;
     /***variables for reorganisation of mediums in the medium vector ***/
-    //parameter Integer mL( fixed=false);
-    // parameter Integer mV(fixed=false);
-public
+    //parameter Integer mL( fixed=false);
+    // parameter Integer mV(fixed=false);
+  public
     Boolean bool_eps[n];
     /*** entrainment ***/
     SI.VolumeFlowRate Vdot_le[n] "liquid volume flow entrained by vapour";
-    // has to be supplied in extending class
+    // has to be supplied in extending class
     /*** StartUp ***/
     parameter Boolean considerStartUp = false "true if StartUp is to be considered" annotation (
       Dialog(tab = "StartUp"));
@@ -212,7 +212,7 @@
       Dialog(tab = "StartUp", enable = switchingCondition_Absorber_x_v));
     parameter SI.Pressure p_initial = 1e5 "pressure in column at start-up" annotation (
       Dialog(tab = "StartUp"));
-    //ujpStreamOut.p ;
+    //ujpStreamOut.p ;
     parameter Real gain = 0.01 "controler gain to maintain initial pressure before switch" annotation (
       Dialog(tab = "StartUp"));
     parameter Real k = 0.2e-3 "large value for steep omega" annotation (
@@ -235,15 +235,15 @@
     Boolean startUp[n](start = fill(true, n), each fixed = false);
     Boolean before_transition[n](start = fill(true, n), each fixed = false);
     Real transition_time[n](start = fill(1e7, n));
-    //Real switch_time[n](start=fill(1e7,n));
+    //Real switch_time[n](start=fill(1e7,n));
     Real Ndot_source_startUp[n] "dummy molar flow rate to account for discharge of inert gas during startUp";
-    //Real Ndot_source_startUp_l[n];
+    //Real Ndot_source_startUp_l[n];
     Real Ndot_source_shutDown[n] "dummy molar flow rate to avoid stiff system";
     Real N_dummyShutDown = 0.001 "dummy molar flow rate to avoid stiff system";
-    //Real Ndot_source_shutDown_l[n] "dummy molar flow rate to avoid stiff system";
-    //Real N_dummyShutDown_l=1 "dummy molar flow rate to avoid stiff system";
-    /*** monitoring ***/
-    //only for monitoring purpose: is the sum of the x really equal to one?
+    //Real Ndot_source_shutDown_l[n] "dummy molar flow rate to avoid stiff system";
+    //Real N_dummyShutDown_l=1 "dummy molar flow rate to avoid stiff system";
+    /*** monitoring ***/
+  //only for monitoring purpose: is the sum of the x really equal to one?
     Real sum_xl[n] = sum(x_l[:, i] for i in 1:nSL);
     Real sum_xv[n] = sum(x_v[:, i] for i in 1:nSV);
     Real sum_xl_star[n] = sum(x_l_star[:, i] for i in 1:nSL);
@@ -276,7 +276,7 @@
     // yMax=100,
     // k=0.005,
     // initType=Modelica.Blocks.Types.InitPID.InitialOutput)   annotation (Placement(transformation(extent={{-24,-12},{-4,8}})));
-    ThermalSeparation.Utilities.LimPID_Input PID[n](each u_s = p_initial, each controllerType = Modelica.Blocks.Types.SimpleController.P, each k = gain, each initType = Modelica.Blocks.Types.InitPID.NoInit, each yMax = y_PID) annotation (
+    ThermalSeparation.Utilities.LimPID_Input PID[n](each u_s = p_initial, each controllerType = Modelica.Blocks.Types.SimpleController.P, each k = gain, each initType = Modelica.Blocks.Types.Init.NoInit, each yMax = y_PID) annotation (
       Placement(transformation(extent = {{-20, 20}, {0, 40}})));
     Modelica.Blocks.Interfaces.BooleanInput StartUp_signal annotation (
       Placement(transformation(extent = {{-102, -66}, {-92, -56}})));
@@ -319,10 +319,10 @@
         end for;
       end for;
     end if;
-  equation
-    for j in 1:n loop
-    // PID[j].u_m = if considerStartUp  then p_v[j]  else p_initial;
-      PID[j].u_m = if considerStartUp and startUp[j] then p_v[j] else p_initial;
+  equation
+  for j in 1:n loop
+// PID[j].u_m = if considerStartUp  then p_v[j]  else p_initial;
+      PID[j].u_m = if considerStartUp and startUp[j] then p_v[j] else p_initial;
     end for;
   /***monitoring ***/
     for j in 1:n loop
@@ -331,9 +331,9 @@
       n_i_liq[j, :] = c_l[j, :] .* eps_liq[j] * A * H / n * eps;
       n_i_vap[j, :] = c_v[j, :] .* eps_vap[j] * A * H / n * eps;
     end for;
-    X_v_in[:] = x_v_in[:] / MM_v_in .* MediumVapour.MMX[:];
-  //Verknpfung der Konnektorgren mit Variablen
-  //upstream
+    X_v_in[:] = x_v_in[:] / MM_v_in .* MediumVapour.MMX[:];
+//Verknpfung der Konnektorgren mit Variablen
+//upstream
     x_v_in = inStream(upStreamIn.x_outflow);
     h_v_in = inStream(upStreamIn.h_outflow);
     c_v_in = x_v_in / MM_v_in * rho_v_in;
@@ -349,131 +349,131 @@
     downStreamIn.x_outflow = x_l[n, :];
     downStreamIn.h_outflow = h_l[n];
     upStreamIn.p = p_v_in;
-    upStreamOut.p = p_hyd[n + 1];
-    if ShutDown_signal and time >= 100 then
-      if nSV >= 3 then
-        N_dummyShutDown = Ndot_v_in;
-      //upStreamIn.Ndot + N_dummyShutDown = Ndot_v_in;
-      else
-        upStreamIn.Ndot + N_dummyShutDown = Ndot_v_in;
-      end if;
-    else
-      upStreamIn.Ndot = Ndot_v_in;
-    end if;
-  //     if ShutDown_signal and time >100 then
-  //       if nSV>=3 then
-  //       //downStreamIn.Ndot+ N_dummyShutDown_l = Ndot_l_in;
-  //       N_dummyShutDown_l = Ndot_l_in;
-  //       else
-  //       downStreamIn.Ndot + N_dummyShutDown_l = Ndot_l_in;
-  //       end if;
-  //     else
-  //      downStreamIn.Ndot = Ndot_l_in;
-  //     end if;
-  //upStreamIn.Ndot = Ndot_v_in;
-    upStreamOut.Ndot = -Ndot_v[n];
-  //upStreamOut.p_medium = p_hyd[n];
+    upStreamOut.p = p_hyd[n + 1];
+  if ShutDown_signal and time >= 100 then
+      if nSV >= 3 then
+        N_dummyShutDown = Ndot_v_in;
+//upStreamIn.Ndot + N_dummyShutDown = Ndot_v_in;
+      else
+        upStreamIn.Ndot + N_dummyShutDown = Ndot_v_in;
+      end if;
+    else
+      upStreamIn.Ndot = Ndot_v_in;
+    end if;
+//     if ShutDown_signal and time >100 then
+//       if nSV>=3 then
+//       //downStreamIn.Ndot+ N_dummyShutDown_l = Ndot_l_in;
+//       N_dummyShutDown_l = Ndot_l_in;
+//       else
+//       downStreamIn.Ndot + N_dummyShutDown_l = Ndot_l_in;
+//       end if;
+//     else
+//      downStreamIn.Ndot = Ndot_l_in;
+//     end if;
+//upStreamIn.Ndot = Ndot_v_in;
+    upStreamOut.Ndot = -Ndot_v[n];
+//upStreamOut.p_medium = p_hyd[n];
     downStreamIn.p = p_hyd[n + 1];
     downStreamIn.Ndot = Ndot_l_in;
     downStreamOut.Ndot = -Ndot_l[1];
     Vdot_v = Ndot_v ./ rho_v .* MM_v "total molar flow rate vapour";
     Vdot_v_in = Ndot_v_in / rho_v_in * MM_v_in "total molar flow rate vapour";
     Vdot_l = Ndot_l ./ rho_l .* MM_l "total molar flow rate liquid";
-    Vdot_l_in = Ndot_l_in / rho_l_in * MM_l_in "total molar flow rate vapour";
-  /***eps_liq > 1: Betriebsendpunkt erreicht, allerdings ist beim Anfahrvorgang u.U. eps_liq = 1 ***/
-    for j in 1:n loop
-    // assert(eps_liq[j] < 0.99, "liquid volume fraction eps_liq gets larger than 1, the column can not be operated at this point!");
-    end for;
-  /*** StartUp ***/
-    if considerStartUp then
-      if StartUp_CCS then
-        if switchingCondition_Boiling then
-        //Desorber
-          for j in 1:n loop
-            if internalStepSequence[j].ColdState.active then
-              p_hyd[j] = p_v[j];
-              omega[j] = 1;
-              Ndot_source_startUp[j] = PID[j].y;
-              Ndot_source_shutDown[j] = 0;
-            elseif internalStepSequence[j].HeatUpState.active then
-              p_hyd[j] = p_v[j];
-              omega[j] = 1;
-              Ndot_source_startUp[j] = 0;
-              Ndot_source_shutDown[j] = 0;
-            elseif internalStepSequence[j].ShutDown.active then
-              p_hyd[j] = p_v[j];
-              omega[j] = 1;
-              if j == 1 then
-                Ndot_source_startUp[j] = 0.0001;
-                Ndot_source_shutDown[j] = (-Ndot_source_startUp[j]) - N_dummyShutDown;
-              else
-                Ndot_source_startUp[j] = 0.0001;
-                Ndot_source_shutDown[j] = -Ndot_source_startUp[j];
-              end if;
-            else
-              p_hyd[j] = p_v[j];
-              omega[j] = 1;
-              Ndot_source_startUp[j] = 0;
-              Ndot_source_shutDown[j] = 0;
-            end if;
-          end for;
-        else
-        //Absorber
-          for j in 1:n loop
-            if internalStepSequence[j].ColdState.active then
-              p_hyd[j] = p_v[j];
-              omega[j] = 1;
-              Ndot_source_startUp[j] = PID[j].y;
-              Ndot_source_shutDown[j] = 0;
-            elseif internalStepSequence[j].ShutDown.active then
-              p_hyd[j] = p_v[j];
-              omega[j] = 1;
-              if j == 1 then
-                Ndot_source_startUp[j] = 0.0001;
-                Ndot_source_shutDown[j] = (-Ndot_source_startUp[j]) - N_dummyShutDown;
-              else
-                Ndot_source_startUp[j] = 0.0001;
-                Ndot_source_shutDown[j] = -Ndot_source_startUp[j];
-              end if;
-            else
-              p_hyd[j] = p_v[j];
-              omega[j] = 1;
-              Ndot_source_startUp[j] = 0;
-              Ndot_source_shutDown[j] = 0;
-            end if;
-          end for;
-        end if;
-      else
-        for j in 1:n loop
-          when p_bub[j] + friggelfaktor >= p_initial then
-          // der Druck, den auch das Medienmodell sieht, friggelfaktor, weil sonst Umschalten zu spt
-            startUp[j] = false;
-          end when;
-        //      if p_bub[j] <= p_v[j] then
-        //        omega[j] = min(1,1 + tanh(k*(p_bub[j] + friggelfaktor - p_initial)));
-        //      else
-        //        omega[j] = 1;
-        //      end if;
-          omega[j] = min(1, 1 + tanh(k * (p_bub[j] + friggelfaktor - p_initial)));
-        //   p_hyd[j] = if startUp[j] then p_initial else p_v[j];
-          p_hyd[j] = p_initial * (1 - omega[j]) + p_v[j] * omega[j];
-          if startUp[j] then
-            Ndot_source_startUp[j] = PID[j].y;
-          else
-            Ndot_source_startUp[j] = 0;
-          end if;
-        end for;
-      end if;
-    else
-      startUp = fill(false, n);
-      for j in 1:n loop
-        Ndot_source_startUp[j] = 0;
-      end for;
-      omega = ones(n);
-      p_hyd = p_v;
-      before_transition = fill(false, n);
-      transition_time = fill(0, n);
-      startUp = fill(false, n);
+    Vdot_l_in = Ndot_l_in / rho_l_in * MM_l_in "total molar flow rate vapour";
+/***eps_liq > 1: Betriebsendpunkt erreicht, allerdings ist beim Anfahrvorgang u.U. eps_liq = 1 ***/
+    for j in 1:n loop
+// assert(eps_liq[j] < 0.99, "liquid volume fraction eps_liq gets larger than 1, the column can not be operated at this point!");
+    end for;
+/*** StartUp ***/
+    if considerStartUp then
+      if StartUp_CCS then
+        if switchingCondition_Boiling then
+//Desorber
+          for j in 1:n loop
+            if internalStepSequence[j].ColdState.active then
+              p_hyd[j] = p_v[j];
+              omega[j] = 1;
+              Ndot_source_startUp[j] = PID[j].y;
+              Ndot_source_shutDown[j] = 0;
+            elseif internalStepSequence[j].HeatUpState.active then
+              p_hyd[j] = p_v[j];
+              omega[j] = 1;
+              Ndot_source_startUp[j] = 0;
+              Ndot_source_shutDown[j] = 0;
+            elseif internalStepSequence[j].ShutDown.active then
+              p_hyd[j] = p_v[j];
+              omega[j] = 1;
+              if j == 1 then
+                Ndot_source_startUp[j] = 0.0001;
+                Ndot_source_shutDown[j] = (-Ndot_source_startUp[j]) - N_dummyShutDown;
+              else
+                Ndot_source_startUp[j] = 0.0001;
+                Ndot_source_shutDown[j] = -Ndot_source_startUp[j];
+              end if;
+            else
+              p_hyd[j] = p_v[j];
+              omega[j] = 1;
+              Ndot_source_startUp[j] = 0;
+              Ndot_source_shutDown[j] = 0;
+            end if;
+          end for;
+        else
+//Absorber
+          for j in 1:n loop
+            if internalStepSequence[j].ColdState.active then
+              p_hyd[j] = p_v[j];
+              omega[j] = 1;
+              Ndot_source_startUp[j] = PID[j].y;
+              Ndot_source_shutDown[j] = 0;
+            elseif internalStepSequence[j].ShutDown.active then
+              p_hyd[j] = p_v[j];
+              omega[j] = 1;
+              if j == 1 then
+                Ndot_source_startUp[j] = 0.0001;
+                Ndot_source_shutDown[j] = (-Ndot_source_startUp[j]) - N_dummyShutDown;
+              else
+                Ndot_source_startUp[j] = 0.0001;
+                Ndot_source_shutDown[j] = -Ndot_source_startUp[j];
+              end if;
+            else
+              p_hyd[j] = p_v[j];
+              omega[j] = 1;
+              Ndot_source_startUp[j] = 0;
+              Ndot_source_shutDown[j] = 0;
+            end if;
+          end for;
+        end if;
+      else
+        for j in 1:n loop
+          when p_bub[j] + friggelfaktor >= p_initial then
+// der Druck, den auch das Medienmodell sieht, friggelfaktor, weil sonst Umschalten zu spt
+            startUp[j] = false;
+          end when;
+//      if p_bub[j] <= p_v[j] then
+//        omega[j] = min(1,1 + tanh(k*(p_bub[j] + friggelfaktor - p_initial)));
+//      else
+//        omega[j] = 1;
+//      end if;
+          omega[j] = min(1, 1 + tanh(k * (p_bub[j] + friggelfaktor - p_initial)));
+//   p_hyd[j] = if startUp[j] then p_initial else p_v[j];
+          p_hyd[j] = p_initial * (1 - omega[j]) + p_v[j] * omega[j];
+          if startUp[j] then
+            Ndot_source_startUp[j] = PID[j].y;
+          else
+            Ndot_source_startUp[j] = 0;
+          end if;
+        end for;
+      end if;
+    else
+      startUp = fill(false, n);
+      for j in 1:n loop
+        Ndot_source_startUp[j] = 0;
+      end for;
+      omega = ones(n);
+      p_hyd = p_v;
+      before_transition = fill(false, n);
+      transition_time = fill(0, n);
+      startUp = fill(false, n);
     end if;
     p_hyd[n + 1] = p_v[n + 1];
   /*** give startup information to film model ***/
@@ -489,24 +489,24 @@
       when time >= transition_time[j] + 2 * delay_startUp and internalStepSequence[j].NormalOperation.active then
         startUp[j] = false;
       end when;
-    end for;
-  /*** calculation of molar fraction using the pressure and the molar concentration ***/
-    for j in 1:n loop
-      c_l_star[j, :] = x_l_star[j, :] / MM_l_star[j] * rho_l_star[j];
-      c_v_star[j, :] = x_v_star[j, :] / MM_v_star[j] * rho_v_star[j];
-    // c_l_star[j,i] = (x_l_star[j,i]+x_l[j,i])/2 / MM_l_star[j]*rho_l_star[j];
-      for i in 1:nS loop
-      // x_l[j,i] = if use_v then c_l[j,i] * mediumLiquid[j].v else c_l[j,i] * MM_l[j] /rho_l[j];
-        x_l[j, i] = c_l[j, i] * mediumLiquid[j].v;
-        x_v[j, i] = c_v[j, i] * MM_v[j] / rho_v[j];
-      end for;
-      for i in 1:nL loop
-        x_l[j, i + nS] = c_l[j, i + nS] * mediumLiquid[j].v;
-      //x_l[j,i+nS] = if use_v then c_l[j,i+nS] *mediumLiquid[j].v else c_l[j,i+nS] * MM_l[j] /rho_l[j];
-      end for;
-      for i in 1:nV loop
-        x_v[j, i + nS] = c_v[j, i + nS] * MM_v[j] / rho_v[j];
-      end for;
+    end for;
+/*** calculation of molar fraction using the pressure and the molar concentration ***/
+    for j in 1:n loop
+      c_l_star[j, :] = x_l_star[j, :] / MM_l_star[j] * rho_l_star[j];
+      c_v_star[j, :] = x_v_star[j, :] / MM_v_star[j] * rho_v_star[j];
+// c_l_star[j,i] = (x_l_star[j,i]+x_l[j,i])/2 / MM_l_star[j]*rho_l_star[j];
+      for i in 1:nS loop
+// x_l[j,i] = if use_v then c_l[j,i] * mediumLiquid[j].v else c_l[j,i] * MM_l[j] /rho_l[j];
+        x_l[j, i] = c_l[j, i] * mediumLiquid[j].v;
+        x_v[j, i] = c_v[j, i] * MM_v[j] / rho_v[j];
+      end for;
+      for i in 1:nL loop
+        x_l[j, i + nS] = c_l[j, i + nS] * mediumLiquid[j].v;
+//x_l[j,i+nS] = if use_v then c_l[j,i+nS] *mediumLiquid[j].v else c_l[j,i+nS] * MM_l[j] /rho_l[j];
+      end for;
+      for i in 1:nV loop
+        x_v[j, i + nS] = c_v[j, i + nS] * MM_v[j] / rho_v[j];
+      end for;
     end for;
     for i in 1:nSL loop
     end for;
@@ -518,83 +518,83 @@
         bool_eps[j] = if eps_liq[j] < 1e-5 and Vdot_l[j + 1] < 1e-8 then true else false;
       end for;
       bool_eps[n] = if eps_liq[n] < 1e-5 and Vdot_l_in < 1e-8 then true else false;
-    end if;
-  /*** MOLE BALANCES ***/
-    if n == 1 then
-    // component balance for vapour
-      A * H / n * eps * der(eps_vap[1] * c_v[1, :]) = upStreamIn.Ndot * actualStream(upStreamIn.x_outflow) + upStreamOut.Ndot * actualStream(upStreamOut.x_outflow) + Ndot_v_transfer[1, :] + Vdot_v_feed[1] * c_v_feed[1, :];
-    // component balance for liquid
-      A * H / n * eps * der(eps_liq[1] * c_l[1, :]) = downStreamIn.Ndot * actualStream(downStreamIn.x_outflow) + downStreamOut.Ndot * actualStream(downStreamOut.x_outflow) + Ndot_l_transfer[1, :] + Ndot_reac[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] - Vdot_le[1] * c_l[1, :];
-    // total mole balance for liquid and vapour
-      if eps_liq[1] < 1e-5 and Vdot_l_in < 1e-8 then
-      // bool_eps[1]=true;
-        der(eps_liq[1]) = 0;
-      else
-      //bool_eps[1]=false;
-        A * H / n * eps * der(eps_liq[1] / mediumLiquid[1].v) = Vdot_l_in * rho_l_in / MM_l_in - Vdot_l[1] * rho_l[1] / MM_l[1] + sum(Ndot_l_transfer[1, :]) + sum(Ndot_reac[1, :]) + Vdot_l_feed[1] * rho_l_feed[1] / MM_l_feed[1] - Vdot_le[1] * rho_l[1] / MM_l[1];
-      //    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-      end if;
-      A * H / n * eps * der(eps_vap[1] * rho_v[1] / MM_v[1]) = Vdot_v_in * rho_v_in / MM_v_in - Vdot_v[1] * rho_v[1] / MM_v[1] + sum(Ndot_v_transfer[1, :]) + Vdot_v_feed[1] * rho_v_feed[1] / MM_v_feed[1] + Ndot_source_startUp[1] + Ndot_source_shutDown[1];
-    else
-    /** Begin lowest stage (n=1) **/
-    // component balance for vapour
-      A * H / n * eps * der(eps_vap[1] * c_v[1, :]) = upStreamIn.Ndot * actualStream(upStreamIn.x_outflow) - Vdot_v[1] * c_v[1, :] + Ndot_v_transfer[1, :] + Vdot_v_feed[1] * c_v_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :] + Ndot_source_shutDown[1] * x_v_dummy[:];
-    // component balance for liquid
-      A * H / n * eps * der(eps_liq[1] * c_l[1, :]) = Vdot_l[2] * c_l[2, :] + downStreamOut.Ndot * actualStream(downStreamOut.x_outflow) + Ndot_l_transfer[1, :] + Ndot_reac[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] - Vdot_le[1] * c_l[1, :];
-    // total mole balance for liquid and vapour
-      if eps_liq[1] < 1e-5 and Vdot_l[2] < 1e-8 then
-      //bool_eps[1]=true;
-        der(eps_liq[1]) = 0;
-      else
-      // bool_eps[1]=false;
-        A * H / n * eps * der(eps_liq[1] / mediumLiquid[1].v) = Vdot_l[2] * rho_l[2] / MM_l[2] + downStreamOut.Ndot + sum(Ndot_l_transfer[1, :]) + sum(Ndot_reac[1, :]) + Vdot_l_feed[1] * rho_l_feed[1] / MM_l_feed[1] - Vdot_le[1] * rho_l[1] / MM_l[1];
-      //    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l[2]*rho_l[2]/MM_l[2] -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
-      end if;
-      A * H / n * eps * der(eps_vap[1] * rho_v[1] / MM_v[1]) = upStreamIn.Ndot - Vdot_v[1] * rho_v[1] / MM_v[1] + sum(Ndot_v_transfer[1, :]) + Vdot_v_feed[1] * rho_v_feed[1] / MM_v_feed[1] + Ndot_source_startUp[1] + Ndot_source_shutDown[1];
-    /** End lowest stage (n=1) **/
-    /** Begin stages 2 to n-1 **/
-      for j in 2:n - 1 loop
-        for i in 1:nSV loop
-        // component balance for vapour
-          A * H / n * eps * der(eps_vap[j] * c_v[j, i]) = Vdot_v[j - 1] * c_v[j - 1, i] - Vdot_v[j] * c_v[j, i] + Ndot_v_transfer[j, i] + Vdot_v_feed[j] * c_v_feed[j, i] + Ndot_source_startUp[j] * x_v[j, i] + Ndot_source_shutDown[j] * x_v_dummy[i];
-        end for;
-        for i in 1:nSL loop
-        // component balance for liquid
-          A * H / n * eps * der(eps_liq[j] * c_l[j, i]) = Vdot_l[j + 1] * c_l[j + 1, i] - Vdot_l[j] * c_l[j, i] + Ndot_l_transfer[j, i] + Ndot_reac[j, i] + Vdot_l_feed[j] * c_l_feed[j, i] + Vdot_le[j - 1] * c_l[j - 1, i] - Vdot_le[j] * c_l[j, i];
-        end for;
-      // total mole balance for liquid and vapour
-        if eps_liq[j] < 1e-5 and Vdot_l[j + 1] < 1e-8 then
-        // bool_eps[j]=true;
-          der(eps_liq[j]) = 0;
-        else
-        //bool_eps[j]=false;
-          A * H / n * eps * der(eps_liq[j] / mediumLiquid[j].v) = Vdot_l[j + 1] * rho_l[j + 1] / MM_l[j + 1] - Vdot_l[j] * rho_l[j] / MM_l[j] + sum(Ndot_l_transfer[j, :]) + sum(Ndot_reac[j, :]) + Vdot_l_feed[j] * rho_l_feed[j] / MM_l_feed[j] + Vdot_le[j - 1] * rho_l[j - 1] / MM_l[j - 1] - Vdot_le[j] * rho_l[j] / MM_l[j];
-        //   A*H/n*eps* der(eps_liq[j]*rho_l[j]/MM_l[j]) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(reaction.Ndot[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
-        end if;
-        A * H / n * eps * der(eps_vap[j] * rho_v[j] / MM_v[j]) = Vdot_v[j - 1] * rho_v[j - 1] / MM_v[j - 1] - Vdot_v[j] * rho_v[j] / MM_v[j] + sum(Ndot_v_transfer[j, :]) + Vdot_v_feed[j] * rho_v_feed[j] / MM_v_feed[j] + Ndot_source_startUp[j] + Ndot_source_shutDown[j];
-      end for;
-    /** End stages 2 to n-1 **/
-    /** Begin highest stage (n=n) **/
-    // component balance for vapour
-      A * H / n * eps * der(eps_vap[n] * c_v[n, :]) = Vdot_v[n - 1] * c_v[n - 1, :] + upStreamOut.Ndot * actualStream(upStreamOut.x_outflow) + Ndot_v_transfer[n, :] + Vdot_v_feed[n] * c_v_feed[n, :] + Ndot_source_startUp[n] * x_v[n, :] + Ndot_source_shutDown[n] * x_v_dummy[:];
-    // component balance for liquid
-      A * H / n * eps * der(eps_liq[n] * c_l[n, :]) = downStreamIn.Ndot * actualStream(downStreamIn.x_outflow) - Vdot_l[n] * c_l[n, :] + Ndot_l_transfer[n, :] + Ndot_reac[n, :] + Vdot_l_feed[n] * c_l_feed[n, :] + Vdot_le[n - 1] * c_l[n - 1, :];
-    // total mole balance for liquid and vapour
-      if eps_liq[n] < 1e-5 and Vdot_l_in < 1e-8 then
-      //bool_eps[n]=true;
-        der(eps_liq[n]) = 0;
-      else
-      //bool_eps[n]=false;
-        A * H / n * eps * der(eps_liq[n] / mediumLiquid[n].v) = downStreamIn.Ndot - Vdot_l[n] * rho_l[n] / MM_l[n] + sum(Ndot_l_transfer[n, :]) + sum(Ndot_reac[n, :]) + Vdot_l_feed[n] * rho_l_feed[n] / MM_l_feed[n] + Vdot_le[n - 1] * rho_l[n - 1] / MM_l[n - 1];
-      //   A*H/n*eps* der(eps_liq[n]*rho_l[n]/MM_l[n]) = Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(reaction.Ndot[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
-      end if;
-      A * H / n * eps * der(eps_vap[n] * rho_v[n] / MM_v[n]) = Vdot_v[n - 1] * rho_v[n - 1] / MM_v[n - 1] + upStreamOut.Ndot + sum(Ndot_v_transfer[n, :]) + Vdot_v_feed[n] * rho_v_feed[n] / MM_v_feed[n] + Ndot_source_startUp[n] + Ndot_source_shutDown[n];
-    /** End highest stage (n=n) **/
-    end if;
-    for j in 1:n loop
-    //     sum(x_l[j,:])=1;
-    //     sum(x_v[j,:])=1;
-      eps_vap[j] = 1 - eps_liq[j];
+    end if;
+/*** MOLE BALANCES ***/
+    if n == 1 then
+// component balance for vapour
+      A * H / n * eps * der(eps_vap[1] * c_v[1, :]) = upStreamIn.Ndot * actualStream(upStreamIn.x_outflow) + upStreamOut.Ndot * actualStream(upStreamOut.x_outflow) + Ndot_v_transfer[1, :] + Vdot_v_feed[1] * c_v_feed[1, :];
+// component balance for liquid
+      A * H / n * eps * der(eps_liq[1] * c_l[1, :]) = downStreamIn.Ndot * actualStream(downStreamIn.x_outflow) + downStreamOut.Ndot * actualStream(downStreamOut.x_outflow) + Ndot_l_transfer[1, :] + Ndot_reac[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour
+      if eps_liq[1] < 1e-5 and Vdot_l_in < 1e-8 then
+// bool_eps[1]=true;
+        der(eps_liq[1]) = 0;
+      else
+//bool_eps[1]=false;
+        A * H / n * eps * der(eps_liq[1] / mediumLiquid[1].v) = Vdot_l_in * rho_l_in / MM_l_in - Vdot_l[1] * rho_l[1] / MM_l[1] + sum(Ndot_l_transfer[1, :]) + sum(Ndot_reac[1, :]) + Vdot_l_feed[1] * rho_l_feed[1] / MM_l_feed[1] - Vdot_le[1] * rho_l[1] / MM_l[1];
+//    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
+      end if;
+      A * H / n * eps * der(eps_vap[1] * rho_v[1] / MM_v[1]) = Vdot_v_in * rho_v_in / MM_v_in - Vdot_v[1] * rho_v[1] / MM_v[1] + sum(Ndot_v_transfer[1, :]) + Vdot_v_feed[1] * rho_v_feed[1] / MM_v_feed[1] + Ndot_source_startUp[1] + Ndot_source_shutDown[1];
+    else
+/** Begin lowest stage (n=1) **/
+// component balance for vapour
+      A * H / n * eps * der(eps_vap[1] * c_v[1, :]) = upStreamIn.Ndot * actualStream(upStreamIn.x_outflow) - Vdot_v[1] * c_v[1, :] + Ndot_v_transfer[1, :] + Vdot_v_feed[1] * c_v_feed[1, :] + Ndot_source_startUp[1] * x_v[1, :] + Ndot_source_shutDown[1] * x_v_dummy[:];
+// component balance for liquid
+      A * H / n * eps * der(eps_liq[1] * c_l[1, :]) = Vdot_l[2] * c_l[2, :] + downStreamOut.Ndot * actualStream(downStreamOut.x_outflow) + Ndot_l_transfer[1, :] + Ndot_reac[1, :] + Vdot_l_feed[1] * c_l_feed[1, :] - Vdot_le[1] * c_l[1, :];
+// total mole balance for liquid and vapour
+      if eps_liq[1] < 1e-5 and Vdot_l[2] < 1e-8 then
+//bool_eps[1]=true;
+        der(eps_liq[1]) = 0;
+      else
+// bool_eps[1]=false;
+        A * H / n * eps * der(eps_liq[1] / mediumLiquid[1].v) = Vdot_l[2] * rho_l[2] / MM_l[2] + downStreamOut.Ndot + sum(Ndot_l_transfer[1, :]) + sum(Ndot_reac[1, :]) + Vdot_l_feed[1] * rho_l_feed[1] / MM_l_feed[1] - Vdot_le[1] * rho_l[1] / MM_l[1];
+//    A*H/n*eps* der(eps_liq[1]*rho_l[1]/MM_l[1]) =  Vdot_l[2]*rho_l[2]/MM_l[2] -  Vdot_l[1]*rho_l[1]/MM_l[1] + sum(Ndot_l_transfer[1,:]) + sum(reaction.Ndot[1,:]) + Vdot_l_feed[1]*rho_l_feed[1]/MM_l_feed[1] - Vdot_le[1]*rho_l[1]/MM_l[1];
+      end if;
+      A * H / n * eps * der(eps_vap[1] * rho_v[1] / MM_v[1]) = upStreamIn.Ndot - Vdot_v[1] * rho_v[1] / MM_v[1] + sum(Ndot_v_transfer[1, :]) + Vdot_v_feed[1] * rho_v_feed[1] / MM_v_feed[1] + Ndot_source_startUp[1] + Ndot_source_shutDown[1];
+/** End lowest stage (n=1) **/
+/** Begin stages 2 to n-1 **/
+      for j in 2:n - 1 loop
+        for i in 1:nSV loop
+// component balance for vapour
+          A * H / n * eps * der(eps_vap[j] * c_v[j, i]) = Vdot_v[j - 1] * c_v[j - 1, i] - Vdot_v[j] * c_v[j, i] + Ndot_v_transfer[j, i] + Vdot_v_feed[j] * c_v_feed[j, i] + Ndot_source_startUp[j] * x_v[j, i] + Ndot_source_shutDown[j] * x_v_dummy[i];
+        end for;
+        for i in 1:nSL loop
+// component balance for liquid
+          A * H / n * eps * der(eps_liq[j] * c_l[j, i]) = Vdot_l[j + 1] * c_l[j + 1, i] - Vdot_l[j] * c_l[j, i] + Ndot_l_transfer[j, i] + Ndot_reac[j, i] + Vdot_l_feed[j] * c_l_feed[j, i] + Vdot_le[j - 1] * c_l[j - 1, i] - Vdot_le[j] * c_l[j, i];
+        end for;
+// total mole balance for liquid and vapour
+        if eps_liq[j] < 1e-5 and Vdot_l[j + 1] < 1e-8 then
+// bool_eps[j]=true;
+          der(eps_liq[j]) = 0;
+        else
+//bool_eps[j]=false;
+          A * H / n * eps * der(eps_liq[j] / mediumLiquid[j].v) = Vdot_l[j + 1] * rho_l[j + 1] / MM_l[j + 1] - Vdot_l[j] * rho_l[j] / MM_l[j] + sum(Ndot_l_transfer[j, :]) + sum(Ndot_reac[j, :]) + Vdot_l_feed[j] * rho_l_feed[j] / MM_l_feed[j] + Vdot_le[j - 1] * rho_l[j - 1] / MM_l[j - 1] - Vdot_le[j] * rho_l[j] / MM_l[j];
+//   A*H/n*eps* der(eps_liq[j]*rho_l[j]/MM_l[j]) = Vdot_l[j+1]*rho_l[j+1]/MM_l[j+1] -  Vdot_l[j]*rho_l[j]/MM_l[j]  + sum(Ndot_l_transfer[j,:])+ sum(reaction.Ndot[j,:]) + Vdot_l_feed[j]*rho_l_feed[j]/MM_l_feed[j] + Vdot_le[j-1]*rho_l[j-1]/MM_l[j-1] - Vdot_le[j]*rho_l[j]/MM_l[j];
+        end if;
+        A * H / n * eps * der(eps_vap[j] * rho_v[j] / MM_v[j]) = Vdot_v[j - 1] * rho_v[j - 1] / MM_v[j - 1] - Vdot_v[j] * rho_v[j] / MM_v[j] + sum(Ndot_v_transfer[j, :]) + Vdot_v_feed[j] * rho_v_feed[j] / MM_v_feed[j] + Ndot_source_startUp[j] + Ndot_source_shutDown[j];
+      end for;
+/** End stages 2 to n-1 **/
+/** Begin highest stage (n=n) **/
+// component balance for vapour
+      A * H / n * eps * der(eps_vap[n] * c_v[n, :]) = Vdot_v[n - 1] * c_v[n - 1, :] + upStreamOut.Ndot * actualStream(upStreamOut.x_outflow) + Ndot_v_transfer[n, :] + Vdot_v_feed[n] * c_v_feed[n, :] + Ndot_source_startUp[n] * x_v[n, :] + Ndot_source_shutDown[n] * x_v_dummy[:];
+// component balance for liquid
+      A * H / n * eps * der(eps_liq[n] * c_l[n, :]) = downStreamIn.Ndot * actualStream(downStreamIn.x_outflow) - Vdot_l[n] * c_l[n, :] + Ndot_l_transfer[n, :] + Ndot_reac[n, :] + Vdot_l_feed[n] * c_l_feed[n, :] + Vdot_le[n - 1] * c_l[n - 1, :];
+// total mole balance for liquid and vapour
+      if eps_liq[n] < 1e-5 and Vdot_l_in < 1e-8 then
+//bool_eps[n]=true;
+        der(eps_liq[n]) = 0;
+      else
+//bool_eps[n]=false;
+        A * H / n * eps * der(eps_liq[n] / mediumLiquid[n].v) = downStreamIn.Ndot - Vdot_l[n] * rho_l[n] / MM_l[n] + sum(Ndot_l_transfer[n, :]) + sum(Ndot_reac[n, :]) + Vdot_l_feed[n] * rho_l_feed[n] / MM_l_feed[n] + Vdot_le[n - 1] * rho_l[n - 1] / MM_l[n - 1];
+//   A*H/n*eps* der(eps_liq[n]*rho_l[n]/MM_l[n]) = Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l[n]*rho_l[n]/MM_l[n] + sum(Ndot_l_transfer[n,:])+ sum(reaction.Ndot[n,:]) + Vdot_l_feed[n]*rho_l_feed[n]/MM_l_feed[n] + Vdot_le[n-1]*rho_l[n-1]/MM_l[n-1];
+      end if;
+      A * H / n * eps * der(eps_vap[n] * rho_v[n] / MM_v[n]) = Vdot_v[n - 1] * rho_v[n - 1] / MM_v[n - 1] + upStreamOut.Ndot + sum(Ndot_v_transfer[n, :]) + Vdot_v_feed[n] * rho_v_feed[n] / MM_v_feed[n] + Ndot_source_startUp[n] + Ndot_source_shutDown[n];
+/** End highest stage (n=n) **/
+    end if;
+  for j in 1:n loop
+//     sum(x_l[j,:])=1;
+//     sum(x_v[j,:])=1;
+      eps_vap[j] = 1 - eps_liq[j];
     end for;
   /*** ENERGY BALANCE ***/
     if n == 1 then
@@ -612,12 +612,12 @@
       end for;
       A * H / n * eps * der(eps_vap[n] * sum(c_v[n, :]) * u_v[n]) = Vdot_v[n - 1] * sum(c_v[n - 1, :]) * mediumVapour[n - 1].h + upStreamOut.Ndot * actualStream(upStreamOut.h_outflow) + Edot_v_transfer[n] + Vdot_v_feed[n] * sum(c_v_feed[n, :]) * h_v_feed[n] + Ndot_source_startUp[n] * h_v[n];
     end if;
-    T = T_l;
-  //Saturation Pressure
-    for j in 1:n loop
-      p_sat_bulk[j, :] = {mediumLiquid[j].p_sat[i] for i in 1:nSL};
-    /// p_sat[j,:]={mediumLiquid[j].p_sat[i] for i in 1:nSL};
-      p_sat[j, :] = {mediumLiquidStar[j].p_sat[i] for i in 1:nSL};
+    T = T_l;
+//Saturation Pressure
+    for j in 1:n loop
+      p_sat_bulk[j, :] = {mediumLiquid[j].p_sat[i] for i in 1:nSL};
+/// p_sat[j,:]={mediumLiquid[j].p_sat[i] for i in 1:nSL};
+      p_sat[j, :] = {mediumLiquidStar[j].p_sat[i] for i in 1:nSL};
     end for;
     for j in 1:n loop
       n_mol_L[j] = A * H / n * eps * eps_liq[j] * rho_l_star[j] / MM_l_star[j];
@@ -756,10 +756,10 @@
   end InternalStepSequence;
 
   partial model FeedColumn_newStartUpShutDown "column with optional liquid and or vapour feed inlets"
-    //extends BaseColumn;
+    //extends BaseColumn;
     extends ThermalSeparation.Components.Columns.BaseClasses.BaseColumn_newStartUpShutDown;
     /***LIQUID FEED ***/
-    //protected
+    //protected
 
     model InternalFeedPort "internal model for conditional stream connectors"
       Interfaces.LiquidPortOut feedLiquidInternal;
@@ -784,10 +784,10 @@
     ThermalSeparation.Utilities.MediumLink mediumLink[n];
     MediumLiquid.BaseProperties mediumLiquidFeed[numberLiquidFeeds](each T0 = T_ref, each p = p_v[n + 1], h = actualStream(feedLiquid.h_outflow), x = actualStream(feedLiquid.x_outflow)) if hasLiquidFeed;
     /***VAPOUR FEED ***/
-    //   ThermalSeparation.Interfaces.GasPortOut[n] feedVapourInternal(redeclare each
-    //       package Medium =
-    //         MediumVapour,                                                                                       x(start=x_v_start), c(start=c_v));
-protected
+    //   ThermalSeparation.Interfaces.GasPortOut[n] feedVapourInternal(redeclare each
+    //       package Medium =
+    //         MediumVapour,                                                                                       x(start=x_v_start), c(start=c_v));
+  protected
     parameter Integer[n - numberVapourFeedsInternal] testV(each fixed = false);
     parameter Integer[n] test2V(each fixed = false);
     parameter Integer counterLV(fixed = false) "counting the stages; equals n at end of algorithm";
@@ -799,14 +799,14 @@
     parameter Integer[numberVapourFeeds] stageVapourFeed = {1} "number of stage where feed enters the column" annotation (
       Dialog(enable = hasVapourFeed, tab = "Feed", group = "Vapour Feed"));
     final parameter Integer numberVapourFeedsInternal(min = 0, max = n) = if hasVapourFeed then numberVapourFeeds else 0;
-    //   ThermalSeparation.Utilities.LinkVapourSink[n] linkVapour(redeclare each
-    //       package Medium =
-    //         MediumVapour,   p=p_v[1:n]);
+    //   ThermalSeparation.Utilities.LinkVapourSink[n] linkVapour(redeclare each
+    //       package Medium =
+    //         MediumVapour,   p=p_v[1:n]);
     Interfaces.GasPortIn[numberVapourFeeds] feedVapour(redeclare each package Medium = MediumVapour) if hasVapourFeed annotation (
       Placement(transformation(extent = {{-94, 8}, {-74, 28}}, rotation = 0), iconTransformation(extent = {{-94, 8}, {-74, 28}})));
     ThermalSeparation.Utilities.MediumLink mediumVapourLink[n];
     MediumVapour.BaseProperties mediumVapourFeed[numberVapourFeeds](each T0 = T_ref, each p = p_v[n + 1], h = actualStream(feedVapour.h_outflow), c = c_v_feed_used, x = actualStream(feedVapour.x_outflow), x_star = actualStream(feedVapour.x_outflow)) if hasVapourFeed;
-    //c=c_v_feed,
+    //c=c_v_feed,
     ThermalSeparation.Interfaces.GasPortIn[numberVapourFeeds] feedVapour_dummy(redeclare each package Medium = MediumVapour);
     ThermalSeparation.Interfaces.LiquidPortIn[numberLiquidFeeds] feedLiquid_dummy(redeclare each package Medium = MediumLiquid);
     ThermalSeparation.Interfaces.GasPortOut[numberVapourFeeds] feedVapour_dummy2(redeclare each package Medium = MediumVapour) if not hasVapourFeed;
@@ -847,78 +847,78 @@
       h_l_feed[j] = inStream(internalFeedPort[j].feedLiquidInternal.h_outflow);
       rho_l_feed[j] = mediumLink[j].mediumConIn.rho;
       MM_l_feed[j] = mediumLink[j].mediumConIn.MM;
-    end for;
-  /***LIQUID FEED ***/
-  //conditional connectors feed
-    for j in 1:numberLiquidFeeds loop
-      connect(feedLiquid[j], internalFeedPort[stageLiquidFeed[j]].feedLiquidInternal);
-      connect(mediumLink[stageLiquidFeed[j]].mediumConIn, mediumLiquidFeed[j].mediumConOut);
+    end for;
+/***LIQUID FEED ***/
+//conditional connectors feed
+    for j in 1:numberLiquidFeeds loop
+      connect(feedLiquid[j], internalFeedPort[stageLiquidFeed[j]].feedLiquidInternal);
+      connect(mediumLink[stageLiquidFeed[j]].mediumConIn, mediumLiquidFeed[j].mediumConOut);
     end for;
     for j in 1:n loop
       internalFeedPort[j].feedLiquidInternal.p = p_v[j];
-    end for;
-    if hasLiquidFeed then
-      for j in 1:n - numberLiquidFeeds loop
-        internalFeedPort[aux1[j]].feedLiquidInternal.h_outflow = h_l[aux1[j]];
-      //1e5;
-        internalFeedPort[aux1[j]].feedLiquidInternal.x_outflow = x_l[aux1[j], :];
-      //1/nSL * ones(nSL);//
-        mediumLink[aux1[j]].mediumConIn.h = 1;
-        mediumLink[aux1[j]].mediumConIn.rho = 1;
-        mediumLink[aux1[j]].mediumConIn.MM = 1;
-      end for;
-      for j in 1:numberLiquidFeeds loop
-        internalFeedPort[stageLiquidFeed[j]].feedLiquidInternal.h_outflow = h_l[stageLiquidFeed[j]];
-      //1e5;
-        internalFeedPort[stageLiquidFeed[j]].feedLiquidInternal.x_outflow = x_l[stageLiquidFeed[j], :];
-      //1/nSL * ones(nSL);
-      end for;
-    else
-      for j in 1:n loop
-        internalFeedPort[j].feedLiquidInternal.h_outflow = h_l[j];
-      //1e5;
-        internalFeedPort[j].feedLiquidInternal.x_outflow = x_l[j, :];
-      //nSL * ones(nSL);
-        mediumLink[j].mediumConIn.h = 1;
-        mediumLink[j].mediumConIn.rho = 1;
-        mediumLink[j].mediumConIn.MM = 1;
-      end for;
-    end if;
-  /***VAPOUR FEED ***/
-  //conditional connectors feed
-    for j in 1:numberVapourFeeds loop
-      connect(feedVapour[j], internalFeedPort[stageVapourFeed[j]].feedVapourInternal);
-      connect(mediumVapourLink[stageVapourFeed[j]].mediumConIn, mediumVapourFeed[j].mediumConOut);
+    end for;
+  if hasLiquidFeed then
+      for j in 1:n - numberLiquidFeeds loop
+        internalFeedPort[aux1[j]].feedLiquidInternal.h_outflow = h_l[aux1[j]];
+//1e5;
+        internalFeedPort[aux1[j]].feedLiquidInternal.x_outflow = x_l[aux1[j], :];
+//1/nSL * ones(nSL);//
+        mediumLink[aux1[j]].mediumConIn.h = 1;
+        mediumLink[aux1[j]].mediumConIn.rho = 1;
+        mediumLink[aux1[j]].mediumConIn.MM = 1;
+      end for;
+      for j in 1:numberLiquidFeeds loop
+        internalFeedPort[stageLiquidFeed[j]].feedLiquidInternal.h_outflow = h_l[stageLiquidFeed[j]];
+//1e5;
+        internalFeedPort[stageLiquidFeed[j]].feedLiquidInternal.x_outflow = x_l[stageLiquidFeed[j], :];
+//1/nSL * ones(nSL);
+      end for;
+    else
+      for j in 1:n loop
+        internalFeedPort[j].feedLiquidInternal.h_outflow = h_l[j];
+//1e5;
+        internalFeedPort[j].feedLiquidInternal.x_outflow = x_l[j, :];
+//nSL * ones(nSL);
+        mediumLink[j].mediumConIn.h = 1;
+        mediumLink[j].mediumConIn.rho = 1;
+        mediumLink[j].mediumConIn.MM = 1;
+      end for;
+    end if;
+/***VAPOUR FEED ***/
+//conditional connectors feed
+    for j in 1:numberVapourFeeds loop
+      connect(feedVapour[j], internalFeedPort[stageVapourFeed[j]].feedVapourInternal);
+      connect(mediumVapourLink[stageVapourFeed[j]].mediumConIn, mediumVapourFeed[j].mediumConOut);
     end for;
     for j in 1:n loop
       internalFeedPort[j].feedVapourInternal.p = p_v[j];
-    end for;
-    if hasVapourFeed then
-      for j in 1:n - numberVapourFeeds loop
-        internalFeedPort[testV[j]].feedVapourInternal.h_outflow = h_v[testV[j]];
-      //1e5;//
-        internalFeedPort[testV[j]].feedVapourInternal.x_outflow = x_v[testV[j], :];
-      //1/nSV * ones(nSV);//
-        mediumVapourLink[testV[j]].mediumConIn.h = 1;
-        mediumVapourLink[testV[j]].mediumConIn.rho = 1;
-        mediumVapourLink[testV[j]].mediumConIn.MM = 1;
-      end for;
-      for j in 1:numberVapourFeeds loop
-        internalFeedPort[stageVapourFeed[j]].feedVapourInternal.h_outflow = h_v[stageVapourFeed[j]];
-      //1e5;
-        internalFeedPort[stageVapourFeed[j]].feedVapourInternal.x_outflow = x_v[stageVapourFeed[j], :];
-      //
-      end for;
-    else
-      for j in 1:n loop
-        internalFeedPort[j].feedVapourInternal.h_outflow = h_v[j];
-      //1e5;
-        internalFeedPort[j].feedVapourInternal.x_outflow = x_v[j, :];
-      //nSL * ones(nSL);
-        mediumVapourLink[j].mediumConIn.h = 1;
-        mediumVapourLink[j].mediumConIn.rho = 1;
-        mediumVapourLink[j].mediumConIn.MM = 1;
-      end for;
+    end for;
+  if hasVapourFeed then
+      for j in 1:n - numberVapourFeeds loop
+        internalFeedPort[testV[j]].feedVapourInternal.h_outflow = h_v[testV[j]];
+//1e5;//
+        internalFeedPort[testV[j]].feedVapourInternal.x_outflow = x_v[testV[j], :];
+//1/nSV * ones(nSV);//
+        mediumVapourLink[testV[j]].mediumConIn.h = 1;
+        mediumVapourLink[testV[j]].mediumConIn.rho = 1;
+        mediumVapourLink[testV[j]].mediumConIn.MM = 1;
+      end for;
+      for j in 1:numberVapourFeeds loop
+        internalFeedPort[stageVapourFeed[j]].feedVapourInternal.h_outflow = h_v[stageVapourFeed[j]];
+//1e5;
+        internalFeedPort[stageVapourFeed[j]].feedVapourInternal.x_outflow = x_v[stageVapourFeed[j], :];
+//
+      end for;
+    else
+      for j in 1:n loop
+        internalFeedPort[j].feedVapourInternal.h_outflow = h_v[j];
+//1e5;
+        internalFeedPort[j].feedVapourInternal.x_outflow = x_v[j, :];
+//nSL * ones(nSL);
+        mediumVapourLink[j].mediumConIn.h = 1;
+        mediumVapourLink[j].mediumConIn.rho = 1;
+        mediumVapourLink[j].mediumConIn.MM = 1;
+      end for;
     end if;
     for i in 1:numberVapourFeeds loop
       c_v_feed_used[i] = c_v_feed[stageVapourFeed[i], :];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/OldStartUpExample.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/OldStartUpExample.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/OldStartUpExample.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/OldStartUpExample.mo"	2022-03-10 09:58:38.356151772 +0000
@@ -3,8 +3,7 @@
 
   model MA_EQ_Cond_startUp "for different reflux ratios"
     import ThermalSeparation;
-    //Lauftest: 10.12.2011
-
+    //Lauftest: 10.12.2011
     inner ThermalSeparation.SystemTS systemTS(T_ref=298.15)
       annotation (Placement(transformation(extent={{60,100},{80,120}})));
 
@@ -149,13 +148,13 @@
   output Real PID_y = PID.y;
   output Real refluxRatio= refluxConverter.y;
   /*** monitoring ***/
-  output Modelica.SIunits.MoleFraction x_1m[4]=reactor.x_l[2, :];
-   Modelica.SIunits.MoleFraction x_2m[4]=reactor.x_l_in;
-   Modelica.SIunits.MoleFraction x_3m[4]=separator.x_l_in;
-   Modelica.SIunits.MoleFraction x_reboiler[4]=sump.x_l[1,:];
-   Modelica.SIunits.Temperature T_1m=reactor.T_l[2];
-   Modelica.SIunits.Temperature T_3m=separator.T_l_in;
-   Modelica.SIunits.Temperature T_reboiler=sump.T[1];
+  output Modelica.Units.SI.MoleFraction x_1m[4]=reactor.x_l[2, :];
+   Modelica.Units.SI.MoleFraction x_2m[4]=reactor.x_l_in;
+   Modelica.Units.SI.MoleFraction x_3m[4]=separator.x_l_in;
+   Modelica.Units.SI.MoleFraction x_reboiler[4]=sump.x_l[1,:];
+   Modelica.Units.SI.Temperature T_1m=reactor.T_l[2];
+   Modelica.Units.SI.Temperature T_3m=separator.T_l_in;
+   Modelica.Units.SI.Temperature T_reboiler=sump.T[1];
     ThermalSeparation.Components.Condenser.TotalCondenser kondensator(
       redeclare package MediumVapour =
           ThermalSeparation.Media.Methylacetatsynthese_Vap,
@@ -284,7 +283,7 @@
     Modelica.Blocks.Continuous.LimPID PID(
       controllerType=Modelica.Blocks.Types.SimpleController.PI,
       Ti=1,
-      initType=Modelica.Blocks.Types.InitPID.InitialOutput,
+      initType=Modelica.Blocks.Types.Init.InitialOutput,
       y_start=10,
       k=1e-1,
       yMin=0.2,
@@ -301,8 +300,7 @@
       annotation (Placement(transformation(extent={{-102,38},{-82,58}})));
   equation
        PID.u_m = if time < start_Reflux then PID.u_s else separator.x_l_in[1];
-  //refluxConverter.u = if time < start_Reflux then switch1.y else PID.y;
-
+//refluxConverter.u = if time < start_Reflux then switch1.y else PID.y;
     connect(separator.heatPort, ambientHeatSink2.heatPort1)     annotation (
         Line(
         points={{7.68,122},{8.87,122},{8.87,124},{12.4,124}},
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/StructuredPackedColumn_newStartUpShutDown.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/StructuredPackedColumn_newStartUpShutDown.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/StructuredPackedColumn_newStartUpShutDown.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Columns/StructuredPackedColumn_newStartUpShutDown.mo"	2022-03-10 09:58:38.248151758 +0000
@@ -11,7 +11,7 @@
     final n=n_elements,
     final EQ=filmModel.EQ,
     PID(each controllerType=Modelica.Blocks.Types.SimpleController.P, each initType=
-          Modelica.Blocks.Types.InitPID.NoInit));
+          Modelica.Blocks.Types.Init.NoInit));
 
    replaceable model InitOption =
     ThermalSeparation.Components.Columns.BaseClasses.Initialization.Init_T_xv_p_Ndot0
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnsNoIndex/BaseClasses/BaseColumn_external.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnsNoIndex/BaseClasses/BaseColumn_external.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnsNoIndex/BaseClasses/BaseColumn_external.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnsNoIndex/BaseClasses/BaseColumn_external.mo"	2022-03-10 09:58:38.204151753 +0000
@@ -288,12 +288,12 @@
                                               n](each u_s = p_initial,
       each yMax=100,
       each k=0.5,
-     each initType=Modelica.Blocks.Types.InitPID.InitialOutput)   annotation (Placement(transformation(extent={{-24,-12},{-4,8}})));
+     each initType=Modelica.Blocks.Types.Init.InitialOutput)   annotation (Placement(transformation(extent={{-24,-12},{-4,8}})));
 
 /*** changes to reduce index ***/
-Modelica.SIunits.AmountOfSubstance n_mol[n,nS];
-Modelica.SIunits.AmountOfSubstance n_mol_L[n](stateSelect=StateSelect.prefer);
-Modelica.SIunits.AmountOfSubstance n_mol_V[n](stateSelect=StateSelect.prefer);
+Modelica.Units.SI.AmountOfSubstance n_mol[n,nS];
+Modelica.Units.SI.AmountOfSubstance n_mol_L[n](stateSelect=StateSelect.prefer);
+Modelica.Units.SI.AmountOfSubstance n_mol_V[n](stateSelect=StateSelect.prefer);
 Real n_mol_L_i[n,nSL](stateSelect=StateSelect.prefer);
 Real n_mol_V_i[n,nSV](stateSelect=StateSelect.prefer);
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnsNoIndex/StructuredPackedColumn_external.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnsNoIndex/StructuredPackedColumn_external.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnsNoIndex/StructuredPackedColumn_external.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/ColumnsNoIndex/StructuredPackedColumn_external.mo"	2022-03-10 09:58:38.044151733 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Components.ColumnsNoIndex;
+within ThermalSeparation.Components.ColumnsNoIndex;
 model StructuredPackedColumn_external
      extends ThermalSeparation.Icons.Color.PackedColumn;
   extends ThermalSeparation.Components.ColumnsNoIndex.BaseClasses.FeedColumn(
@@ -20,11 +20,11 @@
  redeclare package MediumVapour = MediumVapour,
  propsLiq = mediumLiquid.properties,   considerStartUp =   considerStartUp,
  Edot_l_transfer=Edot_l_transfer,c_l=c_l,nS=nS, mapping=mapping, n=n, nSL=nSL, inertLiquid=inertLiquid, inertVapour=inertVapour, nSV=nSV, p_v=p_v[1:n], p_v_start=p_v_start, Ndot_v_transfer=Ndot_v_transfer, x_l=x_l, x_v=x_v, x_l_start=x_l_start, x_v_start=x_v_start, n_mol_L=n_mol_L, n_mol_V=n_mol_V, x_l_star=x_l_star, x_v_star=x_v_star, x_total_start=x_total_start, T_v=T_v, T_l=T_l, T_v_start=T_v_start, T_l_start=T_l_start);
-// c_A in mol_A / m3_gas ODER mol_A / m3_flÃ¼ssig
-// rho_v in mol_ges(vap)/m3_gas oder kg_ges(vap)/m3_gas
-// eps_liq in m3 FlÃ¼ssigkeit / m3 freies Volumen
-// eps in m3 Solid / m3 gesamt
 
+// c_A in mol_A / m3_gas ODER mol_A / m3_flÃ¼ssig
+  // rho_v in mol_ges(vap)/m3_gas oder kg_ges(vap)/m3_gas
+  // eps_liq in m3 FlÃ¼ssigkeit / m3 freies Volumen
+  // eps in m3 Solid / m3 gesamt
   replaceable model Reaction = ThermalSeparation.Reaction.NoReaction constrainedby ThermalSeparation.Reaction.BaseReaction
                                             "model for chemical reaction"                                                                            annotation(choicesAllMatching=true);
  Reaction reaction[n](redeclare record Geometry =  Geometry,propsLiq=mediumLiquid.properties,
@@ -56,7 +56,7 @@
   parameter Integer n_elements(min=1)=2
     "number of discrete elements or number of equilibrium stages (for equilibrium film model)";
 
-//Initialization
+//Initialization
   parameter Boolean wettedInitial = true
     "true if package material is already wetted (i.e. if liquid enters the column there is immediately a liquid stream leaving the column)"
                                                                                                         annotation(Dialog(tab="Initialization", group="Initial liquid content"));
@@ -82,7 +82,7 @@
   replaceable model HeatTransferWall =
       ThermalSeparation.Wall.ConstAlpha                                            constrainedby ThermalSeparation.Wall.BaseWall
     "heat transfer mechanism between bulk and wall"                                                                                                annotation(choicesAllMatching=true);
-    //instances of connector for heat loss
+    //instances of connector for heat loss
   ThermalSeparation.Interfaces.HeatPort heatPort(Qdot=-sum(heatTransferWall.Qdot_out))
     annotation (Placement(transformation(extent={{74,-10},{94,10}},
                                                                   rotation=0),
@@ -116,12 +116,10 @@
    else
      eps_liq = fill(eps_liq_start,n);
    end if;
-
-//    if init==Enumerations.InitializationOption.init_eq and not considerStartUp then
-//      filmModel.Qdot_l_transfer=zeros(n);
-//    end if;
-
-//der(eps_liq)=zeros(n);
+//    if init==Enumerations.InitializationOption.init_eq and not considerStartUp then
+//      filmModel.Qdot_l_transfer=zeros(n);
+//    end if;
+//der(eps_liq)=zeros(n);
 equation
 
      for j in 1:n loop
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/Compressor.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/Compressor.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/Compressor.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/Compressor.mo"	2022-03-10 09:58:38.024151730 +0000
@@ -23,7 +23,7 @@
     "Nominal inlet pressure for which table is valid";
   Integer tableID;
 
-  import SI = Modelica.SIunits;
+  import Modelica.Units.SI;
   constant Real PI =  Modelica.Constants.pi;
 
   Medium.ThermodynamicState medium_a(p(start=p_start_in), T(start=T_start_in))
@@ -39,7 +39,7 @@
   parameter Boolean preferredStates=true
     "Try to select preferred medium states"                                      annotation(Dialog(tab="Advanced"));
 // Initializatin parameters
-  parameter Modelica.SIunits.MassFlowRate m_start=15
+  parameter Modelica.Units.SI.MassFlowRate m_start=15
     "Guess value for mass flow rate"
     annotation(Dialog(tab="Initialization"));
   parameter Medium.AbsolutePressure p_start_in = Medium.reference_p
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/CompressorSimple.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/CompressorSimple.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/CompressorSimple.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/CompressorSimple.mo"	2022-03-10 09:58:38.008151728 +0000
@@ -8,7 +8,7 @@
 Medium.BaseProperties mediumOut(p=gasPortOut.p,x=gasPortOut.x_outflow,x_star=gasPortOut.x_outflow,c=c);
 
 parameter Real isExp=1.3 "isentropic exponent";
-parameter Modelica.SIunits.Power P_drive_const=10000 "power input of fan motor" annotation(Dialog(enable=not useP));
+parameter Modelica.Units.SI.Power P_drive_const=10000 "power input of fan motor" annotation(Dialog(enable=not useP));
 parameter Boolean useP=false "use P_drive from real input";
 
 // parameter Real charLine[:,:]=fill(
@@ -24,15 +24,15 @@
 // parameter Real omega_time = 50 "Wendepunkt der tanh-Funktion" annotation(Dialog(enable=startConstant,tab="Initialization"));
 //    Real omega = 0.5*tanh(omega_k*(time-omega_time))+0.5;
 
-Modelica.SIunits.Power P_hyd;
-Modelica.SIunits.Power P_drive;
-Modelica.SIunits.Pressure deltap;
-Modelica.SIunits.Concentration c[Medium.nSubstance];
-Modelica.SIunits.Temperature T_in=mediumIn.T;
-Modelica.SIunits.Temperature T_out=mediumOut.T;
+Modelica.Units.SI.Power P_hyd;
+Modelica.Units.SI.Power P_drive;
+Modelica.Units.SI.Pressure deltap;
+Modelica.Units.SI.Concentration c[Medium.nSubstance];
+Modelica.Units.SI.Temperature T_in=mediumIn.T;
+Modelica.Units.SI.Temperature T_out=mediumOut.T;
 
-Modelica.SIunits.VolumeFlowRate Vdot_in=gasPortIn.Ndot*mediumIn.MM/mediumIn.d;
-Modelica.SIunits.VolumeFlowRate Vdot_out=-gasPortOut.Ndot*mediumOut.MM/mediumOut.d;
+Modelica.Units.SI.VolumeFlowRate Vdot_in=gasPortIn.Ndot*mediumIn.MM/mediumIn.d;
+Modelica.Units.SI.VolumeFlowRate Vdot_out=-gasPortOut.Ndot*mediumOut.MM/mediumOut.d;
 
   Interfaces.GasPortIn gasPortIn(redeclare package Medium=Medium)
     annotation (Placement(transformation(extent={{0,-94},{20,-74}}),
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/FlueGasCompressor.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/FlueGasCompressor.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/FlueGasCompressor.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/FlueGasCompressor.mo"	2022-03-10 09:58:37.996151726 +0000
@@ -5,7 +5,7 @@
       outer ThermalSeparation.SystemTS systemTS;
     parameter SI.Temperature T_ref = systemTS.T_ref "reference temperature" annotation(Dialog(tab="Advanced"));
 
-  import SI = Modelica.SIunits;
+  import Modelica.Units.SI;
 
    replaceable package Medium =
        ThermalSeparation.Media.IdealGasMixtures.H2O_O2_CO2_N2
@@ -29,7 +29,7 @@
 
 //  SI.MoleFraction x_in[Medium.nS] = Medium.reference_X;
 
-  parameter Modelica.SIunits.MassFlowRate m_start=15
+  parameter Modelica.Units.SI.MassFlowRate m_start=15
     "Guess value for mass flow rate"
     annotation(Dialog(tab="Initialization"));
   parameter Medium.MassFraction X_start_in[Medium.nX] = Medium.reference_X
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/OldCompressorModels.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/OldCompressorModels.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/OldCompressorModels.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Compressors/OldCompressorModels.mo"	2022-03-10 09:58:37.984151726 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Components.Compressors;
+within ThermalSeparation.Components.Compressors;
 package OldCompressorModels
 
   model Compressor_GasPortInOut
@@ -26,9 +26,8 @@
 
     Integer tableID;
 
-    import SI = Modelica.SIunits;
-  //  constant Real PI =  Modelica.Constants.pi;
-
+    import Modelica.Units.SI;
+  //  constant Real PI =  Modelica.Constants.pi;
     replaceable package Medium =
         ThermalSeparation.Media.IdealGasMixtures.H2O_O2_CO2_N2
                                                              constrainedby ThermalSeparation.Media.BaseMediumVapour
@@ -49,7 +48,7 @@
 
   //  SI.MoleFraction x_in[Medium.nS] = Medium.reference_X;
 
-    parameter Modelica.SIunits.MassFlowRate m_start=15
+    parameter Modelica.Units.SI.MassFlowRate m_start=15
       "Guess value for mass flow rate"
       annotation(Dialog(tab="Initialization"));
     parameter Medium.MassFraction X_start_in[Medium.nX] = Medium.reference_X
@@ -95,28 +94,26 @@
     connect(alpha_in, alpha_in_internal);
     if not use_alpha_in then
       alpha_in_internal = alpha;
-    end if;
-
-    //gasPortIn.c = gasPortOut.c;
+    end if;
+//gasPortIn.c = gasPortOut.c;
     inStream(gasPortIn.x_outflow) = gasPortOut.x_outflow;
-    gasPortIn.x_outflow=gasPortOut.x_outflow;
-    //gasPortOut.p_medium= gasPortOut.p;
-
-  //  for i in 1:nS loop
-  //    gasPortIn.x[i] = gasPortIn.c[i] * Medium.molarMass(stateIn) /Medium.density(stateIn);
-  //  end for;
-
-    stateIn = Medium.setState_pTX(gasPortIn.p, gasPortIn.T, Medium.reference_X); //TODO inStream(gasPortIn.Xi_outflow)
-    stateOut = Medium.setState_pTX(gasPortOut.p, gasPortOut.T, Medium.reference_X); //TODO inStream(gasPortOut.Xi_outflow)
-   // mediumIn = Medium.setState_pTX(gasPortIn.p, gasPortIn.T, Medium.reference_X);
-   // mediumOut = Medium.setState_pTX(gasPortOut.p, gasPortOut.T, Medium.reference_X);
-
-    // mass balance
-    gasPortIn.Vdot*Medium.density(stateIn) + gasPortOut.Vdot*Medium.density(stateOut) = 0.0;//Vdot*rho
-
-    // energy balance
-  //  deltah = Medium.isentropicEnthalpy(gasPortOut.p, stateIn)- inStream(gasPortIn.h_outflow);
-    deltah = Medium.isentropicEnthalpy(gasPortOut.p, stateIn)- Medium.specificEnthalpy(stateIn);
+    gasPortIn.x_outflow=gasPortOut.x_outflow;
+//gasPortOut.p_medium= gasPortOut.p;
+//  for i in 1:nS loop
+//    gasPortIn.x[i] = gasPortIn.c[i] * Medium.molarMass(stateIn) /Medium.density(stateIn);
+//  end for;
+    stateIn = Medium.setState_pTX(gasPortIn.p, gasPortIn.T, Medium.reference_X);
+//TODO inStream(gasPortIn.Xi_outflow)
+    stateOut = Medium.setState_pTX(gasPortOut.p, gasPortOut.T, Medium.reference_X);
+//TODO inStream(gasPortOut.Xi_outflow)
+// mediumIn = Medium.setState_pTX(gasPortIn.p, gasPortIn.T, Medium.reference_X);
+// mediumOut = Medium.setState_pTX(gasPortOut.p, gasPortOut.T, Medium.reference_X);
+// mass balance
+    gasPortIn.Vdot * Medium.density(stateIn) + gasPortOut.Vdot * Medium.density(stateOut) = 0.0;
+//Vdot*rho
+// energy balance
+//  deltah = Medium.isentropicEnthalpy(gasPortOut.p, stateIn)- inStream(gasPortIn.h_outflow);
+    deltah = Medium.isentropicEnthalpy(gasPortOut.p, stateIn) - Medium.specificEnthalpy(stateIn);
 
    gasPortOut.h_outflow = inStream(gasPortIn.h_outflow) + deltah;
     Medium.specificEnthalpy(stateOut) = Medium.specificEnthalpy(stateIn) + deltah;
@@ -132,10 +129,9 @@
     when initial() then
       tableID=tableInit(if tableOnFile then tableName else "NoName",
                         if tableOnFile then fileName else "NoName", table, smoothness);
-    end when;
-
-  //  gasPortOut.p - gasPortIn.p + paNom = tableIpo(tableID, alpha_in_internal, gasPortIn.m_flow)*1e5;
-    deltaPressure = tableIpo(tableID, alpha_in_internal, gasPortIn.Vdot*Medium.density(stateIn))*1e5 - paNom;
+    end when;
+//  gasPortOut.p - gasPortIn.p + paNom = tableIpo(tableID, alpha_in_internal, gasPortIn.m_flow)*1e5;
+    deltaPressure = tableIpo(tableID, alpha_in_internal, gasPortIn.Vdot * Medium.density(stateIn)) * 1e5 - paNom;
     gasPortOut.p - gasPortIn.p = deltaPressure;
 
   protected
@@ -196,9 +192,8 @@
 
     Integer tableID;
 
-    import SI = Modelica.SIunits;
-  //  constant Real PI =  Modelica.Constants.pi;
-
+    import Modelica.Units.SI;
+  //  constant Real PI =  Modelica.Constants.pi;
     replaceable package Medium =
         ThermalSeparation.Media.IdealGasMixtures.H2O_O2_CO2_N2
                                                              constrainedby ThermalSeparation.Media.BaseMediumVapour
@@ -219,7 +214,7 @@
 
   //  SI.MoleFraction x_in[Medium.nS] = Medium.reference_X;
 
-    parameter Modelica.SIunits.MassFlowRate m_start=15
+    parameter Modelica.Units.SI.MassFlowRate m_start=15
       "Guess value for mass flow rate"
       annotation(Dialog(tab="Initialization"));
     parameter Medium.MassFraction X_start_in[Medium.nX] = Medium.reference_X
@@ -260,8 +255,8 @@
           iconTransformation(extent={{-20,74},{20,114}})));
 
   Real sum_x=sum(gasPortOut.x);
-  //Real xxx= alpha_in_internal;//if time < 100 then alpha_in_internal else min(20,max(-20,alpha_in_internal));
-  parameter Real eta_el = 0.82; //angepasst, damit die Leistung fÃ¼r den 100%-Fall mit der Messung Ã¼bereinstimmt
+  //Real xxx= alpha_in_internal;//if time < 100 then alpha_in_internal else min(20,max(-20,alpha_in_internal));
+  parameter Real eta_el = 0.82;     //angepasst, damit die Leistung fÃ¼r den 100%-Fall mit der Messung Ã¼bereinstimmt
   SI.Power P_el = gasPortIn.Vdot*Medium.density(stateIn)* (Medium.specificEnthalpy(stateOut) - Medium.specificEnthalpy(stateIn))/eta_el;
 
   parameter SI.Pressure p_const_in = 0.96e5 "constant inlet pressure";
@@ -273,30 +268,27 @@
 
     gasPortOut.c =gasPortIn.c*Medium.density(stateIn)/Medium.density(stateOut);
     gasPortIn.x = gasPortOut.x;
-    gasPortOut.p_medium= gasPortOut.p;
-
-  //  for i in 1:nS loop
-  //    gasPortIn.x[i] = gasPortIn.c[i] * Medium.molarMass(stateIn) /Medium.density(stateIn);
-  //  end for;
-
-    stateIn = Medium.setState_pTX(gasPortIn.p, gasPortIn.T, Medium.reference_X); //TODO inStream(gasPortIn.Xi_outflow)
-    stateOut = Medium.setState_pTX(gasPortOut.p, gasPortOut.T, Medium.reference_X); //TODO inStream(gasPortOut.Xi_outflow)
-   // mediumIn = Medium.setState_pTX(gasPortIn.p, gasPortIn.T, Medium.reference_X);
-   // mediumOut = Medium.setState_pTX(gasPortOut.p, gasPortOut.T, Medium.reference_X);
-
-    // mass balance
-    gasPortIn.Vdot*Medium.density(stateIn) + gasPortOut.Vdot*Medium.density(stateOut) = 0.0;//Vdot*rho
-
-    // energy balance
-  //  deltah = Medium.isentropicEnthalpy(gasPortOut.p, stateIn)- inStream(gasPortIn.h_outflow);
-    deltah = Medium.isentropicEnthalpy(gasPortOut.p, stateIn)- Medium.specificEnthalpy(stateIn);
-
-  //  gasPortOut.h_outflow = inStream(gasPortIn.h_outflow) + deltah;
-    Medium.specificEnthalpy(stateOut) = Medium.specificEnthalpy(stateIn) + deltah/eta_is;
-  //  gasPortIn.h_outflow = inStream(gasPortOut.h_outflow);
-
-    if tableOnFile then
-      assert(tableName<>"NoName", "tableOnFile = true and no table name given");
+    gasPortOut.p_medium= gasPortOut.p;
+//  for i in 1:nS loop
+//    gasPortIn.x[i] = gasPortIn.c[i] * Medium.molarMass(stateIn) /Medium.density(stateIn);
+//  end for;
+    stateIn = Medium.setState_pTX(gasPortIn.p, gasPortIn.T, Medium.reference_X);
+//TODO inStream(gasPortIn.Xi_outflow)
+    stateOut = Medium.setState_pTX(gasPortOut.p, gasPortOut.T, Medium.reference_X);
+//TODO inStream(gasPortOut.Xi_outflow)
+// mediumIn = Medium.setState_pTX(gasPortIn.p, gasPortIn.T, Medium.reference_X);
+// mediumOut = Medium.setState_pTX(gasPortOut.p, gasPortOut.T, Medium.reference_X);
+// mass balance
+    gasPortIn.Vdot * Medium.density(stateIn) + gasPortOut.Vdot * Medium.density(stateOut) = 0.0;
+//Vdot*rho
+// energy balance
+//  deltah = Medium.isentropicEnthalpy(gasPortOut.p, stateIn)- inStream(gasPortIn.h_outflow);
+    deltah = Medium.isentropicEnthalpy(gasPortOut.p, stateIn) - Medium.specificEnthalpy(stateIn);
+//  gasPortOut.h_outflow = inStream(gasPortIn.h_outflow) + deltah;
+    Medium.specificEnthalpy(stateOut) = Medium.specificEnthalpy(stateIn) + deltah / eta_is;
+//  gasPortIn.h_outflow = inStream(gasPortOut.h_outflow);
+    if tableOnFile then
+      assert(tableName <> "NoName", "tableOnFile = true and no table name given");
     end if;
     if not tableOnFile then
       assert(size(table,1) > 0 and size(table,2) > 0, "tableOnFile = false and parameter table is an empty matrix");
@@ -305,9 +297,8 @@
     when initial() then
       tableID=tableInit(if tableOnFile then tableName else "NoName",
                         if tableOnFile then fileName else "NoName", table, smoothness);
-    end when;
-
-  //  gasPortOut.p - gasPortIn.p + paNom = tableIpo(tableID, alpha_in_internal, gasPortIn.m_flow)*1e5;
+    end when;
+//  gasPortOut.p - gasPortIn.p + paNom = tableIpo(tableID, alpha_in_internal, gasPortIn.m_flow)*1e5;
     gasPortOut.p - gasPortIn.p = deltaPressure;
 
   deltaPressure = tableIpo(tableID, alpha_in_internal, gasPortIn.Vdot*Medium.density(stateIn))*1e5 - paNom;
@@ -351,7 +342,7 @@
         outer ThermalSeparation.SystemTS systemTS;
       parameter SI.Temperature T_ref = systemTS.T_ref "reference temperature" annotation(Dialog(tab="Advanced"));
 
-    import SI = Modelica.SIunits;
+    import Modelica.Units.SI;
 
      replaceable package Medium =
          ThermalSeparation.Media.IdealGasMixtures.H2O_O2_CO2_N2
@@ -375,7 +366,7 @@
 
   //  SI.MoleFraction x_in[Medium.nS] = Medium.reference_X;
 
-    parameter Modelica.SIunits.MassFlowRate m_start=15
+    parameter Modelica.Units.SI.MassFlowRate m_start=15
       "Guess value for mass flow rate"
       annotation(Dialog(tab="Initialization"));
     parameter Medium.MassFraction X_start_in[Medium.nX] = Medium.reference_X
@@ -415,11 +406,12 @@
 
     T_is = gasPortIn.T * (gasPortOut.p/gasPortIn.p)^(0.4/1.4);
 
-    stateIn = Medium.setState_pTX(gasPortIn.p, gasPortIn.T, Medium.reference_X); //TODO inStream(gasPortIn.Xi_outflow)
-    stateOut = Medium.setState_pTX(gasPortOut.p, gasPortOut.T, Medium.reference_X); //TODO inStream(gasPortOut.Xi_outflow)
-
-    // mass balance
-    gasPortIn.Vdot*mediumIn.d + gasPortOut.Vdot*mediumOut.d = 0.0;
+    stateIn = Medium.setState_pTX(gasPortIn.p, gasPortIn.T, Medium.reference_X);
+//TODO inStream(gasPortIn.Xi_outflow)
+    stateOut = Medium.setState_pTX(gasPortOut.p, gasPortOut.T, Medium.reference_X);
+//TODO inStream(gasPortOut.Xi_outflow)
+// mass balance
+    gasPortIn.Vdot * mediumIn.d + gasPortOut.Vdot * mediumOut.d = 0.0;
 
    gasPortOut.p - gasPortIn.p = deltaPressure;
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/BaseCondenser.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/BaseCondenser.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/BaseCondenser.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/BaseCondenser.mo"	2022-03-10 09:58:37.912151716 +0000
@@ -13,7 +13,7 @@
 parameter Integer mapping[nS,2] = {{i,i} for i in 1:nS}
     "parameter to map the different medium vectors one to another" annotation(Dialog(group="Shell side parameters"));
 parameter Boolean connectCoolant=false "set true to enable coolant connectors" annotation(Dialog(group="Shell side parameters"));
-parameter Modelica.SIunits.Pressure p_nom=0.05e5
+parameter Modelica.Units.SI.Pressure p_nom=0.05e5
     "linear pressure drop with nominal value" annotation(Dialog(group="Shell side parameters"));
 parameter SI.VolumeFlowRate vdot_nom=0.4 "nominal volume flow rate" annotation(Dialog(group="Shell side parameters"));
 replaceable package MediumVapour =
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenser.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenser.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenser.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenser.mo"	2022-03-10 09:58:37.876151711 +0000
@@ -3,7 +3,7 @@
 extends ThermalSeparation.Icons.Color.Condenser;
 
     outer ThermalSeparation.SystemTS systemTS;
-      parameter Modelica.SIunits.Temperature T_ref=systemTS.T_ref
+      parameter Modelica.Units.SI.Temperature T_ref=systemTS.T_ref
     "reference temperature"                                                 annotation (Dialog(tab="Advanced"));
 replaceable package MediumVapour =
       ThermalSeparation.Media.C2H5OH_Water_Vap                                                  constrainedby ThermalSeparation.Media.BaseMediumVapour
@@ -29,27 +29,27 @@
 parameter Boolean inertLiquid[nSL] = fill(false,nSL)
     "true for each component which is inert";
 
-     Modelica.SIunits.MoleFraction x_v[nSV];
+     Modelica.Units.SI.MoleFraction x_v[nSV];
 
-     Modelica.SIunits.Temperature T_v;
+     Modelica.Units.SI.Temperature T_v;
 
-     Modelica.SIunits.Concentration c_v[nSV]=x_v*rho_v/MM_v;
+     Modelica.Units.SI.Concentration c_v[nSV]=x_v*rho_v/MM_v;
      ThermalSeparation.Units.MolarEnthalpy h_v= mediumVapourIn.h;
      ThermalSeparation.Units.MolarEnthalpy u_v= mediumVapourIn.u;
-     Modelica.SIunits.Density rho_v= mediumVapourIn.d;
-     Modelica.SIunits.MolarMass MM_v= mediumVapourIn.MM;
+     Modelica.Units.SI.Density rho_v= mediumVapourIn.d;
+     Modelica.Units.SI.MolarMass MM_v= mediumVapourIn.MM;
 
-parameter Modelica.SIunits.Pressure p_cond=1e5 "Kondensationsdruck";
-     Modelica.SIunits.MoleFraction x_l[nSL];
+parameter Modelica.Units.SI.Pressure p_cond=1e5 "Kondensationsdruck";
+     Modelica.Units.SI.MoleFraction x_l[nSL];
     // SI.MoleFraction x_v_out[nSV];
-     Modelica.SIunits.Temperature T_l;
+     Modelica.Units.SI.Temperature T_l;
      ThermalSeparation.Units.MolarEnthalpy h_l;//=mediumLiquid.h;
 
 //Druck in der obersten Stufe
-Modelica.SIunits.Pressure p_1;
+Modelica.Units.SI.Pressure p_1;
 
-parameter Modelica.SIunits.Temperature T_set=303.15;
-Modelica.SIunits.HeatFlowRate Q_kond;
+parameter Modelica.Units.SI.Temperature T_set=303.15;
+Modelica.Units.SI.HeatFlowRate Q_kond;
 
       ThermalSeparation.Interfaces.LiquidPortOut liquidOut(redeclare package
       Medium = MediumLiquid)
@@ -70,12 +70,12 @@
 parameter Integer mapping[nS,2]= {{1,1},{2,2}}
     "parameter to map the different medium vectors one to another";
 parameter Real factor_K[nSL] = fill(1,nSL);
+
 // MediumLiquid.ActivityCoefficient activityCoeff(T=T_cond,x_l=x_l);
 // MediumLiquid.FugacityCoefficient fugacityCoeffSat(T=T_cond, p=p_cond, p_sat=mediumLiquid2.p_sat);
 // Modelica.SIunits.MoleFraction x_v_star[nSV];
 // Modelica.SIunits.Temperature T_cond(start=63 + 273);
- parameter Modelica.SIunits.Temperature delta_T_sub=5 "subcooling";
-
+ parameter Modelica.Units.SI.Temperature delta_T_sub=5 "subcooling";
 equation
    //inflow
       vapourIn.p = p_1;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenserDyn.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenserDyn.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenserDyn.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenserDyn.mo"	2022-03-10 09:58:37.864151711 +0000
@@ -3,7 +3,7 @@
 extends ThermalSeparation.Icons.Color.Condenser;
 
     outer ThermalSeparation.SystemTS systemTS;
-      parameter Modelica.SIunits.Temperature T_ref=systemTS.T_ref
+      parameter Modelica.Units.SI.Temperature T_ref=systemTS.T_ref
     "reference temperature"                                                 annotation (Dialog(tab="Advanced"));
 replaceable package MediumVapour =
       ThermalSeparation.Media.C2H5OH_Water_Vap                                                  constrainedby ThermalSeparation.Media.BaseMediumVapour
@@ -29,27 +29,27 @@
 parameter Boolean inertLiquid[nSL] = fill(false,nSL)
     "true for each component which is inert";
 
-     Modelica.SIunits.MoleFraction x_v[nSV];
+     Modelica.Units.SI.MoleFraction x_v[nSV];
 
-     Modelica.SIunits.Temperature T_v;
+     Modelica.Units.SI.Temperature T_v;
 
-     Modelica.SIunits.Concentration c_v[nSV]=x_v*rho_v/MM_v;
+     Modelica.Units.SI.Concentration c_v[nSV]=x_v*rho_v/MM_v;
      ThermalSeparation.Units.MolarEnthalpy h_v= mediumVapourIn.h;
      ThermalSeparation.Units.MolarEnthalpy u_v= mediumVapourIn.u;
-     Modelica.SIunits.Density rho_v= mediumVapourIn.d;
-     Modelica.SIunits.MolarMass MM_v= mediumVapourIn.MM;
+     Modelica.Units.SI.Density rho_v= mediumVapourIn.d;
+     Modelica.Units.SI.MolarMass MM_v= mediumVapourIn.MM;
 
-parameter Modelica.SIunits.Pressure p_cond=1e5 "Kondensationsdruck";
-     Modelica.SIunits.MoleFraction x_l[nSL];
+parameter Modelica.Units.SI.Pressure p_cond=1e5 "Kondensationsdruck";
+     Modelica.Units.SI.MoleFraction x_l[nSL];
     // SI.MoleFraction x_v_out[nSV];
-     Modelica.SIunits.Temperature T_l;
+     Modelica.Units.SI.Temperature T_l;
      ThermalSeparation.Units.MolarEnthalpy h_l;//=mediumLiquid.h;
 
 //Druck in der obersten Stufe
-Modelica.SIunits.Pressure p_1;
+Modelica.Units.SI.Pressure p_1;
 
-parameter Modelica.SIunits.Temperature T_set=303.15;
-Modelica.SIunits.HeatFlowRate Q_kond;
+parameter Modelica.Units.SI.Temperature T_set=303.15;
+Modelica.Units.SI.HeatFlowRate Q_kond;
 
       ThermalSeparation.Interfaces.LiquidPortOut liquidOut(redeclare package
       Medium = MediumLiquid)
@@ -74,7 +74,7 @@
 // MediumLiquid.FugacityCoefficient fugacityCoeffSat(T=T_cond, p=p_cond, p_sat=mediumLiquid2.p_sat);
 // Modelica.SIunits.MoleFraction x_v_star[nSV];
 // Modelica.SIunits.Temperature T_cond(start=63 + 273);
- parameter Modelica.SIunits.Temperature delta_T_sub=5 "subcooling";
+ parameter Modelica.Units.SI.Temperature delta_T_sub=5 "subcooling";
 
  parameter SI.Volume V_liq = 0.1 "constant liquid holdup in condenser";
  parameter SI.MoleFraction x_l_start[nSL];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenser_PT1.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenser_PT1.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenser_PT1.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenser_PT1.mo"	2022-03-10 09:58:37.848151708 +0000
@@ -1,9 +1,9 @@
-ï»¿within ThermalSeparation.Components.Condenser;
+within ThermalSeparation.Components.Condenser;
 model TotalCondenser_PT1
 extends ThermalSeparation.Icons.Color.Condenser;
 parameter Real timeConstant = 100;
     outer ThermalSeparation.SystemTS systemTS;
-      parameter Modelica.SIunits.Temperature T_ref=systemTS.T_ref
+      parameter Modelica.Units.SI.Temperature T_ref=systemTS.T_ref
     "reference temperature"                                                 annotation (Dialog(tab="Advanced"));
 replaceable package MediumVapour =
       ThermalSeparation.Media.C2H5OH_Water_Vap                                                  constrainedby ThermalSeparation.Media.BaseMediumVapour
@@ -32,32 +32,32 @@
 //inflow
 
     // SI.Pressure p_v;//=2e5;
-     Modelica.SIunits.MoleFraction x_v[nSV];
+     Modelica.Units.SI.MoleFraction x_v[nSV];
 
-     Modelica.SIunits.Temperature T_v;
+     Modelica.Units.SI.Temperature T_v;
 
      ThermalSeparation.Units.MolarEnthalpy h_v;
      ThermalSeparation.Units.MolarEnthalpy u_v;
-     Modelica.SIunits.Density rho_v;
-     Modelica.SIunits.MolarMass MM_v;
+     Modelica.Units.SI.Density rho_v;
+     Modelica.Units.SI.MolarMass MM_v;
 
-parameter Modelica.SIunits.Pressure p_cond=1e5 "Kondensationsdruck";
-     Modelica.SIunits.MoleFraction x_l[nSL];
+parameter Modelica.Units.SI.Pressure p_cond=1e5 "Kondensationsdruck";
+     Modelica.Units.SI.MoleFraction x_l[nSL];
     // SI.MoleFraction x_v_out[nSV];
-     Modelica.SIunits.Temperature T_l;
+     Modelica.Units.SI.Temperature T_l;
 
      ThermalSeparation.Units.MolarEnthalpy h_l;
      ThermalSeparation.Units.MolarEnthalpy u_l;
-     Modelica.SIunits.Density rho_l;
-     Modelica.SIunits.MolarMass MM_l;
+     Modelica.Units.SI.Density rho_l;
+     Modelica.Units.SI.MolarMass MM_l;
      //SI.Pressure p_sat[nS];
 
 //Druck in der obersten Stufe
-Modelica.SIunits.Pressure p_1;
+Modelica.Units.SI.Pressure p_1;
 
 //SI.Temperature T_set; // feste Temperatur fÃ¼r das Kondensat
-parameter Modelica.SIunits.Temperature T_set=303.15;
-Modelica.SIunits.HeatFlowRate Q_kond;
+parameter Modelica.Units.SI.Temperature T_set=303.15;
+Modelica.Units.SI.HeatFlowRate Q_kond;
 
       ThermalSeparation.Interfaces.LiquidPortOut liquidOut(redeclare package
       Medium = MediumLiquid)
@@ -80,9 +80,9 @@
 parameter Real factor_K[nSL] = fill(1,nSL);
  MediumLiquid.ActivityCoefficient activityCoeff(T=T_cond,x_l=x_l);
  MediumLiquid.FugacityCoefficient fugacityCoeffSat(T=T_cond, p=p_cond, p_sat=mediumLiquid2.p_sat);
- Modelica.SIunits.MoleFraction x_v_star[nSV];
- Modelica.SIunits.Temperature T_cond(start=63 + 273);
- parameter Modelica.SIunits.Temperature delta_T_sub=5 "subcooling";
+ Modelica.Units.SI.MoleFraction x_v_star[nSV];
+ Modelica.Units.SI.Temperature T_cond(start=63 + 273);
+ parameter Modelica.Units.SI.Temperature delta_T_sub=5 "subcooling";
 
   Modelica.Blocks.Continuous.FirstOrder firstOrder(
     initType=Modelica.Blocks.Types.Init.InitialState,
@@ -215,23 +215,20 @@
 firstOrder4.u = x_l[1];
 firstOrder7.u = x_l[2];
 firstOrder10.u = x_l[3];
-firstOrder13.u = x_l[4];
-   //Liquid inflow
-      vapourIn.p = p_1;
+firstOrder13.u = x_l[4];
+//Liquid inflow
+  vapourIn.p = p_1;
 
        inStream(vapourIn.h_outflow) = h_v;
-       inStream(vapourIn.x_outflow) = x_v;
-
-   //Liquid outflow
-
-       liquidOut.h_outflow = h_l;
+       inStream(vapourIn.x_outflow) = x_v;
+//Liquid outflow
+  liquidOut.h_outflow = h_l;
        liquidOut.x_outflow = x_l;
 
     vapourIn.h_outflow = h_l;
-       vapourIn.x_outflow = x_l;
-//MedienÃ¼bergabe
-
-   MM_v = mediumVapourIn.MM;
+       vapourIn.x_outflow = x_l;
+//MedienÃ¼bergabe
+  MM_v = mediumVapourIn.MM;
    rho_v = mediumVapourIn.d;
    h_v = mediumVapourIn.h;
    u_v = mediumVapourIn.u;
@@ -242,18 +239,16 @@
 
 vapourIn.Ndot+liquidOut.Ndot=0;
 
-p_1=p_cond;//zeta*rho_v/2*(w_v)^2+p_kond;//Druckverlust
-
-//Energy balance
-  Q_kond=vapourIn.Ndot*h_v +liquidOut.Ndot*h_l;
-  //Q_kond=Vdot_out_CW*rho_CW_out/MM_CW_out*h_CW_out-Vdot_in_CW*rho_CW_in/MM_CW_in*h_CW_in;
-
-//  Vdot_out_CW*rho_CW_out/MM_CW_out=Vdot_in_CW*rho_CW_in/MM_CW_in;
-
-/*** Bestimmung der Kondensationstemp. wie bei Forner S. 48 ff ***/
-for i in 1:nS loop
-     x_v_star[mapping[i,1]] * p_cond *1 = factor_K[mapping[i,2]]* x_l[mapping[i,2]] *activityCoeff.gamma[mapping[i,2]] *fugacityCoeffSat.phi_sat[mapping[i,2]] * mediumLiquid2.p_sat[mapping[i,2]];
-end for;
+p_1=p_cond;
+//zeta*rho_v/2*(w_v)^2+p_kond;//Druckverlust
+//Energy balance
+  Q_kond = vapourIn.Ndot * h_v + liquidOut.Ndot * h_l;
+//Q_kond=Vdot_out_CW*rho_CW_out/MM_CW_out*h_CW_out-Vdot_in_CW*rho_CW_in/MM_CW_in*h_CW_in;
+//  Vdot_out_CW*rho_CW_out/MM_CW_out=Vdot_in_CW*rho_CW_in/MM_CW_in;
+/*** Bestimmung der Kondensationstemp. wie bei Forner S. 48 ff ***/
+  for i in 1:nS loop
+    x_v_star[mapping[i, 1]] * p_cond * 1 = factor_K[mapping[i, 2]] * x_l[mapping[i, 2]] * activityCoeff.gamma[mapping[i, 2]] * fugacityCoeffSat.phi_sat[mapping[i, 2]] * mediumLiquid2.p_sat[mapping[i, 2]];
+  end for;
   sum(x_v_star)=1;
   connect(firstOrder.y, firstOrder2.u) annotation (Line(
       points={{-37,56},{-22,56}},
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenser_PT1_2.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenser_PT1_2.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenser_PT1_2.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/TotalCondenser_PT1_2.mo"	2022-03-10 09:58:37.816151704 +0000
@@ -3,7 +3,7 @@
 extends ThermalSeparation.Icons.Color.Condenser;
 parameter Real timeConstant = 100;
     outer ThermalSeparation.SystemTS systemTS;
-      parameter Modelica.SIunits.Temperature T_ref=systemTS.T_ref
+      parameter Modelica.Units.SI.Temperature T_ref=systemTS.T_ref
     "reference temperature"                                                 annotation (Dialog(tab="Advanced"));
 replaceable package MediumVapour =
       ThermalSeparation.Media.Methylacetatsynthese_Vap                                                 constrainedby ThermalSeparation.Media.BaseMediumVapour
@@ -32,32 +32,32 @@
 //inflow
 
     // SI.Pressure p_v;//=2e5;
-     Modelica.SIunits.MoleFraction x_v[nSV];
+     Modelica.Units.SI.MoleFraction x_v[nSV];
 
-     Modelica.SIunits.Temperature T_v;
+     Modelica.Units.SI.Temperature T_v;
 
      ThermalSeparation.Units.MolarEnthalpy h_v;
      ThermalSeparation.Units.MolarEnthalpy u_v;
-     Modelica.SIunits.Density rho_v;
-     Modelica.SIunits.MolarMass MM_v;
+     Modelica.Units.SI.Density rho_v;
+     Modelica.Units.SI.MolarMass MM_v;
 
-parameter Modelica.SIunits.Pressure p_cond=1e5 "Kondensationsdruck";
-     Modelica.SIunits.MoleFraction x_l[nSL];
+parameter Modelica.Units.SI.Pressure p_cond=1e5 "Kondensationsdruck";
+     Modelica.Units.SI.MoleFraction x_l[nSL];
     // SI.MoleFraction x_v_out[nSV];
-     Modelica.SIunits.Temperature T_l;
+     Modelica.Units.SI.Temperature T_l;
 
      ThermalSeparation.Units.MolarEnthalpy h_l;
      ThermalSeparation.Units.MolarEnthalpy u_l;
-     Modelica.SIunits.Density rho_l;
-     Modelica.SIunits.MolarMass MM_l;
+     Modelica.Units.SI.Density rho_l;
+     Modelica.Units.SI.MolarMass MM_l;
      //SI.Pressure p_sat[nS];
 
 //Druck in der obersten Stufe
-Modelica.SIunits.Pressure p_1;
+Modelica.Units.SI.Pressure p_1;
 
 //SI.Temperature T_set; // feste Temperatur fr das Kondensat
-parameter Modelica.SIunits.Temperature T_set=303.15;
-Modelica.SIunits.HeatFlowRate Q_kond;
+parameter Modelica.Units.SI.Temperature T_set=303.15;
+Modelica.Units.SI.HeatFlowRate Q_kond;
 
       ThermalSeparation.Interfaces.LiquidPortOut liquidOut(redeclare package
       Medium = MediumLiquid)
@@ -80,9 +80,9 @@
 parameter Real factor_K[nSL] = fill(1,nSL);
  MediumLiquid.ActivityCoefficient activityCoeff(T=T_cond,x_l=x_l);
  MediumLiquid.FugacityCoefficient fugacityCoeffSat(T=T_cond, p=p_cond, p_sat=mediumLiquid2.p_sat);
- Modelica.SIunits.MoleFraction x_v_star[nSV];
- Modelica.SIunits.Temperature T_cond(start=63 + 273);
- parameter Modelica.SIunits.Temperature delta_T_sub=5 "subcooling";
+ Modelica.Units.SI.MoleFraction x_v_star[nSV];
+ Modelica.Units.SI.Temperature T_cond(start=63 + 273);
+ parameter Modelica.Units.SI.Temperature delta_T_sub=5 "subcooling";
 
   Modelica.Blocks.Continuous.FirstOrder firstOrder(
     initType=Modelica.Blocks.Types.Init.InitialState,
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/package.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Condenser/package.mo"	2022-03-10 09:58:37.892151713 +0000
@@ -4,24 +4,23 @@
 
   model FlashCondenser_CO2_H2O "for CO2/H2O: cools down and completely separates streams without considering energy removal"
 
-  // Check luft nicht, weil die Vektorgre der Outputs hier fest vorgegeben ist und nicht mit den Defaults der Connectoren bereinstimmt. Das macht aber auch erstmal nichts, weil die Medienmodell hier nicht replaceable sind.
-
+// Check luft nicht, weil die Vektorgre der Outputs hier fest vorgegeben ist und nicht mit den Defaults der Connectoren bereinstimmt. Das macht aber auch erstmal nichts, weil die Medienmodell hier nicht replaceable sind.
       extends ThermalSeparation.Icons.Color.Condenser;
 
-  // parameter Integer nSV = 2;
-  // parameter Integer nSL = 3;
+// parameter Integer nSV = 2;
+    // parameter Integer nSL = 3;
   parameter Integer onlyVap = 2 "component only in vapour stream";
   parameter Integer onlyLiq = 1 "component only in liquid stream";
 
-  parameter Modelica.SIunits.Temperature T_out=273.15 + 40 "temperature at outlet";
+  parameter Modelica.Units.SI.Temperature T_out=273.15 + 40 "temperature at outlet";
 
-  Modelica.SIunits.Density rho_v_in=mediumVapourIn.d;
-  Modelica.SIunits.Density rho_v=mediumVapour.d;
-  Modelica.SIunits.Density rho_l=mediumLiquid.d;
-
-  Modelica.SIunits.MolarMass MM_v_in(start=0.028)=mediumVapourIn.MM;
-  Modelica.SIunits.MolarMass MM_v(start=0.044)=mediumVapour.MM;
-  Modelica.SIunits.MolarMass MM_l=mediumLiquid.MM;
+  Modelica.Units.SI.Density rho_v_in=mediumVapourIn.d;
+  Modelica.Units.SI.Density rho_v=mediumVapour.d;
+  Modelica.Units.SI.Density rho_l=mediumLiquid.d;
+
+  Modelica.Units.SI.MolarMass MM_v_in(start=0.028)=mediumVapourIn.MM;
+  Modelica.Units.SI.MolarMass MM_v(start=0.044)=mediumVapour.MM;
+  Modelica.Units.SI.MolarMass MM_l=mediumLiquid.MM;
 
      package MediumVapour =
         ThermalSeparation.Media.H2O_CO2_Vap;
@@ -50,9 +49,9 @@
       x=liquidPortOut.x_outflow,
       h=gasPortIn.h_outflow);
 
-      Modelica.SIunits.HeatFlowRate Q;
+      Modelica.Units.SI.HeatFlowRate Q;
 
-     //  Real checkbal;
+//  Real checkbal;
   Real h_v_in = inStream(gasPortIn.h_outflow);
   Real T_v_in;
     ThermalSeparation.Interfaces.GasPortIn gasPortIn(redeclare package Medium =
@@ -70,7 +69,7 @@
           iconTransformation(extent={{60,-20},{100,20}})));
   equation
        h_v_in = mediumVapourIn.h;
-       //gasPortIn.h_outflow=mediumLiquid.h;
+//gasPortIn.h_outflow=mediumLiquid.h;
        gasPortIn.x_outflow={1,0};
 
      gasPortOut.p = gasPortIn.p;
@@ -92,5 +91,6 @@
    annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
               -100},{100,100}}),
                     graphics), Diagram(graphics));
-  end FlashCondenser_CO2_H2O;
+  end FlashCondenser_CO2_H2O;
+
 end Condenser;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/GasLiquidVolumes/LSF_deltaP.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/GasLiquidVolumes/LSF_deltaP.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/GasLiquidVolumes/LSF_deltaP.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/GasLiquidVolumes/LSF_deltaP.mo"	2022-03-10 09:58:12.524148500 +0000
@@ -12,8 +12,8 @@
 SI.MolarMass MM_v_state(  stateSelect=StateSelect.prefer)=MM_v;
 equation
 
-/*** Der Gleichung für Druckverlust bei Umströmung von Rohrbündeln nachempfunden (VDI-Wärmeatlas), zeta wird allerdings als Parameter vorgegeben
-     Sowieso alles nur mäßig gut, weil der Volumenstrom sich ja signifikant über die HX-Höhe ändert ***/
+/*** Der Gleichung fÃ¼r Druckverlust bei UmstrÃ¶mung von RohrbÃ¼ndeln nachempfunden (VDI-WÃ¤rmeatlas), zeta wird allerdings als Parameter vorgegeben
+     Sowieso alles nur mÃ¤ÃŸig gut, weil der Volumenstrom sich ja signifikant Ã¼ber die HX-HÃ¶he Ã¤ndert ***/
 Vdot_v = pressureLoss.Vdot;
 
 initial equation
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/GasLiquidVolumes/Tests.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/GasLiquidVolumes/Tests.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/GasLiquidVolumes/Tests.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/GasLiquidVolumes/Tests.mo"	2022-03-10 09:58:12.524148500 +0000
@@ -194,8 +194,8 @@
   end TestLSF_noDeltaP;
 
   model Control3_2_tank_torricelli
-    "Control Strategie 3 (idealPump1 regelt Abscheiderate, Qdot_reboiler wird gestellt, idealPump regelt Füllstand)"
-    //Lauftest: 28.7.2011, 18000 s in 498 s (Kevin): geht erst, seit man an dem PI-Regler für den StartUp rumgespielt hat
+    "Control Strategie 3 (idealPump1 regelt Abscheiderate, Qdot_reboiler wird gestellt, idealPump regelt FÃ¼llstand)"
+    //Lauftest: 28.7.2011, 18000 s in 498 s (Kevin): geht erst, seit man an dem PI-Regler fÃ¼r den StartUp rumgespielt hat
     //Lauftest: 18.7.2011, 18000 s in 498 s
     //Lauftest: 26.5.2011, 18000 s in 700 s (Torricelli), wenn Umrechnung von x und c nicht mit v sondern mit MM/rho gemacht wird
     //Lauftest: 18.5.2011 / 20.5.2011 18000s in 600 s (Torricelli)
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/HeatExchanger.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/HeatExchanger.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/HeatExchanger.mo"	2022-03-10 09:57:37.908144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/HeatExchanger.mo"	2022-03-10 09:58:37.776151700 +0000
@@ -6,8 +6,8 @@
   extends ThermalSeparation.Icons.Color.HeatExchanger2;
     //import CCS.ThermalSeparation;
 
-  Modelica.SIunits.HeatFlowRate Q;
-  parameter Modelica.SIunits.Temperature T_set "temperature at outlet";
+  Modelica.Units.SI.HeatFlowRate Q;
+  parameter Modelica.Units.SI.Temperature T_set "temperature at outlet";
 
   outer ThermalSeparation.SystemTS systemTS;
 
@@ -31,9 +31,9 @@
     ThermalSeparation.Interfaces.HeatPort heatPort(Qdot=-Q) annotation (Placement(
           transformation(extent={{82,0},{102,20}}, rotation=0),
           iconTransformation(extent={{62,-20},{102,20}})));
-  Modelica.SIunits.MoleFraction x_in[MediumLiquid.nSubstance];
+  Modelica.Units.SI.MoleFraction x_in[MediumLiquid.nSubstance];
   Real h_in;
-  Real h;//=medium.h;
+  Real h;      //=medium.h;
   equation
           hotLiquidIn.x_outflow= inStream(coldLiquidOut.x_outflow);
            hotLiquidIn.h_outflow= inStream(coldLiquidOut.h_outflow);
@@ -41,9 +41,9 @@
   h_in = inStream(hotLiquidIn.h_outflow);
 
   /* energy balance */
-  Q =hotLiquidIn.Ndot*(coldLiquidOut.h_outflow - h_in);// (-coldLiquidOut.Vdot)*mediumLiquid.d*calcSpecificEnthalpy.cp_tot*(hotLiquidIn.T-T_set);
-
-  /* mass balance */
+  Q =hotLiquidIn.Ndot*(coldLiquidOut.h_outflow - h_in);
+// (-coldLiquidOut.Vdot)*mediumLiquid.d*calcSpecificEnthalpy.cp_tot*(hotLiquidIn.T-T_set);
+/* mass balance */
   hotLiquidIn.Ndot + coldLiquidOut.Ndot=0;
 
     annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
@@ -55,7 +55,7 @@
 
   model CcounterFlowHeatExchanger "ideal - no pressure loss"
        extends ThermalSeparation.Icons.Color.HeatExchanger;
-    import SI = Modelica.SIunits;
+    import Modelica.Units.SI;
 
   replaceable package MediumLiquidCold =
         ThermalSeparation.Media.WaterBasedLiquid.CO2_H2O
@@ -64,8 +64,8 @@
         ThermalSeparation.Media.WaterBasedLiquid.CO2_H2O
     constrainedby ThermalSeparation.Media.BaseMediumLiquid "medium to be used for cold liquid" annotation(choicesAllMatching);
 
-  // parameter
-      // Geometry
+// parameter
+    // Geometry
     parameter SI.Mass plateMetalMass = 310 annotation(Dialog(group="Geometry"));
     parameter SI.SpecificHeatCapacity cpMetal = 500 annotation(Dialog(group="Geometry"));
     parameter SI.Volume volumeHotLiquid = 11e-3 annotation(Dialog(group="Geometry"));
@@ -78,7 +78,7 @@
      SI.CoefficientOfHeatTransfer alphaHot_nom_param = 3600 annotation(Dialog(group="Geometry"));
      SI.CoefficientOfHeatTransfer alphaCold_nom_param = 3600 annotation(Dialog(group="Geometry"));
 
-      // nominal operating point
+// nominal operating point
     parameter SI.Pressure dpHotLiquid = 2e5 annotation(Dialog(group="nominal operating point"));
     parameter SI.Pressure dpColdLiquid = 2e5 annotation(Dialog(group="nominal operating point"));
     parameter SI.MassFlowRate mFlowHotLiquid_nom = 0.3 annotation(Dialog(group="nominal operating point"));
@@ -88,18 +88,17 @@
 
     parameter SI.AbsolutePressure pLiquid_nom = 4e5 annotation(Dialog(group="nominal operating point"));
 
-      // initial
+// initial
     parameter SI.Temperature ThotLiquidIn_start = 104 + 273.15 annotation(Dialog(tab="Initialization"));
     parameter SI.Temperature TcoldLiquidIn_start = 51 + 273.15 annotation(Dialog(tab="Initialization"));
     parameter SI.Temperature ThotLiquid_start = 56 + 273.15 annotation(Dialog(tab="Initialization"));
     parameter SI.Temperature TcoldLiquid_start = 98 + 273.15 annotation(Dialog(tab="Initialization"));
 
-      // Medium parameter
+// Medium parameter
     final parameter Integer nShot = 2 "number of species which are equal in vapour and liquid phase";
     parameter Integer nScold = 2 "number of species which are equal in vapour and liquid phase";
 
-   // final parameter
-
+// final parameter
     final parameter Integer nLhot = nSLhot - nShot "number of additional substances which are only in liquid phase";
     final parameter Integer nLcold = nSLcold - nScold "number of additional substances which are only in liquid phase";
     final parameter Integer nSLhot= MediumLiquidHot.nSubstance;
@@ -108,19 +107,18 @@
     final parameter SI.Density rhoHotLiquid_nom = MediumLiquidHot.DensityWater(p=pLiquid_nom, T=ThotLiquidOut_nom);
     final parameter SI.Density rhoColdLiquid_nom = MediumLiquidCold.DensityWater(p=pLiquid_nom, T=TcoldLiquidOut_nom);
 
-    final parameter SI.Length dummyDiameter = 0.0254 " diameter is abitrary"; // since dp and volume is adjusted using tube zeta resp. length
+    final parameter SI.Length dummyDiameter = 0.0254 " diameter is abitrary";     // since dp and volume is adjusted using tube zeta resp. length
     final parameter SI.Length hotLiquidTubeLength = volumeHotLiquid/(0.25*Modelica.Constants.pi*dummyDiameter^2);
     final parameter SI.Length coldLiquidTubeLength = volumeColdLiquid/(0.25*Modelica.Constants.pi*dummyDiameter^2);
     final parameter SI.Area CrossSectionArea = Modelica.Constants.pi*dummyDiameter^2/4;
     final parameter Real zetaHotLiquid = (dpHotLiquid*CrossSectionArea^2*2*dummyDiameter)/((mFlowHotLiquid_nom/rhoHotLiquid_nom)^2*hotLiquidTubeLength*rhoHotLiquid_nom);
     final parameter Real zetaHotLiquid_haiko = Modelica.Constants.pi^2*dummyDiameter^5/(8*hotLiquidTubeLength)*(dpHotLiquid*rhoHotLiquid_nom/mFlowHotLiquid_nom^2);
     final parameter Real zetaColdLiquid = Modelica.Constants.pi^2*dummyDiameter^5/(8*coldLiquidTubeLength)*(dpColdLiquid*rhoColdLiquid_nom/mFlowColdLiquid_nom^2);
-  //parameter SI.Area areaHT = 1 "heat transfer area";
-
+  //parameter SI.Area areaHT = 1 "heat transfer area";
     parameter SI.Concentration c_l_start_hot[nSLhot]={5,40000} "initial value for concentration of hot liquid" annotation(Dialog(tab="Initialization"));
     parameter SI.Concentration c_l_start_cold[nSLcold]={5,40000} "initial value for concentration of cold liquid" annotation(Dialog(tab="Initialization"));
 
-  //variables
+//variables
   SI.TemperatureDifference logDtHot;
   SI.TemperatureDifference logDtCold;
 
@@ -131,16 +129,15 @@
   SI.HeatFlowRate QFlowFromColdLiqidOutToHotWall;
   SI.HeatFlowRate QFlowFromHotLiqidInToHotWall;
   SI.HeatFlowRate QFlowFromHotLiqidOutToColdWall;
-  //Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatFlowHotLiquid;
-  //Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatFlowColdLiquid;
+  //Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatFlowHotLiquid;
+    //Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatFlowColdLiquid;
   SI.CoefficientOfHeatTransfer alphaCold;
   SI.CoefficientOfHeatTransfer alphaHot;
   /*** state selection ***/
   parameter Boolean ss_hot_c2=true "true if c_l[2] of the hot liquid is to be a state";
   parameter Boolean ss_cold_c2=true "true if c_l[2] of the cold liquid is to be a state";
 
-  // components
-
+// components
     ThermalSeparation.Components.HeatExchanger.LiquidTube hotLiquidTube(
       redeclare replaceable package MediumLiquid = MediumLiquidHot,
       d=dummyDiameter,
@@ -219,28 +216,27 @@
       alpha_internal=3600;
     end if;
 
-    omega = 0.5 + 0.5*tanh(40000*(Vdot_h_in - 3e-4));
-
-    if alpha_input then
-       if Vdot_h_in<=4e-4 then
-  //      alphaHot_nom=0;
-  //      alphaCold_nom=0;
-       alphaHot_nom=omega*alpha_internal;
-       alphaCold_nom=omega*alpha_internal;
-     else
-       alphaHot_nom=alpha_internal;
-       alphaCold_nom=alpha_internal;
-     end if;
-    else
-     if Vdot_h_in<=4e-4 then
-  //      alphaHot_nom=0;
-  //      alphaCold_nom=0;
-       alphaHot_nom=omega*alphaHot_nom_param;
-       alphaCold_nom=omega*alphaCold_nom_param;
-     else
-       alphaHot_nom=alphaHot_nom_param;
-       alphaCold_nom=alphaCold_nom_param;
-     end if;
+    omega = 0.5 + 0.5*tanh(40000*(Vdot_h_in - 3e-4));
+  if alpha_input then
+      if Vdot_h_in <= 4e-4 then
+//      alphaHot_nom=0;
+//      alphaCold_nom=0;
+        alphaHot_nom = omega * alpha_internal;
+        alphaCold_nom = omega * alpha_internal;
+      else
+        alphaHot_nom = alpha_internal;
+        alphaCold_nom = alpha_internal;
+      end if;
+    else
+      if Vdot_h_in <= 4e-4 then
+//      alphaHot_nom=0;
+//      alphaCold_nom=0;
+        alphaHot_nom = omega * alphaHot_nom_param;
+        alphaCold_nom = omega * alphaCold_nom_param;
+      else
+        alphaHot_nom = alphaHot_nom_param;
+        alphaCold_nom = alphaCold_nom_param;
+      end if;
     end if;
 
       h_c_in = inStream(coldLiquidIn.h_outflow);
@@ -249,40 +245,35 @@
       h_h_out = hotLiquidOut.h_outflow;
 
   alphaCold  = alphaCold_nom*(rhoColdLiquid_nom*Vdot_c_in)/mFlowColdLiquid_nom;
-  alphaHot = alphaHot_nom*(rhoHotLiquid_nom*Vdot_h_in)/mFlowHotLiquid_nom;
-  //  if  (hotLiquidOut.T - TwallCold) < 0.1  or (hotLiquidIn.T - TwallHot) < 0.1 then
-  //    logDtHot = ((hotLiquidOut.T - TwallCold) + (hotLiquidIn.T - TwallHot))/2;
-  //  else
-  //    logDtHot = ((hotLiquidOut.T - TwallCold)-(hotLiquidIn.T - TwallHot))/Modelica.Math.log((hotLiquidOut.T - TwallCold)/(hotLiquidIn.T - TwallHot));
-  //  end if;
-
-  //logDtHot = ((hotLiquidOut.T - TwallCold)-(hotLiquidIn.T - TwallHot))/Modelica.Math.log((hotLiquidOut.T - TwallCold)/(hotLiquidIn.T - TwallHot));
-  logDtHot = ((T_h_out - TwallCold) + (T_h_in - TwallHot))/2;
-
-  //  if (coldLiquidOut.T - TwallHot) > -0.1 or (coldLiquidIn.T - TwallCold) > -0.1 then
-  //      logDtCold =(coldLiquidOut.T - TwallHot)+(coldLiquidIn.T - TwallCold)/2;
-  //  else
-  //    logDtCold = ((coldLiquidOut.T - TwallHot)-(coldLiquidIn.T - TwallCold))/Modelica.Math.log((coldLiquidOut.T - TwallHot)/(coldLiquidIn.T - TwallCold));
-  //  end if;
-
-  //logDtCold = ((coldLiquidOut.T - TwallHot)-(coldLiquidIn.T - TwallCold))/Modelica.Math.log((coldLiquidOut.T - TwallHot)/(coldLiquidIn.T - TwallCold));
-  logDtCold =(T_c_out - TwallHot)+(T_c_in - TwallCold)/2;
+  alphaHot = alphaHot_nom*(rhoHotLiquid_nom*Vdot_h_in)/mFlowHotLiquid_nom;
+//  if  (hotLiquidOut.T - TwallCold) < 0.1  or (hotLiquidIn.T - TwallHot) < 0.1 then
+//    logDtHot = ((hotLiquidOut.T - TwallCold) + (hotLiquidIn.T - TwallHot))/2;
+//  else
+//    logDtHot = ((hotLiquidOut.T - TwallCold)-(hotLiquidIn.T - TwallHot))/Modelica.Math.log((hotLiquidOut.T - TwallCold)/(hotLiquidIn.T - TwallHot));
+//  end if;
+//logDtHot = ((hotLiquidOut.T - TwallCold)-(hotLiquidIn.T - TwallHot))/Modelica.Math.log((hotLiquidOut.T - TwallCold)/(hotLiquidIn.T - TwallHot));
+    logDtHot = (T_h_out - TwallCold + T_h_in - TwallHot) / 2;
+//  if (coldLiquidOut.T - TwallHot) > -0.1 or (coldLiquidIn.T - TwallCold) > -0.1 then
+//      logDtCold =(coldLiquidOut.T - TwallHot)+(coldLiquidIn.T - TwallCold)/2;
+//  else
+//    logDtCold = ((coldLiquidOut.T - TwallHot)-(coldLiquidIn.T - TwallCold))/Modelica.Math.log((coldLiquidOut.T - TwallHot)/(coldLiquidIn.T - TwallCold));
+//  end if;
+//logDtCold = ((coldLiquidOut.T - TwallHot)-(coldLiquidIn.T - TwallCold))/Modelica.Math.log((coldLiquidOut.T - TwallHot)/(coldLiquidIn.T - TwallCold));
+    logDtCold = T_c_out - TwallHot + (T_c_in - TwallCold) / 2;
 
   heatFlowHotLiquidTube.Q_flow = -logDtHot*alphaHot*surfaceArea;
-  heatFlowHotLiquidTube.Q_flow+heatFlowColdLiquidTube.Q_flow =0;
-  //heatFlowColdLiquidTube.Q_flow = -logDtCold*alphaCold*surfaceArea;
-
-   -alphaHot*(T_h_out - TwallCold) + der(TwallCold)*plateMetalMass*cpMetal/surfaceArea = -alphaCold*(TwallCold-T_c_in);
+  heatFlowHotLiquidTube.Q_flow+heatFlowColdLiquidTube.Q_flow =0;
+//heatFlowColdLiquidTube.Q_flow = -logDtCold*alphaCold*surfaceArea;
+    (-alphaHot * (T_h_out - TwallCold)) + der(TwallCold) * plateMetalMass * cpMetal / surfaceArea = -alphaCold * (TwallCold - T_c_in);
    -alphaHot*(T_h_in-TwallHot)+der(TwallHot)*plateMetalMass*cpMetal/surfaceArea  = -alphaCold*(TwallHot - T_c_out);
 
    QFlowFromHotLiqidOutToColdWall =  surfaceArea*alphaHot*(T_h_out - TwallCold);
    QFlowFromHotLiqidInToHotWall =  surfaceArea*alphaHot*(T_h_in-TwallHot);
    QFlowFromColdLiqidInToColdWall = - surfaceArea*alphaCold*(TwallCold- T_c_in);
-   QFlowFromColdLiqidOutToHotWall =  -surfaceArea*alphaCold*(TwallHot - T_c_out);
-
-  // connect(heatFlowHotLiquid,hotLiquidTube.heatPort);
-   // connect(heatFlowColdLiquid,coldLiquidTube.heatPort);
-   connect(alpha_in,alpha_internal);
+   QFlowFromColdLiqidOutToHotWall =  -surfaceArea*alphaCold*(TwallHot - T_c_out);
+// connect(heatFlowHotLiquid,hotLiquidTube.heatPort);
+// connect(heatFlowColdLiquid,coldLiquidTube.heatPort);
+    connect(alpha_in, alpha_internal);
 
     connect(hotLiquidIn, hotLiquidTube.liquidIn)
                                                annotation (Line(
@@ -320,9 +311,9 @@
 
   model LiquidTube "ideal - no pressure loss"
 
-    //import CCS.ThermalSeparation;
+//import CCS.ThermalSeparation;
       outer ThermalSeparation.SystemTS systemTS;
-  parameter Modelica.SIunits.Temperature T_ref=systemTS.T_ref "reference temperature"
+  parameter Modelica.Units.SI.Temperature T_ref=systemTS.T_ref "reference temperature"
                                                                           annotation(Dialog(tab="Advanced"));
 
   replaceable package MediumLiquid =
@@ -344,69 +335,67 @@
       annotation (Placement(transformation(extent={{70,-24},{90,-4}}),
           iconTransformation(extent={{40,-10},{60,10}})));
 
-  //parameter Boolean inertLiquid[nSL] = fill(false,nSL);
-
+//parameter Boolean inertLiquid[nSL] = fill(false,nSL);
     final parameter Integer nSL = MediumLiquid.nSubstance;
 
   /*** Medium properties ***/
-  Modelica.SIunits.Density rho_l;
-  parameter Modelica.SIunits.Concentration c_l_start[nSL]={5,40000};
-  Modelica.SIunits.Concentration c_l[nSL](start=c_l_start, each nominal=1e4);
+  Modelica.Units.SI.Density rho_l;
+  parameter Modelica.Units.SI.Concentration c_l_start[nSL]={5,40000};
+  Modelica.Units.SI.Concentration c_l[nSL](start=c_l_start, each nominal=1e4);
   //Modelica.SIunits.Concentration c_l_in[nSL](start=c_l_start, each nominal=1e4);
-  Modelica.SIunits.MoleFraction x_l[nSL];
+  Modelica.Units.SI.MoleFraction x_l[nSL];
     ThermalSeparation.Units.MolarEnthalpy h_l(stateSelect=StateSelect.prefer,start=1e6);
     ThermalSeparation.Units.MolarEnthalpy u_l;
-    Modelica.SIunits.MolarMass MM_l;
-  Modelica.SIunits.MoleFraction x_l_in[nSL];
+    Modelica.Units.SI.MolarMass MM_l;
+  Modelica.Units.SI.MoleFraction x_l_in[nSL];
     ThermalSeparation.Units.MolarEnthalpy h_l_in;
 
-      Modelica.SIunits.Temperature T_l_in;
-    Modelica.SIunits.Temperature T_l;
+      Modelica.Units.SI.Temperature T_l_in;
+    Modelica.Units.SI.Temperature T_l;
                        //(stateSelect=StateSelect.prefer);
 
-    Modelica.SIunits.VolumeFlowRate Vdot_l(start=1e-3, nominal=1e3)=-liquidOut.Ndot*MM_l/rho_l;
-    Modelica.SIunits.VolumeFlowRate Vdot_l_in=liquidIn.Ndot*mediumLiquidIn.MM/mediumLiquidIn.d;
+    Modelica.Units.SI.VolumeFlowRate Vdot_l(start=1e-3, nominal=1e3)=-liquidOut.Ndot*MM_l/rho_l;
+    Modelica.Units.SI.VolumeFlowRate Vdot_l_in=liquidIn.Ndot*mediumLiquidIn.MM/mediumLiquidIn.d;
 
-    Modelica.SIunits.HeatFlowRate Qdot_wall;
-    Modelica.SIunits.Pressure p_out;
-    Modelica.SIunits.Pressure p_in;
+    Modelica.Units.SI.HeatFlowRate Qdot_wall;
+    Modelica.Units.SI.Pressure p_out;
+    Modelica.Units.SI.Pressure p_in;
 
     parameter Boolean ss_c2=false "true if c_l[2] is to be a state";
-    Modelica.SIunits.Concentration dummy(stateSelect=StateSelect.prefer)=c_l[2] if
+    Modelica.Units.SI.Concentration dummy(stateSelect=StateSelect.prefer)=c_l[2] if
          ss_c2;
-  //    SI.Concentration dummy2(stateSelect=StateSelect.prefer)=c_l[3] if ss_c2;
+  //    SI.Concentration dummy2(stateSelect=StateSelect.prefer)=c_l[3] if ss_c2;
 
   public
     Real a = Qdot_wall/(2500*max(1e-6,Vdot_l_in)*1000);
 
     /*** geometry data ***/
-      final parameter Modelica.SIunits.Area A=Modelica.Constants.pi/4*d_volume^2;
-    final parameter Modelica.SIunits.Height H=length_out;
+      final parameter Modelica.Units.SI.Area A=Modelica.Constants.pi/4*d_volume^2;
+    final parameter Modelica.Units.SI.Height H=length_out;
   parameter Real N_w= 20 "number of resistances in flow direction";
   //  parameter SI.Length s = 0.03 "distance between the center of two tubes";
-    parameter Modelica.SIunits.Length d=0.01 "tube diameter";
+    parameter Modelica.Units.SI.Length d=0.01 "tube diameter";
    // final parameter Real a_pL = s/d;
 
-    parameter Modelica.SIunits.Length height_in=-0.15;
+    parameter Modelica.Units.SI.Length height_in=-0.15;
     parameter Real zeta = 0.048;
-    parameter Modelica.SIunits.Length length_out=0.15;
-    parameter Modelica.SIunits.Diameter d_volume=0.025;
-    // Real test;
-
+    parameter Modelica.Units.SI.Length length_out=0.15;
+    parameter Modelica.Units.SI.Diameter d_volume=0.025;
+    // Real test;
   Real delta_h;
   Real delta_zeta;
-  parameter Modelica.SIunits.Temperature T_start=300;
+  parameter Modelica.Units.SI.Temperature T_start=300;
   parameter Boolean p_state=true "p is state";
   parameter Boolean useX_start = true;
 
   /*** Monitoring ***/
-  Modelica.SIunits.Volume V_liq=A*H;
+  Modelica.Units.SI.Volume V_liq=A*H;
   Real sum_x = sum(x_l);
 
-  equation
-     //downstream
-  //   liquidIn.p = liquidOut.p;
-  liquidIn.x_outflow = inStream(liquidOut.x_outflow);
+  equation
+//downstream
+//   liquidIn.p = liquidOut.p;
+    liquidIn.x_outflow = inStream(liquidOut.x_outflow);
   liquidIn.h_outflow = inStream(liquidOut.h_outflow);
 
      liquidIn.p = p_in;
@@ -416,11 +405,10 @@
      inStream(liquidIn.x_outflow) = x_l_in;
      liquidOut.x_outflow = x_l;
 
-  h_l_in=inStream(liquidIn.h_outflow);
-    //h_l_in =mediumLiquidIn.h;
-
-    //h_l =mediumLiquid.h;
-    u_l =mediumLiquid.u;
+  h_l_in=inStream(liquidIn.h_outflow);
+//h_l_in =mediumLiquidIn.h;
+//h_l =mediumLiquid.h;
+    u_l = mediumLiquid.u;
      rho_l = mediumLiquid.d;
      MM_l = mediumLiquid.MM;
 
@@ -435,21 +423,18 @@
       /*** static mass balance ***/
       /*** if a dynamic mass balance is used, the concentration c_l needs initial values ***/
         liquidIn.Ndot + liquidOut.Ndot =0;
-       x_l = x_l_in;
-  //      sum(x_l)=1;
-        //A*H*der(c_l) = Vdot_l_in*(c_l_in)- Vdot_l * (c_l);
-
-    /*** heat port ***/
+       x_l = x_l_in;
+//      sum(x_l)=1;
+//A*H*der(c_l) = Vdot_l_in*(c_l_in)- Vdot_l * (c_l);
+/*** heat port ***/
     Qdot_wall = heatPort.Q_flow;
-    T_l=heatPort.T;
-
-  //  p_out=p;
-
-    /*** pressure loss ***/
-    // Vdot_v=1;
-  //p_in-p_out = 5* N_w *(eps_vap*rho_v+eps_liq*rho_l)/2*a_pL/(a_pL-1) * (Vdot_v+Vdot_l)/A;
-  //p_in-p_out = height_in*Modelica.Constants.g_n*rho_l + zeta*length_out/(2*d*A^2) * (Vdot_l)^2 *  rho_l;
-  p_in-p_out = 0;
+    T_l=heatPort.T;
+//  p_out=p;
+/*** pressure loss ***/
+// Vdot_v=1;
+//p_in-p_out = 5* N_w *(eps_vap*rho_v+eps_liq*rho_l)/2*a_pL/(a_pL-1) * (Vdot_v+Vdot_l)/A;
+//p_in-p_out = height_in*Modelica.Constants.g_n*rho_l + zeta*length_out/(2*d*A^2) * (Vdot_l)^2 *  rho_l;
+    p_in - p_out = 0;
 
    delta_h=height_in*Modelica.Constants.g_n*rho_l;
    delta_zeta=zeta*length_out/(2*d*A^2) * (Vdot_l)^2 *  rho_l;
@@ -458,8 +443,8 @@
     T_l=T_start;
     if useX_start then
       x_l[2]=1-1e-5;
-   //  x_l[2]= 0.9446;
-   //  x_l[3]=0.0157;
+//  x_l[2]= 0.9446;
+//  x_l[3]=0.0157;
     end if;
 
     annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/BaseClasses/BaseLSF.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/BaseClasses/BaseLSF.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/BaseClasses/BaseLSF.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/BaseClasses/BaseLSF.mo"	2022-03-10 09:58:37.540151669 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Components.Reboiler.BaseClasses;
+within ThermalSeparation.Components.Reboiler.BaseClasses;
 partial model BaseLSF
   extends Icons.Icons.Flash;
  /*** Initialization ***/
@@ -57,13 +57,12 @@
 
   SI.Pressure wassersaeule = eps_liq*h_Flash*Modelica.Constants.g_n*rho_l;
 
-// replaceable model PressureLoss =
-//       ThermalSeparation.PressureLoss.Reboiler.TubeHX                                  constrainedby
-//     ThermalSeparation.PressureLoss.Reboiler.BasePressureLoss annotation (
-//       choicesAllMatching=true);
-// PressureLoss pressureLoss(zeta=zeta, p_in = p_hyd[1], p_out = p_hyd[2], eps_liq = eps_liq, rho_l = rho_l, rho_v = rho_v, d_HX = d_HX, length_HX = length_HX, d_tube=d_tube, Nw=Nw);
-
-//connectors
+// replaceable model PressureLoss =
+  //       ThermalSeparation.PressureLoss.Reboiler.TubeHX                                  constrainedby
+  //     ThermalSeparation.PressureLoss.Reboiler.BasePressureLoss annotation (
+  //       choicesAllMatching=true);
+  // PressureLoss pressureLoss(zeta=zeta, p_in = p_hyd[1], p_out = p_hyd[2], eps_liq = eps_liq, rho_l = rho_l, rho_v = rho_v, d_HX = d_HX, length_HX = length_HX, d_tube=d_tube, Nw=Nw);
+  //connectors
       Interfaces.LiquidPortIn liquidIn(redeclare package Medium=MediumLiquid)
                                          annotation (Placement(transformation(
            extent={{-10,-90},{10,-70}}, rotation=0), iconTransformation(extent=
@@ -125,7 +124,7 @@
     SI.MolarFlowRate Ndot_v_transfer[      nSV](start=fill(-0.1,nSV));
   SI.MolarFlowRate Ndot_l_transfer[        nSL](start=fill(0.1,nSL));
 
-//Variablen zur Enthalpiestromberechnung Ã¼ber die Phasengrenze
+//Variablen zur Enthalpiestromberechnung Ã¼ber die Phasengrenze
   SI.MolarFlowRate Ndot_fromL[nSL];
    SI.MolarFlowRate Ndot_fromV[nSV];
     SI.MoleFraction x_transfer_fromL[nSL];
@@ -164,7 +163,7 @@
 
   /*** geometry data ***/
   final parameter SI.Volume V= Modelica.Constants.pi/4*d_Flash^2*h_Flash;
-//parameter Real zeta =  8.6;
+ //parameter Real zeta =  8.6;
   parameter SI.Diameter d_Flash=5.7;
   parameter SI.Height h_Flash = 17;
   parameter SI.Diameter d_tube = 0.025 "outer diameter of tubes";
@@ -173,7 +172,7 @@
   parameter SI.Length length_HX = 0.75 "length of tubes";
   parameter SI.Pressure p_start=1.025e5 annotation(Dialog(tab="Initialization"));
 
-     //Model for reaction
+//Model for reaction
   replaceable model Reaction =
       ApplicationsThermalSeparation.Reaction.CO2_Siemens            constrainedby ThermalSeparation.Reaction.BaseReaction
                                                                                                                         annotation(choicesAllMatching=true);
@@ -210,18 +209,18 @@
 /*** StartUp ***/
   SI.Pressure p_hyd[2] "hydraulic pressure";
 
-equation
-       //upstream
-    vapourOut.p = p_out;
+equation
+//upstream
+  vapourOut.p = p_out;
     vapourOut.c = c_v;
     vapourOut.Vdot = -Vdot_v;
     vapourOut.T =T_v;
     vapourOut.x =x_v;
-    vapourOut.p_medium=p;
-    //downstream
-    liquidIn.p = p_in;
-   // liquidOut.p = p_out;
-    liquidIn.c = c_l_in;
+    vapourOut.p_medium=p;
+//downstream
+  liquidIn.p = p_in;
+// liquidOut.p = p_out;
+  liquidIn.c = c_l_in;
     liquidOut.c = c_l;
     liquidIn.Vdot = Vdot_l_in;
     liquidOut.Vdot = -Vdot_l;
@@ -231,15 +230,13 @@
     liquidOut.x = x_l;
        /*** heat port ***/
   Qdot_wall = heatPort.Q_flow;
-  T_l=heatPort.T;
-
-/*** system pressure ***/
-//p_in=p;
-p=p_in-wassersaeule;
-
-  for i in 1:nSL loop
-    //c_l_star[j,i] = x_l_star[j,i] / MM_l_star[j]*rho_l_star[j];
-    c_l_star[i] = (x_l_star[i]+x_l[i])/2 / MM_l_star*rho_l_star;
+  T_l=heatPort.T;
+/*** system pressure ***/
+//p_in=p;
+  p = p_in - wassersaeule;
+ for i in 1:nSL loop
+//c_l_star[j,i] = x_l_star[j,i] / MM_l_star[j]*rho_l_star[j];
+    c_l_star[i] = (x_l_star[i] + x_l[i]) / 2 / MM_l_star * rho_l_star;
   end for;
 
              /*** correlation between mole fraction x and concentration c ***/
@@ -256,53 +253,52 @@
 
   /*** to do: startUp ***/
   p_hyd[1]=p;
-  p_hyd[2]=p_out;
-
-  /*** mole balance ***/
-   for i in 1:nSV loop
-   // component balance for vapour
-  V* der(eps_vap*c_v[i]) =  - Vdot_v * c_v[i] + Ndot_v_transfer[i]; //+ Vdot_v_in*c_v_in[i];
-  end for;
-  for i in 1:nSL loop
-    // component balance for liquid
-   V* der(eps_liq*c_l[i]) = Vdot_l_in*c_l_in[i] - Vdot_l * c_l[i] + Ndot_l_transfer[i] + reaction.Ndot[i];
-  end for;
-  // total mole balance for liquid and vapour
-  //reaction.Ndot muÃŸ nicht berÃ¼cksichtigt werden, da die Reaktion ja in der FlÃ¼ssigphase stattfindet und nur "FlÃ¼ssigkeit zu FlÃ¼ssigkeit" wird
-   if eps_liq<1e-5 and Vdot_l_in<1e-8 then
-     bool_eps=true;
-     der(eps_liq)=0;
- else
-   bool_eps=false;
-    V* der(eps_liq*rho_l/MM_l) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l*rho_l/MM_l + sum(Ndot_l_transfer[:]) + sum(reaction.Ndot[:]);
-    end if;
-       V* der(eps_vap*rho_v/MM_v) =  -  Vdot_v*rho_v/MM_v + sum(Ndot_v_transfer[:]);// + Vdot_v_in*mediumVapourIn.d/mediumVapourIn.MM;
-
-  eps_liq+eps_vap=1;
+  p_hyd[2]=p_out;
+/*** mole balance ***/
+  for i in 1:nSV loop
+// component balance for vapour
+    V * der(eps_vap * c_v[i]) = (-Vdot_v * c_v[i]) + Ndot_v_transfer[i];
+//+ Vdot_v_in*c_v_in[i];
+  end for;
+ for i in 1:nSL loop
+// component balance for liquid
+    V * der(eps_liq * c_l[i]) = Vdot_l_in * c_l_in[i] - Vdot_l * c_l[i] + Ndot_l_transfer[i] + reaction.Ndot[i];
+  end for;
+// total mole balance for liquid and vapour
+//reaction.Ndot muÃŸ nicht berÃ¼cksichtigt werden, da die Reaktion ja in der FlÃ¼ssigphase stattfindet und nur "FlÃ¼ssigkeit zu FlÃ¼ssigkeit" wird
+  if eps_liq < 1e-5 and Vdot_l_in < 1e-8 then
+    bool_eps = true;
+    der(eps_liq) = 0;
+  else
+    bool_eps = false;
+    V * der(eps_liq * rho_l / MM_l) = Vdot_l_in * rho_l_in / MM_l_in - Vdot_l * rho_l / MM_l + sum(Ndot_l_transfer[:]) + sum(reaction.Ndot[:]);
+  end if;
+       V* der(eps_vap*rho_v/MM_v) =  -  Vdot_v*rho_v/MM_v + sum(Ndot_v_transfer[:]);
+// + Vdot_v_in*mediumVapourIn.d/mediumVapourIn.MM;
+  eps_liq + eps_vap = 1;
 
     /***energy balance ***/
 V * der(eps_liq*sum(c_l[:])*u_l)  = Vdot_l_in*sum(c_l_in)*h_l_in - Vdot_l*sum(c_l[:])*h_l  + Edot_l_transfer  +reaction.deltaH_R + Qdot_wall -Qdot_evap;
- V * der(eps_vap*sum(c_v[:])*u_v)  =  - Vdot_v*sum(c_v[:])*h_v +Edot_v_transfer;// + Qdot_wall;// + Vdot_v_in*sum(c_v_in[:])*mediumVapourIn.h;
-
- //zur Berechnung der EnthalpiestrÃ¶me Ã¼ber die Phasengrenze
-  for i in 1:nSL loop
-    Ndot_fromL[i] = -1*min(0,Ndot_l_transfer[i]);
-    x_transfer_fromL[i] = Ndot_fromL[i]/max(1e-5,sum(Ndot_fromL[:]));
-       if inertLiquid[i] then
-       x_transfer_toL[i] = 0;
-     end if;
+ V * der(eps_vap*sum(c_v[:])*u_v)  =  - Vdot_v*sum(c_v[:])*h_v +Edot_v_transfer;
+// + Qdot_wall;// + Vdot_v_in*sum(c_v_in[:])*mediumVapourIn.h;
+//zur Berechnung der EnthalpiestrÃ¶me Ã¼ber die Phasengrenze
+  for i in 1:nSL loop
+    Ndot_fromL[i] = -1 * min(0, Ndot_l_transfer[i]);
+    x_transfer_fromL[i] = Ndot_fromL[i] / max(1e-5, sum(Ndot_fromL[:]));
+    if inertLiquid[i] then
+      x_transfer_toL[i] = 0;
+    end if;
   end for;
      for i in 1:nS loop
        x_transfer_toL[mapping[i,2]]=  x_transfer_fromV[mapping[i,1]];
-     end for;
-  for i in 1:nSV loop
-    Ndot_fromV[i] = -1*min(0,Ndot_v_transfer[i]);
-    x_transfer_fromV[i] = Ndot_fromV[i]/max(1e-5,sum(Ndot_fromV[:]));
-         if inertVapour[i] then
-       x_transfer_toV[i] = 0;
-     else
-     end if;
-    end for;
+     end for;
+ for i in 1:nSV loop
+    Ndot_fromV[i] = -1 * min(0, Ndot_v_transfer[i]);
+    x_transfer_fromV[i] = Ndot_fromV[i] / max(1e-5, sum(Ndot_fromV[:]));
+    if inertVapour[i] then
+      x_transfer_toV[i] = 0;
+    end if;
+  end for;
      for i in 1:nS loop
        x_transfer_toV[mapping[i,1]]=  x_transfer_fromL[mapping[i,2]];
      end for;
@@ -315,13 +311,13 @@
       end for;
       for i in 1:nSV-1 loop
     Ndot_v_transfer[i] =  - 1e6*(x_v[i] - x_v_star[i]);
-    end for;
-     //Liquid side
-   for i in 1:nSL loop
-     if inertLiquid[i] then
-       Ndot_l_transfer[i] = 0;
-     end if;
-     end for;
+    end for;
+//Liquid side
+  for i in 1:nSL loop
+    if inertLiquid[i] then
+      Ndot_l_transfer[i] = 0;
+    end if;
+  end for;
      for i in 1:nSL-1 loop
      Ndot_l_transfer[i] =  - 1e6* (x_l[i] - x_l_star[i]);
    end for;
@@ -337,9 +333,9 @@
 end for;
 
 /*** energy balance at phase boundary ***/
-    -Edot_v_transfer - Edot_l_transfer  =0;//-  Qdot_evap =0;
-
-    Qdot_l_transfer =  1e8* (T_star - T_l);
+    -Edot_v_transfer - Edot_l_transfer  =0;
+//-  Qdot_evap =0;
+  Qdot_l_transfer = 1e8 * (T_star - T_l);
     Qdot_v_transfer= 1e8*(T_star - T_v);
 
       Edot_l_transfer =   Qdot_l_transfer + sum(Ndot_fromV[:])*h_transfer_toL - sum(Ndot_fromL[:])*h_transfer_fromL;
@@ -351,13 +347,11 @@
        x_v_star[mapping[i,1]]= K[i] *x_l_star[mapping[i,2]];
     K[i] = thermoEquilibrium.K[i];
  end for;
-// entfernt: stattdessen: Vdot_l wird Ã¼ber Boundary vorgegeben
-//  Vdot_l = Vdot_v*eps_liq/eps_vap;
-
+// entfernt: stattdessen: Vdot_l wird Ã¼ber Boundary vorgegeben
+//  Vdot_l = Vdot_v*eps_liq/eps_vap;
 /*** Der Gleichung fÃ¼r Druckverlust bei UmstrÃ¶mung von RohrbÃ¼ndeln nachempfunden (VDI-WÃ¤rmeatlas), zeta wird allerdings als Parameter vorgegeben
      Sowieso alles nur mig gut, weil der Volumenstrom sich ja signifikant Ã¼ber die HX-HÃ¶he Ã¤ndert ***/
-//Vdot_v = pressureLoss.Vdot;// sqrt(max(1e-8,(p - p_out - eps_liq*d_HX*Modelica.Constants.g_n*rho_l)*2*length_HX^2*(d_HX-10*d_tube)^2/(zeta*Nw*(eps_liq*rho_l + eps_vap*rho_v))));
-
+//Vdot_v = pressureLoss.Vdot;// sqrt(max(1e-8,(p - p_out - eps_liq*d_HX*Modelica.Constants.g_n*rho_l)*2*length_HX^2*(d_HX-10*d_tube)^2/(zeta*Nw*(eps_liq*rho_l + eps_vap*rho_v))));
 initial equation
    if initEQ then
 
@@ -375,9 +369,9 @@
 
      T_v = T_v_start;
      T_l = T_l_start;
-    // der(T_v)=0;
-   //  der(T_l)=0;
-  // der(p)=0;
+// der(T_v)=0;
+//  der(T_l)=0;
+// der(p)=0;
    p = p_start;
 
 Ndot_v_transfer=zeros(nSV);
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/BaseClasses/BaseReboiler.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/BaseClasses/BaseReboiler.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/BaseClasses/BaseReboiler.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/BaseClasses/BaseReboiler.mo"	2022-03-10 09:58:37.500151664 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Components.Reboiler.BaseClasses;
+within ThermalSeparation.Components.Reboiler.BaseClasses;
 partial model BaseReboiler
  /*** Initialization ***/
       outer ThermalSeparation.SystemTS systemTS;
@@ -100,7 +100,7 @@
     SI.MolarFlowRate Ndot_v_transfer[      nSV](start=fill(-0.1,nSV));
   SI.MolarFlowRate Ndot_l_transfer[        nSL](start=fill(0.1,nSL));
 
-//Variablen zur Enthalpiestromberechnung Ã¼ber die Phasengrenze
+//Variablen zur Enthalpiestromberechnung Ã¼ber die Phasengrenze
   SI.MolarFlowRate Ndot_fromL[nSL];
    SI.MolarFlowRate Ndot_fromV[nSV];
     SI.MoleFraction x_transfer_fromL[nSL];
@@ -122,7 +122,7 @@
   SI.Pressure p_in;
   SI.Pressure p;
   SI.Pressure p_sat[nSL] = {mediumLiquid.p_sat[i] for i in 1:nSL};
-  // SI.Pressure p_sat[nSL] = {mediumLiquidStar.p_sat[i] for i in 1:nSL};
+  // SI.Pressure p_sat[nSL] = {mediumLiquidStar.p_sat[i] for i in 1:nSL};
    SI.Pressure p_sat_bulk[nSL]={mediumLiquid.p_sat[i] for i in 1:nSL};
 
 Boolean bool_eps;
@@ -162,7 +162,7 @@
       choicesAllMatching=true);
 PressureLoss pressureLoss(zeta=zeta, p_in = p_hyd[1], p_out = p_hyd[2], eps_liq = eps_liq, rho_l = rho_l, rho_v = rho_v, d_HX = d_HX, length_HX = length_HX, d_tube=d_tube, Nw=Nw);
 
-     //Model for reaction
+//Model for reaction
   replaceable model Reaction =
       ApplicationsThermalSeparation.Reaction.CO2_Siemens            constrainedby ThermalSeparation.Reaction.BaseReaction
                                                                                                                         annotation(choicesAllMatching=true);
@@ -172,7 +172,7 @@
 /*** StartUp ***/
   parameter Boolean considerStartUp = false
     "true if StartUp is to be considered" annotation(Dialog(tab="StartUp"));
-  SI.Pressure p_initial "initial pressure in column"; //has to be provided in extending class
+  SI.Pressure p_initial "initial pressure in column";   //has to be provided in extending class
   parameter Real friggelfaktor = 0.0002e5 annotation(Dialog(tab="StartUp"));
   parameter Real k=0.2e-3 annotation(Dialog(tab="StartUp"));
   SI.Pressure p_bub= bubblePressure.p_bubble "mixture bubble pressure";
@@ -210,14 +210,13 @@
        u_s = p_initial,
       yMax=100,
       k=0.005,
-     initType=Modelica.Blocks.Types.InitPID.InitialOutput)   annotation (Placement(transformation(extent={{-24,-12},{-4,8}})));
+     initType=Modelica.Blocks.Types.Init.InitialOutput)   annotation (Placement(transformation(extent={{-24,-12},{-4,8}})));
 
 equation
-      PID.u_m = if considerStartUp and startUp then p else if considerStartUp and not startUp then p_initial else p_initial;
-
-  for i in 1:nSL loop
-    //c_l_star[j,i] = x_l_star[j,i] / MM_l_star[j]*rho_l_star[j];
-    c_l_star[i] = (x_l_star[i]+x_l[i])/2 / MM_l_star*rho_l_star;
+      PID.u_m = if considerStartUp and startUp then p else if considerStartUp and not startUp then p_initial else p_initial;
+ for i in 1:nSL loop
+//c_l_star[j,i] = x_l_star[j,i] / MM_l_star[j]*rho_l_star[j];
+    c_l_star[i] = (x_l_star[i] + x_l[i]) / 2 / MM_l_star * rho_l_star;
   end for;
 
 /*** correlation between mole fraction x and concentration c ***/
@@ -230,69 +229,67 @@
   end for;
   for i in 1:nV loop
     x_v[i+nS] *rho_v= c_v[i+nS] * MM_v;
-  end for;
-
-/*** StartUp ***/
-  when p_bub + friggelfaktor >= p_initial then // der Druck, den auch das Medienmodell sieht, friggelfaktor, weil sonst Umschalten zu spÃ¤t
-    startUp = false;
+  end for;
+/*** StartUp ***/
+  when p_bub + friggelfaktor >= p_initial then
+// der Druck, den auch das Medienmodell sieht, friggelfaktor, weil sonst Umschalten zu spÃ¤t
+    startUp = false;
   end when;
 
     omega = min(1,1 + tanh(k*(p_bub + friggelfaktor - p_initial)));
 
-  p_hyd[1] = if considerStartUp then (p_initial * (1 - omega)) + p * omega else p;
-
-           if startUp then
-   Ndot_source_startUp=PID.y;//-0.001;
-     else
-      Ndot_source_startUp=0;
-     end if;
-p_hyd[2] = p_out;
-
-  /*** mole balance ***/
-   for i in 1:nSV loop
-   // component balance for vapour
-  V* der(eps_vap*c_v[i]) =  - Vdot_v * c_v[i] + Ndot_v_transfer[i] + Ndot_source_startUp * x_v[i];
-  end for;
-  for i in 1:nSL loop
-    // component balance for liquid
-   V* der(eps_liq*c_l[i]) = Vdot_l_in*c_l_in[i] - Vdot_l * c_l[i] + Ndot_l_transfer[i] + reaction.Ndot[i];
-  end for;
-  // total mole balance for liquid and vapour
-  //reaction.Ndot muÃŸ nicht berÃ¼cksichtigt werden, da die Reaktion ja in der FlÃ¼ssigphase stattfindet und nur "FlÃ¼ssigkeit zu FlÃ¼ssigkeit" wird
-   if eps_liq<1e-5 and Vdot_l_in<1e-8 then
-     bool_eps=true;
-     der(eps_liq)=0;
- else
-   bool_eps=false;
-    V* der(eps_liq*rho_l/MM_l) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l*rho_l/MM_l + sum(Ndot_l_transfer[:]) + sum(reaction.Ndot[:]);
-    end if;
+  p_hyd[1] = if considerStartUp then (p_initial * (1 - omega)) + p * omega else p;
+ if startUp then
+    Ndot_source_startUp = PID.y;
+//-0.001;
+  else
+    Ndot_source_startUp = 0;
+  end if;
+p_hyd[2] = p_out;
+/*** mole balance ***/
+  for i in 1:nSV loop
+// component balance for vapour
+    V * der(eps_vap * c_v[i]) = (-Vdot_v * c_v[i]) + Ndot_v_transfer[i] + Ndot_source_startUp * x_v[i];
+  end for;
+ for i in 1:nSL loop
+// component balance for liquid
+    V * der(eps_liq * c_l[i]) = Vdot_l_in * c_l_in[i] - Vdot_l * c_l[i] + Ndot_l_transfer[i] + reaction.Ndot[i];
+  end for;
+// total mole balance for liquid and vapour
+//reaction.Ndot muÃŸ nicht berÃ¼cksichtigt werden, da die Reaktion ja in der FlÃ¼ssigphase stattfindet und nur "FlÃ¼ssigkeit zu FlÃ¼ssigkeit" wird
+  if eps_liq < 1e-5 and Vdot_l_in < 1e-8 then
+    bool_eps = true;
+    der(eps_liq) = 0;
+  else
+    bool_eps = false;
+    V * der(eps_liq * rho_l / MM_l) = Vdot_l_in * rho_l_in / MM_l_in - Vdot_l * rho_l / MM_l + sum(Ndot_l_transfer[:]) + sum(reaction.Ndot[:]);
+  end if;
        V* der(eps_vap*rho_v/MM_v) =  -  Vdot_v*rho_v/MM_v + sum(Ndot_v_transfer[:])+ Ndot_source_startUp;
 
   eps_liq+eps_vap=1;
 
     /***energy balance ***/
 V * der(eps_liq*sum(c_l[:])*u_l)  = Vdot_l_in*sum(c_l_in)*h_l_in - Vdot_l*sum(c_l[:])*h_l  + Edot_l_transfer  +reaction.deltaH_R + Qdot_wall -Qdot_evap;
- V * der(eps_vap*sum(c_v[:])*u_v)  =  - Vdot_v*sum(c_v[:])*h_v +Edot_v_transfer +Ndot_source_startUp*h_v;// + Qdot_wall;// + Vdot_v_in*sum(c_v_in[:])*mediumVapourIn.h;
-
- //zur Berechnung der EnthalpiestrÃ¶me Ã¼ber die Phasengrenze
-  for i in 1:nSL loop
-    Ndot_fromL[i] = -1*min(0,Ndot_l_transfer[i]);
-    x_transfer_fromL[i] = Ndot_fromL[i]/max(1e-5,sum(Ndot_fromL[:]));
-       if inertLiquid[i] then
-       x_transfer_toL[i] = 0;
-     end if;
+ V * der(eps_vap*sum(c_v[:])*u_v)  =  - Vdot_v*sum(c_v[:])*h_v +Edot_v_transfer +Ndot_source_startUp*h_v;
+// + Qdot_wall;// + Vdot_v_in*sum(c_v_in[:])*mediumVapourIn.h;
+//zur Berechnung der EnthalpiestrÃ¶me Ã¼ber die Phasengrenze
+  for i in 1:nSL loop
+    Ndot_fromL[i] = -1 * min(0, Ndot_l_transfer[i]);
+    x_transfer_fromL[i] = Ndot_fromL[i] / max(1e-5, sum(Ndot_fromL[:]));
+    if inertLiquid[i] then
+      x_transfer_toL[i] = 0;
+    end if;
   end for;
      for i in 1:nS loop
        x_transfer_toL[mapping[i,2]]=  x_transfer_fromV[mapping[i,1]];
-     end for;
-  for i in 1:nSV loop
-    Ndot_fromV[i] = -1*min(0,Ndot_v_transfer[i]);
-    x_transfer_fromV[i] = Ndot_fromV[i]/max(1e-5,sum(Ndot_fromV[:]));
-         if inertVapour[i] then
-       x_transfer_toV[i] = 0;
-     else
-     end if;
-    end for;
+     end for;
+ for i in 1:nSV loop
+    Ndot_fromV[i] = -1 * min(0, Ndot_v_transfer[i]);
+    x_transfer_fromV[i] = Ndot_fromV[i] / max(1e-5, sum(Ndot_fromV[:]));
+    if inertVapour[i] then
+      x_transfer_toV[i] = 0;
+    end if;
+  end for;
      for i in 1:nS loop
        x_transfer_toV[mapping[i,1]]=  x_transfer_fromL[mapping[i,2]];
      end for;
@@ -313,17 +310,16 @@
            Ndot_v_transfer[i] = - A_HT* 1e2*(x_v[i] - x_v_star[i]);
         end for;
         sum(x_v_star)=1;
-     end if;
-
-//       for i in 1:nSV-1 loop
-//      Ndot_v_transfer[i] =  - A_HT* 1e2*(x_v[i] - x_v_star[i]);
-//     end for;
-     //Liquid side
-   for i in 1:nSL loop
-     if inertLiquid[i] then
-       Ndot_l_transfer[i] = 0;
-     end if;
-     end for;
+     end if;
+//       for i in 1:nSV-1 loop
+//      Ndot_v_transfer[i] =  - A_HT* 1e2*(x_v[i] - x_v_star[i]);
+//     end for;
+//Liquid side
+  for i in 1:nSL loop
+    if inertLiquid[i] then
+      Ndot_l_transfer[i] = 0;
+    end if;
+  end for;
      for i in 1:nSL-1 loop
       Ndot_l_transfer[i] =  - A_HT* 1e2* (x_l[i] - x_l_star[i]);
    end for;
@@ -339,9 +335,10 @@
 end for;
 
 /*** energy balance at phase boundary ***/
-    -Edot_v_transfer - Edot_l_transfer =0;//-  Qdot_evap =0;
-    /*** a dummy overall heat transfer coefficient is used ***/
-     Qdot_l_transfer = A_HT*1e4* (T_star - T_l);
+    -Edot_v_transfer - Edot_l_transfer =0;
+//-  Qdot_evap =0;
+/*** a dummy overall heat transfer coefficient is used ***/
+  Qdot_l_transfer = A_HT * 1e4 * (T_star - T_l);
      Qdot_v_transfer= A_HT*1e4*(T_star - T_v);
 
       Edot_l_transfer =   Qdot_l_transfer + sum(Ndot_fromV[:])*h_transfer_toL - sum(Ndot_fromL[:])*h_transfer_fromL;
@@ -358,11 +355,10 @@
 
 /*** Der Gleichung fÃ¼r Druckverlust bei UmstrÃ¶mung von RohrbÃ¼ndeln nachempfunden (VDI-WÃ¤rmeatlas; Ld1, Gl. (1)), zeta wird allerdings als Parameter vorgegeben
      Sowieso alles nur mig gut, weil der Volumenstrom sich ja signifikant Ã¼ber die HX-HÃ¶he Ã¤ndert ***/
- Vdot_v = pressureLoss.Vdot;//sign(p_hyd[1] - p_hyd[2])*max(0, (abs(p_hyd[1] - p_hyd[2])/(0.05e5/0.02)));
-
-/*** system pressure ***/
-p=p_in-wassersaeule;
-
+ Vdot_v = pressureLoss.Vdot;
+//sign(p_hyd[1] - p_hyd[2])*max(0, (abs(p_hyd[1] - p_hyd[2])/(0.05e5/0.02)));
+/*** system pressure ***/
+  p = p_in - wassersaeule;
 initial equation
 if initOption == InitOption.initEQ and not considerStartUp then
   for i in 1:nSL loop
@@ -419,13 +415,11 @@
 
   eps_liq=eps_liq_start;
 end if;
-
-// initial algorithm
-//  henryBool :=fill(false, nSV);
-//
-// for i in 1:b[1] loop
-//    henryBool[MediumVapour.henry[i]] := if inertVapour[MediumVapour.henry[i]] then false else true;
-//  end for;
-
+// initial algorithm
+//  henryBool :=fill(false, nSV);
+//
+// for i in 1:b[1] loop
+//    henryBool[MediumVapour.henry[i]] := if inertVapour[MediumVapour.henry[i]] then false else true;
+//  end for;
   annotation (Diagram(graphics));
 end BaseReboiler;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/BaseClasses/BaseReboiler2.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/BaseClasses/BaseReboiler2.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/BaseClasses/BaseReboiler2.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/BaseClasses/BaseReboiler2.mo"	2022-03-10 09:58:37.464151659 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Components.Reboiler.BaseClasses;
+within ThermalSeparation.Components.Reboiler.BaseClasses;
 partial model BaseReboiler2
  /*** Initialization ***/
       outer ThermalSeparation.SystemTS systemTS;
@@ -100,7 +100,7 @@
     SI.MolarFlowRate Ndot_v_transfer[      nSV](start=fill(-0.1,nSV));
   SI.MolarFlowRate Ndot_l_transfer[        nSL](start=fill(0.1,nSL));
 
-//Variablen zur Enthalpiestromberechnung Ã¼ber die Phasengrenze
+//Variablen zur Enthalpiestromberechnung Ã¼ber die Phasengrenze
   SI.MolarFlowRate Ndot_fromL[nSL];
    SI.MolarFlowRate Ndot_fromV[nSV];
     SI.MoleFraction x_transfer_fromL[nSL];
@@ -157,13 +157,12 @@
 
    Real K[nS] "equilibrium constant";
 
-//       replaceable model PressureLoss =
-//       ThermalSeparation.PressureLoss.Reboiler.TubeHX                                  constrainedby
-//     ThermalSeparation.PressureLoss.Reboiler.BasePressureLoss annotation (
-//       choicesAllMatching=true);
-// PressureLoss pressureLoss(zeta=zeta, p_in = p_hyd[1], p_out = p_hyd[2], eps_liq = eps_liq, rho_l = rho_l, rho_v = rho_v, d_HX = d_HX, length_HX = length_HX, d_tube=d_tube, Nw=Nw);
-
-     //Model for reaction
+//       replaceable model PressureLoss =
+  //       ThermalSeparation.PressureLoss.Reboiler.TubeHX                                  constrainedby
+  //     ThermalSeparation.PressureLoss.Reboiler.BasePressureLoss annotation (
+  //       choicesAllMatching=true);
+  // PressureLoss pressureLoss(zeta=zeta, p_in = p_hyd[1], p_out = p_hyd[2], eps_liq = eps_liq, rho_l = rho_l, rho_v = rho_v, d_HX = d_HX, length_HX = length_HX, d_tube=d_tube, Nw=Nw);
+  //Model for reaction
   replaceable model Reaction =
       ApplicationsThermalSeparation.Reaction.CO2_Siemens            constrainedby ThermalSeparation.Reaction.BaseReaction
                                                                                                                         annotation(choicesAllMatching=true);
@@ -174,7 +173,7 @@
 /*** StartUp ***/
   parameter Boolean considerStartUp = false
     "true if StartUp is to be considered" annotation(Dialog(tab="StartUp"));
-  SI.Pressure p_initial "initial pressure in column"; //has to be provided in extending class
+  SI.Pressure p_initial "initial pressure in column";   //has to be provided in extending class
   parameter Real friggelfaktor = 0.0002e5 annotation(Dialog(tab="StartUp"));
   parameter Real k=0.2e-3 annotation(Dialog(tab="StartUp"));
   SI.Pressure p_bub= bubblePressure.p_bubble "mixture bubble pressure";
@@ -212,16 +211,15 @@
        u_s = p_initial,
       yMax=100,
       k=0.005,
-     initType=Modelica.Blocks.Types.InitPID.InitialOutput)   annotation (Placement(transformation(extent={{-24,-12},{-4,8}})));
+     initType=Modelica.Blocks.Types.Init.InitialOutput)   annotation (Placement(transformation(extent={{-24,-12},{-4,8}})));
 
 equation
       PID.u_m = if considerStartUp and startUp then p else if considerStartUp and not startUp then p_initial else p_initial;
 
-  p=p_out;
-
-  for i in 1:nSL loop
-    //c_l_star[j,i] = x_l_star[j,i] / MM_l_star[j]*rho_l_star[j];
-    c_l_star[i] = (x_l_star[i]+x_l[i])/2 / MM_l_star*rho_l_star;
+  p=p_out;
+ for i in 1:nSL loop
+//c_l_star[j,i] = x_l_star[j,i] / MM_l_star[j]*rho_l_star[j];
+    c_l_star[i] = (x_l_star[i] + x_l[i]) / 2 / MM_l_star * rho_l_star;
   end for;
 
 /*** correlation between mole fraction x and concentration c ***/
@@ -234,70 +232,68 @@
   end for;
   for i in 1:nV loop
     x_v[i+nS] *rho_v= c_v[i+nS] * MM_v;
-  end for;
-
-/*** StartUp ***/
-  when p_bub + friggelfaktor >= p_initial then // der Druck, den auch das Medienmodell sieht, friggelfaktor, weil sonst Umschalten zu spÃ¤t
-    startUp = false;
+  end for;
+/*** StartUp ***/
+  when p_bub + friggelfaktor >= p_initial then
+// der Druck, den auch das Medienmodell sieht, friggelfaktor, weil sonst Umschalten zu spÃ¤t
+    startUp = false;
   end when;
 
     omega = min(1,1 + tanh(k*(p_bub + friggelfaktor - p_initial)));
 
-  p_hyd[1] = if considerStartUp then (p_initial * (1 - omega)) + p * omega else p;
-
-           if startUp then
-   Ndot_source_startUp=PID.y;//-0.001;
-     else
-      Ndot_source_startUp=0;
-     end if;
-
-p_hyd[2] = p_out;
-
-  /*** mole balance ***/
-   for i in 1:nSV loop
-   // component balance for vapour
-  V* der(eps_vap*c_v[i]) =  - Vdot_v * c_v[i] + Ndot_v_transfer[i] + Ndot_source_startUp * x_v[i];
-  end for;
-  for i in 1:nSL loop
-    // component balance for liquid
-   V* der(eps_liq*c_l[i]) = Vdot_l_in*c_l_in[i] - Vdot_l * c_l[i] + Ndot_l_transfer[i] + reaction.Ndot[i];
-  end for;
-  // total mole balance for liquid and vapour
-  //reaction.Ndot muÃŸ nicht berÃ¼cksichtigt werden, da die Reaktion ja in der FlÃ¼ssigphase stattfindet und nur "FlÃ¼ssigkeit zu FlÃ¼ssigkeit" wird
-   if eps_liq<1e-5 and Vdot_l_in<1e-8 then
-     bool_eps=true;
-     der(eps_liq)=0;
- else
-   bool_eps=false;
-    V* der(eps_liq*rho_l/MM_l) =  Vdot_l_in*rho_l_in/MM_l_in -  Vdot_l*rho_l/MM_l + sum(Ndot_l_transfer[:]) + sum(reaction.Ndot[:]);
-    end if;
+  p_hyd[1] = if considerStartUp then (p_initial * (1 - omega)) + p * omega else p;
+ if startUp then
+    Ndot_source_startUp = PID.y;
+//-0.001;
+  else
+    Ndot_source_startUp = 0;
+  end if;
+
+p_hyd[2] = p_out;
+/*** mole balance ***/
+  for i in 1:nSV loop
+// component balance for vapour
+    V * der(eps_vap * c_v[i]) = (-Vdot_v * c_v[i]) + Ndot_v_transfer[i] + Ndot_source_startUp * x_v[i];
+  end for;
+ for i in 1:nSL loop
+// component balance for liquid
+    V * der(eps_liq * c_l[i]) = Vdot_l_in * c_l_in[i] - Vdot_l * c_l[i] + Ndot_l_transfer[i] + reaction.Ndot[i];
+  end for;
+// total mole balance for liquid and vapour
+//reaction.Ndot muÃŸ nicht berÃ¼cksichtigt werden, da die Reaktion ja in der FlÃ¼ssigphase stattfindet und nur "FlÃ¼ssigkeit zu FlÃ¼ssigkeit" wird
+  if eps_liq < 1e-5 and Vdot_l_in < 1e-8 then
+    bool_eps = true;
+    der(eps_liq) = 0;
+  else
+    bool_eps = false;
+    V * der(eps_liq * rho_l / MM_l) = Vdot_l_in * rho_l_in / MM_l_in - Vdot_l * rho_l / MM_l + sum(Ndot_l_transfer[:]) + sum(reaction.Ndot[:]);
+  end if;
        V* der(eps_vap*rho_v/MM_v) =  -  Vdot_v*rho_v/MM_v + sum(Ndot_v_transfer[:]) + Ndot_source_startUp;
 
   eps_liq+eps_vap=1;
 
     /***energy balance ***/
 V * der(eps_liq*sum(c_l[:])*u_l)  = Vdot_l_in*sum(c_l_in)*h_l_in - Vdot_l*sum(c_l[:])*h_l  + Edot_l_transfer  +reaction.deltaH_R + Qdot_wall -Qdot_evap;
- V * der(eps_vap*sum(c_v[:])*u_v)  =  - Vdot_v*sum(c_v[:])*h_v +Edot_v_transfer + Ndot_source_startUp;// + Qdot_wall;// + Vdot_v_in*sum(c_v_in[:])*mediumVapourIn.h;
-
- //zur Berechnung der EnthalpiestrÃ¶me Ã¼ber die Phasengrenze
-  for i in 1:nSL loop
-    Ndot_fromL[i] = -1*min(0,Ndot_l_transfer[i]);
-    x_transfer_fromL[i] = Ndot_fromL[i]/max(1e-5,sum(Ndot_fromL[:]));
-       if inertLiquid[i] then
-       x_transfer_toL[i] = 0;
-     end if;
+ V * der(eps_vap*sum(c_v[:])*u_v)  =  - Vdot_v*sum(c_v[:])*h_v +Edot_v_transfer + Ndot_source_startUp;
+// + Qdot_wall;// + Vdot_v_in*sum(c_v_in[:])*mediumVapourIn.h;
+//zur Berechnung der EnthalpiestrÃ¶me Ã¼ber die Phasengrenze
+  for i in 1:nSL loop
+    Ndot_fromL[i] = -1 * min(0, Ndot_l_transfer[i]);
+    x_transfer_fromL[i] = Ndot_fromL[i] / max(1e-5, sum(Ndot_fromL[:]));
+    if inertLiquid[i] then
+      x_transfer_toL[i] = 0;
+    end if;
   end for;
      for i in 1:nS loop
        x_transfer_toL[mapping[i,2]]=  x_transfer_fromV[mapping[i,1]];
-     end for;
-  for i in 1:nSV loop
-    Ndot_fromV[i] = -1*min(0,Ndot_v_transfer[i]);
-    x_transfer_fromV[i] = Ndot_fromV[i]/max(1e-5,sum(Ndot_fromV[:]));
-         if inertVapour[i] then
-       x_transfer_toV[i] = 0;
-     else
-     end if;
-    end for;
+     end for;
+ for i in 1:nSV loop
+    Ndot_fromV[i] = -1 * min(0, Ndot_v_transfer[i]);
+    x_transfer_fromV[i] = Ndot_fromV[i] / max(1e-5, sum(Ndot_fromV[:]));
+    if inertVapour[i] then
+      x_transfer_toV[i] = 0;
+    end if;
+  end for;
      for i in 1:nS loop
        x_transfer_toV[mapping[i,1]]=  x_transfer_fromL[mapping[i,2]];
      end for;
@@ -318,17 +314,16 @@
            Ndot_v_transfer[i] = - A_HT* 1e2*(x_v[i] - x_v_star[i]);
         end for;
         sum(x_v_star)=1;
-     end if;
-
-//       for i in 1:nSV-1 loop
-//      Ndot_v_transfer[i] =  - A_HT* 1e2*(x_v[i] - x_v_star[i]);
-//     end for;
-     //Liquid side
-   for i in 1:nSL loop
-     if inertLiquid[i] then
-       Ndot_l_transfer[i] = 0;
-     end if;
-     end for;
+     end if;
+//       for i in 1:nSV-1 loop
+//      Ndot_v_transfer[i] =  - A_HT* 1e2*(x_v[i] - x_v_star[i]);
+//     end for;
+//Liquid side
+  for i in 1:nSL loop
+    if inertLiquid[i] then
+      Ndot_l_transfer[i] = 0;
+    end if;
+  end for;
      for i in 1:nSL-1 loop
       Ndot_l_transfer[i] =  - A_HT* 1e2* (x_l[i] - x_l_star[i]);
    end for;
@@ -344,9 +339,10 @@
 end for;
 
 /*** energy balance at phase boundary ***/
-    -Edot_v_transfer - Edot_l_transfer =0;//-  Qdot_evap =0;
-    /*** a dummy overall heat transfer coefficient is used ***/
-     Qdot_l_transfer = A_HT*1e4* (T_star - T_l);
+    -Edot_v_transfer - Edot_l_transfer =0;
+//-  Qdot_evap =0;
+/*** a dummy overall heat transfer coefficient is used ***/
+  Qdot_l_transfer = A_HT * 1e4 * (T_star - T_l);
      Qdot_v_transfer= A_HT*1e4*(T_star - T_v);
 
       Edot_l_transfer =   Qdot_l_transfer + sum(Ndot_fromV[:])*h_transfer_toL - sum(Ndot_fromL[:])*h_transfer_fromL;
@@ -358,18 +354,15 @@
     K[i] = thermoEquilibrium.K[i];
    end for;
 
-  Vdot_l = Vdot_v*eps_liq/eps_vap;
-
+  Vdot_l = Vdot_v*eps_liq/eps_vap;
 /*** Der Gleichung fÃ¼r Druckverlust bei UmstrÃ¶mung von RohrbÃ¼ndeln nachempfunden (VDI-WÃ¤rmeatlas; Ld1, Gl. (1)), zeta wird allerdings als Parameter vorgegeben
-     Sowieso alles nur mig gut, weil der Volumenstrom sich ja signifikant Ã¼ber die HX-HÃ¶he Ã¤ndert ***/
-// Vdot_v = pressureLoss.Vdot;//sign(p_hyd[1] - p_hyd[2])*max(0, (abs(p_hyd[1] - p_hyd[2])/(0.05e5/0.02)));
-// Vdot_v =  sqrt(max(1e-8,(p - p_out - eps_liq*d_HX*Modelica.Constants.g_n*rho_l)*2*length_HX^2*(d_HX-10*d_tube)^2/(zeta*Nw*(eps_liq*rho_l + eps_vap*rho_v))));
-//Vdot_v =  max(0,sqrt((p - p_out) *2*length_HX^2*(d_HX-(Nw+1)*d_tube)^2/(zeta*Nw*(eps_liq*rho_l + eps_vap*rho_v))));
-//Vdot_v =  sqrt(max(1e-8,(p_in - p_out - eps_liq*d_HX*Modelica.Constants.g_n*rho_l)*2*length_HX^2*(d_HX-(Nw+1)*d_tube)^2/(zeta*Nw*(eps_liq*rho_l + eps_vap*rho_v))));
-
-/*** system pressure ***/
-p=p_in-wassersaeule;
-
+     Sowieso alles nur mig gut, weil der Volumenstrom sich ja signifikant Ã¼ber die HX-HÃ¶he Ã¤ndert ***/
+// Vdot_v = pressureLoss.Vdot;//sign(p_hyd[1] - p_hyd[2])*max(0, (abs(p_hyd[1] - p_hyd[2])/(0.05e5/0.02)));
+// Vdot_v =  sqrt(max(1e-8,(p - p_out - eps_liq*d_HX*Modelica.Constants.g_n*rho_l)*2*length_HX^2*(d_HX-10*d_tube)^2/(zeta*Nw*(eps_liq*rho_l + eps_vap*rho_v))));
+//Vdot_v =  max(0,sqrt((p - p_out) *2*length_HX^2*(d_HX-(Nw+1)*d_tube)^2/(zeta*Nw*(eps_liq*rho_l + eps_vap*rho_v))));
+//Vdot_v =  sqrt(max(1e-8,(p_in - p_out - eps_liq*d_HX*Modelica.Constants.g_n*rho_l)*2*length_HX^2*(d_HX-(Nw+1)*d_tube)^2/(zeta*Nw*(eps_liq*rho_l + eps_vap*rho_v))));
+/*** system pressure ***/
+  p = p_in - wassersaeule;
 initial equation
 if initOption == InitOption.initEQ and not considerStartUp then
   for i in 1:nSL loop
@@ -426,13 +419,11 @@
 
   eps_liq=eps_liq_start;
 end if;
-
-// initial algorithm
-//  henryBool :=fill(false, nSV);
-//
-// for i in 1:b[1] loop
-//    henryBool[MediumVapour.henry[i]] := if inertVapour[MediumVapour.henry[i]] then false else true;
-//  end for;
-
+// initial algorithm
+//  henryBool :=fill(false, nSV);
+//
+// for i in 1:b[1] loop
+//    henryBool[MediumVapour.henry[i]] := if inertVapour[MediumVapour.henry[i]] then false else true;
+//  end for;
   annotation (Diagram(graphics));
 end BaseReboiler2;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/KettleReboilerEq.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/KettleReboilerEq.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/KettleReboilerEq.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/KettleReboilerEq.mo"	2022-03-10 09:58:37.392151650 +0000
@@ -8,29 +8,29 @@
   parameter ThermalSeparation.Components.Reboiler.InitOptionEq
     init_option =                     Enumerations.InitializationOption.init_x "initialization options"                        annotation(Dialog(tab="Initialization"),Evaluate=true);
    parameter Real eps_liq_init "initial value for eps_liq" annotation(Dialog(tab = "Initialization"));
-  parameter Modelica.SIunits.Temperature T_init "initial value fr Temperature"
+  parameter Modelica.Units.SI.Temperature T_init "initial value fr Temperature"
                                                                  annotation(Dialog(tab = "Initialization"));
-  parameter Modelica.SIunits.Pressure p_init "initial value for pressure"
+  parameter Modelica.Units.SI.Pressure p_init "initial value for pressure"
                                 annotation(Dialog(tab = "Initialization"));
   parameter Real fixed_mol_init "molarity of solvent" annotation(Dialog(tab="Initialization"));
-  parameter Modelica.SIunits.MoleFraction x_total_start[nS] "mole fraction of component in vapour and liquid" annotation(Dialog(tab = "Initialization"));
+  parameter Modelica.Units.SI.MoleFraction x_total_start[nS] "mole fraction of component in vapour and liquid" annotation(Dialog(tab = "Initialization"));
 
-  Modelica.SIunits.HeatFlowRate Q_in "heat flow to evaporate liquid";
+  Modelica.Units.SI.HeatFlowRate Q_in "heat flow to evaporate liquid";
 
-  Modelica.SIunits.Temperature T_l_in;
+  Modelica.Units.SI.Temperature T_l_in;
 
-  Modelica.SIunits.MoleFraction x_l_in[nSL];
+  Modelica.Units.SI.MoleFraction x_l_in[nSL];
 
-  Modelica.SIunits.Concentration c_l_in[nSL];
-  Modelica.SIunits.VolumeFlowRate vdot_l_in;
+  Modelica.Units.SI.Concentration c_l_in[nSL];
+  Modelica.Units.SI.VolumeFlowRate vdot_l_in;
 
   parameter Boolean init_standalone = true "changes number of initial values if used in standalone operation";
 
-  Modelica.SIunits.Pressure p_sys(start=2e5);
-  Modelica.SIunits.MolarFlowRate F_in_l;
-  parameter Modelica.SIunits.Temperature T_ref=systemTS.T_ref "reference temperature"
+  Modelica.Units.SI.Pressure p_sys(start=2e5);
+  Modelica.Units.SI.MolarFlowRate F_in_l;
+  parameter Modelica.Units.SI.Temperature T_ref=systemTS.T_ref "reference temperature"
                                                                         annotation (Dialog(tab="Advanced"));
-  parameter Modelica.SIunits.HeatFlowRate Q_loss=0 "heat loss to ambience";
+  parameter Modelica.Units.SI.HeatFlowRate Q_loss=0 "heat loss to ambience";
                                       //adiabatic system
 
   parameter Integer mapping[nS,2] = {{1,1},{2,2}} "parameter to map the different medium vectors one to another";
@@ -45,11 +45,11 @@
 
   Real K[nS](start=fill(1,nS));
 
-  Modelica.SIunits.MolarFlowRate F_out_l(start=1e-4);
-  Modelica.SIunits.MolarFlowRate F_out_v(start=1e-4);
+  Modelica.Units.SI.MolarFlowRate F_out_l(start=1e-4);
+  Modelica.Units.SI.MolarFlowRate F_out_v(start=1e-4);
 
-  Modelica.SIunits.AmountOfSubstance HU_l(start=1000, stateSelect=StateSelect.prefer);
-  Modelica.SIunits.AmountOfSubstance HU_v(start=100);
+  Modelica.Units.SI.AmountOfSubstance HU_l(start=1000, stateSelect=StateSelect.prefer);
+  Modelica.Units.SI.AmountOfSubstance HU_v(start=100);
 
   replaceable package MediumVapour = ThermalSeparation.Media.C2H5OH_Water_Vap
     constrainedby ThermalSeparation.Media.BaseMediumVapour "medium to be used in vapour phase"
@@ -88,7 +88,7 @@
       MediumLiquid, p=p_sys, T=T, x_v=x_v, x_l=x_l, p_sat=p_sat,  v_v=MM_v./rho_v,x_vap_liq=fill(1/nS,nS));
 
 /* Reaction */
-Modelica.SIunits.MolarFlowRate Ndot_l_transfer[nSL];
+Modelica.Units.SI.MolarFlowRate Ndot_l_transfer[nSL];
 
   replaceable model Reaction =
   ThermalSeparation.Reaction.NoReaction constrainedby ThermalSeparation.Reaction.BaseReaction  "model for chemical reaction"                               annotation(choicesAllMatching=true);
@@ -111,13 +111,13 @@
 
   InnerHT innerHT(n=1,T={T},A={A_HT},Qdot={Q_in},p={p_sys});
 
-  parameter Modelica.SIunits.Area A_HT "heat exchange area";
+  parameter Modelica.Units.SI.Area A_HT "heat exchange area";
 
 /* medium properties */
-  Modelica.SIunits.Temperature T;
+  Modelica.Units.SI.Temperature T;
 
-  Modelica.SIunits.MoleFraction x_l[nSL](start=fill(1/nSL,nSL));
-  Modelica.SIunits.MoleFraction x_v[nSV](start=fill(1/nSV,nSV));
+  Modelica.Units.SI.MoleFraction x_l[nSL](start=fill(1/nSL,nSL));
+  Modelica.Units.SI.MoleFraction x_v[nSV](start=fill(1/nSV,nSV));
 
   ThermalSeparation.Units.MolarEnthalpy h_l_in;// = mediumLiquidIn.h;
   ThermalSeparation.Units.MolarEnthalpy h_v = mediumVapour.h;
@@ -126,53 +126,53 @@
   ThermalSeparation.Units.MolarEnthalpy u_l(stateSelect=StateSelect.prefer) = mediumLiquid.u;
   ThermalSeparation.Units.MolarEnthalpy u_v = mediumVapour.u;
 
-  Modelica.SIunits.MolarMass MM_l=mediumLiquid.MM;
-  Modelica.SIunits.MolarMass MM_v(start=0.031)=mediumVapour.MM;
-  Modelica.SIunits.MolarMass MM_l_in=mediumLiquidIn.MM;
+  Modelica.Units.SI.MolarMass MM_l=mediumLiquid.MM;
+  Modelica.Units.SI.MolarMass MM_v(start=0.031)=mediumVapour.MM;
+  Modelica.Units.SI.MolarMass MM_l_in=mediumLiquidIn.MM;
 
-  Modelica.SIunits.Density rho_l=mediumLiquid.d;
-  Modelica.SIunits.Density rho_v=mediumVapour.d;
-  Modelica.SIunits.Density rho_l_in=mediumLiquidIn.d;
+  Modelica.Units.SI.Density rho_l=mediumLiquid.d;
+  Modelica.Units.SI.Density rho_v=mediumVapour.d;
+  Modelica.Units.SI.Density rho_l_in=mediumLiquidIn.d;
 
-  Modelica.SIunits.Pressure p_sat[nSL];
+  Modelica.Units.SI.Pressure p_sat[nSL];
 
-  Modelica.SIunits.Volume V_vap;
-  Modelica.SIunits.Volume V_liq;
-  Modelica.SIunits.Volume V_abs;
+  Modelica.Units.SI.Volume V_vap;
+  Modelica.Units.SI.Volume V_liq;
+  Modelica.Units.SI.Volume V_abs;
 
-  Modelica.SIunits.Concentration c_l[nSL];
+  Modelica.Units.SI.Concentration c_l[nSL];
   Real dummy_c_l(stateSelect=StateSelect.prefer)=c_l[2];
-  Modelica.SIunits.Concentration c_v[nSV];
+  Modelica.Units.SI.Concentration c_v[nSV];
 
-  Modelica.SIunits.VolumeFlowRate vdot_l;
-  Modelica.SIunits.VolumeFlowRate vdot_v(start=50);
+  Modelica.Units.SI.VolumeFlowRate vdot_l;
+  Modelica.Units.SI.VolumeFlowRate vdot_v(start=50);
 
 /* geometry */
 
-  parameter Modelica.SIunits.Area A=0.5 "area of reboiler";
-  parameter Modelica.SIunits.Height H=1.3 "height of reboiler";
-  Modelica.SIunits.SpecificHeatCapacity cp_col=500;
+  parameter Modelica.Units.SI.Area A=0.5 "area of reboiler";
+  parameter Modelica.Units.SI.Height H=1.3 "height of reboiler";
+  Modelica.Units.SI.SpecificHeatCapacity cp_col=500;
                                                 //stainless steel
-  Modelica.SIunits.Mass m_col=100;
+  Modelica.Units.SI.Mass m_col=100;
                      //mass of column segment
 
-  Modelica.SIunits.Height h_liq;
- parameter  Modelica.SIunits.Length h_w=0.13;
- parameter Modelica.SIunits.Length h_lw=0.35;
+  Modelica.Units.SI.Height h_liq;
+ parameter  Modelica.Units.SI.Length h_w=0.13;
+ parameter Modelica.Units.SI.Length h_lw=0.35;
 
   Real eps_liq "(liquid volume) / (absolute volume)";
   Real eps_vap(min = 0, max = 1) "(vapour volume) / (absolute volume)";
   //Real eps_inert "(inert volume) / (absolute volume)";
-  Modelica.SIunits.Pressure p_bub "bubble point pressure";
+  Modelica.Units.SI.Pressure p_bub "bubble point pressure";
 
   Real checkMoleBal;
 
   //for monitoring purpose
 
-  Modelica.SIunits.MassFlowRate mdot_l = vdot_l * rho_l;
-  Modelica.SIunits.MassFlowRate mdot_v = vdot_v * rho_v;
-  Modelica.SIunits.MassFlowRate mdot_l_in = vdot_l_in * rho_l_in;
-  Modelica.SIunits.MassFlowRate mdot_check = mdot_l_in - mdot_l - mdot_v;
+  Modelica.Units.SI.MassFlowRate mdot_l = vdot_l * rho_l;
+  Modelica.Units.SI.MassFlowRate mdot_v = vdot_v * rho_v;
+  Modelica.Units.SI.MassFlowRate mdot_l_in = vdot_l_in * rho_l_in;
+  Modelica.Units.SI.MassFlowRate mdot_check = mdot_l_in - mdot_l - mdot_v;
 
   ThermalSeparation.Interfaces.GasPortOut gasPortOut(redeclare package Medium =
         MediumVapour) annotation (Placement(transformation(extent={{-40,82},{-20,
@@ -188,7 +188,7 @@
       Placement(transformation(extent={{72,-10},{92,10}}),
         iconTransformation(extent={{72,-10},{92,10}})));
 parameter Boolean init_const_vdot=false "initialise from constant vapour volume flow rate" annotation(Dialog(tab="Initialization",group="Init. from constant value"));
-parameter Modelica.SIunits.VolumeFlowRate vdot_v_const=0.08 "volume flow rate" annotation(Dialog(tab="Initialization",group="Init. from constant value"));
+parameter Modelica.Units.SI.VolumeFlowRate vdot_v_const=0.08 "volume flow rate" annotation(Dialog(tab="Initialization",group="Init. from constant value"));
    parameter Real omega_k=0.05 "large value if change between constant and variable shall be steep"
                                                                          annotation(Dialog(tab="Initialization",group="Init. from constant value"));
    parameter Real omega_time = 50 "inflexion point of tanh function" annotation(Dialog(tab="Initialization",group="Init. from constant value"));
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/KettleReboilerEq_StartUpCCS_dummy_p.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/KettleReboilerEq_StartUpCCS_dummy_p.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/KettleReboilerEq_StartUpCCS_dummy_p.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/KettleReboilerEq_StartUpCCS_dummy_p.mo"	2022-03-10 09:58:37.304151639 +0000
@@ -1,7 +1,7 @@
 within ThermalSeparation.Components.Reboiler;
 model KettleReboilerEq_StartUpCCS_dummy_p
   "Start-Up CCS Reboiler with dummy pressure boundary for better initialization"
-  import SI = Modelica.SIunits;
+  import Modelica.Units.SI;
   //import ThermalSeparation;
   extends ThermalSeparation.Icons.Color.Reboiler;
   outer ThermalSeparation.SystemTS systemTS;
@@ -19,7 +19,7 @@
   parameter ThermalSeparation.Components.Reboiler.InitOptionEq
     init_option=ThermalSeparation.Components.Reboiler.InitOptionEq.init_x                                         annotation(Dialog(tab="Initialization"),Evaluate=true); // Enumerations.InitializationOption.init_x "initialization options"
 
-  parameter Modelica.SIunits.Area A_HT=5 "heat exchange area";
+  parameter Modelica.Units.SI.Area A_HT=5 "heat exchange area";
 
   replaceable package MediumVapour =
       ThermalSeparation.Media.H2O_CO2_Vap
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/Reboiler.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/Reboiler.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/Reboiler.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/Reboiler.mo"	2022-03-10 09:58:37.268151634 +0000
@@ -72,8 +72,10 @@
     "molar mass of the liquid mixture";
     SI.MolarMass MM_l_in = mediumLiquidIn.MM;
       SI.MolarMass MM_l_star= mediumLiquidStar.MM;
-  ThermalSeparation.Units.MolarEnthalpy h_l;//= mediumLiquid.h;
-  ThermalSeparation.Units.MolarEnthalpy h_l_in;//=mediumLiquidIn.h;
+  ThermalSeparation.Units.MolarEnthalpy h_l;
+ //= mediumLiquid.h;
+  ThermalSeparation.Units.MolarEnthalpy h_l_in;
+ //=mediumLiquidIn.h;
     ThermalSeparation.Units.MolarEnthalpy h_transfer_fromL= liqToFilmB.h;
   ThermalSeparation.Units.MolarEnthalpy h_transfer_toL= filmToVapB.h;
   SI.MolarInternalEnergy u_l(stateSelect=StateSelect.default) =  mediumLiquid.u;
@@ -99,7 +101,7 @@
     SI.MolarFlowRate Ndot_v_transfer[      nSV](start=fill(-0.1,nSV));
   SI.MolarFlowRate Ndot_l_transfer[        nSL](start=fill(0.1,nSL));
 
-//Variablen zur Enthalpiestromberechnung ber die Phasengrenze
+//Variablen zur Enthalpiestromberechnung ber die Phasengrenze
   SI.MolarFlowRate Ndot_fromL[nSL];
    SI.MolarFlowRate Ndot_fromV[nSV];
     SI.MoleFraction x_transfer_fromL[nSL];
@@ -156,7 +158,7 @@
 
    Real K[nS] "equilibrium constant";
 
-     //Model for reaction
+//Model for reaction
   replaceable model Reaction =
      ThermalSeparation.Reaction.NoReaction constrainedby ThermalSeparation.Reaction.BaseReaction                        annotation(choicesAllMatching=true);
   Reaction reaction(propsLiq=mediumLiquid.properties,
@@ -166,7 +168,7 @@
 /*** StartUp ***/
   parameter Boolean considerStartUp = false
     "true if StartUp is to be considered" annotation(Dialog(tab="StartUp"));
-  SI.Pressure p_initial "initial pressure in column"; //has to be provided in extending class
+  SI.Pressure p_initial "initial pressure in column";   //has to be provided in extending class
   parameter Real friggelfaktor = 0.0002e5 annotation(Dialog(tab="StartUp"));
   parameter Real k=0.2e-3 annotation(Dialog(tab="StartUp"));
   SI.Pressure p_bub= bubblePressure.p_bubble "mixture bubble pressure";
@@ -202,7 +204,7 @@
        u_s = p_initial,
       yMax=100,
       k=0.005,
-     initType=Modelica.Blocks.Types.InitPID.InitialOutput,
+     initType=Modelica.Blocks.Types.Init.InitialOutput,
     Ti=1,
     Td=1)                                                    annotation (Placement(transformation(extent={{-24,-12},{-4,8}})));
 
@@ -237,17 +239,15 @@
 
 
  liquidIn.x_outflow = inStream(liquidOut.x_outflow);
- liquidIn.h_outflow = inStream(liquidOut.h_outflow);
-
-     //upstream
-    vapourOut.p = p_out;
+ liquidIn.h_outflow = inStream(liquidOut.h_outflow);
+//upstream
+  vapourOut.p = p_out;
 
     vapourOut.Ndot = -Ndot_v;
     vapourOut.h_outflow =h_v;
-    vapourOut.x_outflow =x_v;
-
-    //downstream
-    liquidIn.p = p_in;
+    vapourOut.x_outflow =x_v;
+//downstream
+  liquidIn.p = p_in;
 
     liquidOut.Ndot = -Ndot_l;
     inStream(liquidIn.h_outflow) = h_l_in;
@@ -258,19 +258,17 @@
 
 /*** heat port ***/
   Qdot_wall = heatPort.Q_flow;
-  T_l=heatPort.T;
-
-//p=p_hyd[1]-wassersaeule;
-/*** StartUp ***/
+  T_l=heatPort.T;
+//p=p_hyd[1]-wassersaeule;
+/*** StartUp ***/
   p_initial = vapourOut.p "initial pressure in column";
 
        PID.u_m = if considerStartUp and startUp then p else if considerStartUp and not startUp then p_initial else p_initial;
 
-  p=p_out;
-
-  for i in 1:nSL loop
-    //c_l_star[j,i] = x_l_star[j,i] / MM_l_star[j]*rho_l_star[j];
-    c_l_star[i] = (x_l_star[i]+x_l[i])/2 / MM_l_star*rho_l_star;
+  p=p_out;
+ for i in 1:nSL loop
+//c_l_star[j,i] = x_l_star[j,i] / MM_l_star[j]*rho_l_star[j];
+    c_l_star[i] = (x_l_star[i] + x_l[i]) / 2 / MM_l_star * rho_l_star;
   end for;
 
 /*** correlation between mole fraction x and concentration c ***/
@@ -283,70 +281,68 @@
   end for;
   for i in 1:nV loop
     x_v[i+nS] *rho_v= c_v[i+nS] * MM_v;
-  end for;
-
-/*** StartUp ***/
-  when p_bub + friggelfaktor >= p_initial then // der Druck, den auch das Medienmodell sieht, friggelfaktor, weil sonst Umschalten zu spt
-    startUp = false;
+  end for;
+/*** StartUp ***/
+  when p_bub + friggelfaktor >= p_initial then
+// der Druck, den auch das Medienmodell sieht, friggelfaktor, weil sonst Umschalten zu spt
+    startUp = false;
   end when;
 
     omega = min(1,1 + tanh(k*(p_bub + friggelfaktor - p_initial)));
 
-  p_hyd[1] = if considerStartUp then (p_initial * (1 - omega)) + p * omega else p;
-
-           if startUp then
-   Ndot_source_startUp=PID.y;//-0.001;
-     else
-      Ndot_source_startUp=0;
-     end if;
-
-p_hyd[2] = p_out;
-
-  /*** mole balance ***/
-   for i in 1:nSV loop
-   // component balance for vapour
-  V* der(eps_vap*c_v[i]) =  vapourOut.Ndot*x_v[i] + Ndot_v_transfer[i] + Ndot_source_startUp * x_v[i];
-  end for;
-  for i in 1:nSL loop
-    // component balance for liquid
-   V* der(eps_liq*c_l[i]) = liquidIn.Ndot*x_l_in[i] +liquidOut.Ndot*x_l[i] + Ndot_l_transfer[i] + reaction.Ndot[i];
-  end for;
-  // total mole balance for liquid and vapour
-  //reaction.Ndot mu nicht bercksichtigt werden, da die Reaktion ja in der Flssigphase stattfindet und nur "Flssigkeit zu Flssigkeit" wird
-   if eps_liq<1e-5 and liquidIn.Ndot<1e-8 then
-     //bool_eps=true;
-     der(eps_liq)=0;
- else
-  // bool_eps=false;
-    V* der(eps_liq*rho_l/MM_l) =  liquidIn.Ndot +liquidOut.Ndot + sum(Ndot_l_transfer[:]) + sum(reaction.Ndot[:]);
-    end if;
+  p_hyd[1] = if considerStartUp then (p_initial * (1 - omega)) + p * omega else p;
+ if startUp then
+    Ndot_source_startUp = PID.y;
+//-0.001;
+  else
+    Ndot_source_startUp = 0;
+  end if;
+
+p_hyd[2] = p_out;
+/*** mole balance ***/
+  for i in 1:nSV loop
+// component balance for vapour
+    V * der(eps_vap * c_v[i]) = vapourOut.Ndot * x_v[i] + Ndot_v_transfer[i] + Ndot_source_startUp * x_v[i];
+  end for;
+ for i in 1:nSL loop
+// component balance for liquid
+    V * der(eps_liq * c_l[i]) = liquidIn.Ndot * x_l_in[i] + liquidOut.Ndot * x_l[i] + Ndot_l_transfer[i] + reaction.Ndot[i];
+  end for;
+// total mole balance for liquid and vapour
+//reaction.Ndot mu nicht bercksichtigt werden, da die Reaktion ja in der Flssigphase stattfindet und nur "Flssigkeit zu Flssigkeit" wird
+  if eps_liq < 1e-5 and liquidIn.Ndot < 1e-8 then
+//bool_eps=true;
+    der(eps_liq) = 0;
+  else
+// bool_eps=false;
+    V * der(eps_liq * rho_l / MM_l) = liquidIn.Ndot + liquidOut.Ndot + sum(Ndot_l_transfer[:]) + sum(reaction.Ndot[:]);
+  end if;
        V* der(eps_vap*rho_v/MM_v) =  vapourOut.Ndot + sum(Ndot_v_transfer[:]) + Ndot_source_startUp;
 
   eps_liq+eps_vap=1;
 
     /***energy balance ***/
 V * der(eps_liq*sum(c_l[:])*u_l)  = liquidIn.Ndot*h_l_in + liquidOut.Ndot*h_l  + Edot_l_transfer  +reaction.deltaH_R + Qdot_wall -Qdot_evap;
- V * der(eps_vap*sum(c_v[:])*u_v)  =  vapourOut.Ndot*h_v + Edot_v_transfer + Ndot_source_startUp;// + Qdot_wall;// + Vdot_v_in*sum(c_v_in[:])*mediumVapourIn.h;
-
- //zur Berechnung der Enthalpiestrme ber die Phasengrenze
-  for i in 1:nSL loop
-    Ndot_fromL[i] = -1*min(0,Ndot_l_transfer[i]);
-    x_transfer_fromL[i] = Ndot_fromL[i]/max(1e-5,sum(Ndot_fromL[:]));
-       if inertLiquid[i] then
-       x_transfer_toL[i] = 0;
-     end if;
+ V * der(eps_vap*sum(c_v[:])*u_v)  =  vapourOut.Ndot*h_v + Edot_v_transfer + Ndot_source_startUp;
+// + Qdot_wall;// + Vdot_v_in*sum(c_v_in[:])*mediumVapourIn.h;
+//zur Berechnung der Enthalpiestrme ber die Phasengrenze
+  for i in 1:nSL loop
+    Ndot_fromL[i] = -1 * min(0, Ndot_l_transfer[i]);
+    x_transfer_fromL[i] = Ndot_fromL[i] / max(1e-5, sum(Ndot_fromL[:]));
+    if inertLiquid[i] then
+      x_transfer_toL[i] = 0;
+    end if;
   end for;
      for i in 1:nS loop
        x_transfer_toL[mapping[i,2]]=  x_transfer_fromV[mapping[i,1]];
-     end for;
-  for i in 1:nSV loop
-    Ndot_fromV[i] = -1*min(0,Ndot_v_transfer[i]);
-    x_transfer_fromV[i] = Ndot_fromV[i]/max(1e-5,sum(Ndot_fromV[:]));
-         if inertVapour[i] then
-       x_transfer_toV[i] = 0;
-     else
-     end if;
-    end for;
+     end for;
+ for i in 1:nSV loop
+    Ndot_fromV[i] = -1 * min(0, Ndot_v_transfer[i]);
+    x_transfer_fromV[i] = Ndot_fromV[i] / max(1e-5, sum(Ndot_fromV[:]));
+    if inertVapour[i] then
+      x_transfer_toV[i] = 0;
+    end if;
+  end for;
      for i in 1:nS loop
        x_transfer_toV[mapping[i,1]]=  x_transfer_fromL[mapping[i,2]];
      end for;
@@ -367,14 +363,13 @@
            Ndot_v_transfer[i] = - A_HT* 1e2*(x_v[i] - x_v_star[i]);
         end for;
         sum(x_v_star)=1;
-     end if;
-
-     //Liquid side
-   for i in 1:nSL loop
-     if inertLiquid[i] then
-       Ndot_l_transfer[i] = 0;
-     end if;
-     end for;
+     end if;
+//Liquid side
+  for i in 1:nSL loop
+    if inertLiquid[i] then
+      Ndot_l_transfer[i] = 0;
+    end if;
+  end for;
      for i in 1:nSL-1 loop
       Ndot_l_transfer[i] =  - A_HT* 1e2* (x_l[i] - x_l_star[i]);
    end for;
@@ -390,9 +385,10 @@
 end for;
 
 /*** energy balance at phase boundary ***/
-    -Edot_v_transfer - Edot_l_transfer =0;//-  Qdot_evap =0;
-    /*** a dummy overall heat transfer coefficient is used ***/
-     Qdot_l_transfer = A_HT*1e4* (T_star - T_l);
+    -Edot_v_transfer - Edot_l_transfer =0;
+//-  Qdot_evap =0;
+/*** a dummy overall heat transfer coefficient is used ***/
+  Qdot_l_transfer = A_HT * 1e4 * (T_star - T_l);
      Qdot_v_transfer= A_HT*1e4*(T_star - T_v);
 
       Edot_l_transfer =   Qdot_l_transfer + sum(Ndot_fromV[:])*h_transfer_toL - sum(Ndot_fromL[:])*h_transfer_fromL;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/Tests/Control3_2_tank_torricelli.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/Tests/Control3_2_tank_torricelli.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/Tests/Control3_2_tank_torricelli.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/Tests/Control3_2_tank_torricelli.mo"	2022-03-10 09:58:12.524148500 +0000
@@ -1,7 +1,7 @@
 within ThermalSeparation.Components.Reboiler.Tests;
 model Control3_2_tank_torricelli
-  "Control Strategie 3 (idealPump1 regelt Abscheiderate, Qdot_reboiler wird gestellt, idealPump regelt Füllstand)"
-  //Lauftest: 28.7.2011, 18000 s in 498 s (Kevin): geht erst, seit man an dem PI-Regler für den StartUp rumgespielt hat
+  "Control Strategie 3 (idealPump1 regelt Abscheiderate, Qdot_reboiler wird gestellt, idealPump regelt FÃ¼llstand)"
+  //Lauftest: 28.7.2011, 18000 s in 498 s (Kevin): geht erst, seit man an dem PI-Regler fÃ¼r den StartUp rumgespielt hat
   //Lauftest: 18.7.2011, 18000 s in 498 s
   //Lauftest: 26.5.2011, 18000 s in 700 s (Torricelli), wenn Umrechnung von x und c nicht mit v sondern mit MM/rho gemacht wird
   //Lauftest: 18.5.2011 / 20.5.2011 18000s in 600 s (Torricelli)
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/package.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/Reboiler/package.mo"	2022-03-10 09:58:37.348151645 +0000
@@ -4,7 +4,7 @@
 
   model KettleReboilerEq_StartUpCCS
 
-    import SI = Modelica.SIunits;
+    import Modelica.Units.SI;
     //import ThermalSeparation;
     extends ThermalSeparation.Icons.Color.Reboiler;
     outer ThermalSeparation.SystemTS systemTS;
@@ -22,7 +22,7 @@
     parameter ThermalSeparation.Components.Reboiler.InitOptionEq
       init_option=ThermalSeparation.Components.Reboiler.InitOptionEq.init_x                                         annotation(Dialog(tab="Initialization"),Evaluate=true); // Enumerations.InitializationOption.init_x "initialization options"
 
-    parameter Modelica.SIunits.Area A_HT=5 "heat exchange area";
+    parameter Modelica.Units.SI.Area A_HT=5 "heat exchange area";
 
     replaceable package MediumVapour =
         ThermalSeparation.Media.H2O_CO2_Vap
@@ -535,4 +535,5 @@
     init_heilbronn   "initialisation using p,eps,x_total[1] and molalityenumeration: initialization options for equilibrium reboiler",
     init_startUp   "initialization start-up",
     initOption_startup_inert_Dyn   "initialization start-up Dynstart") "enumeration: initialization options for equilibrium reboiler";
+
 end Reboiler;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/package.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Components/package.mo"	2022-03-10 09:58:39.064151861 +0000
@@ -1,7 +1,8 @@
 within ThermalSeparation;
 package Components "Components to build up a column"
       extends Icons.Library.Red;
-  import SI = Modelica.SIunits;
+  import Modelica.Units.SI;
+
 
 
   annotation (preferedView="info",
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Examples/Testing.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Examples/Testing.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Examples/Testing.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Examples/Testing.mo"	2022-03-10 09:58:36.920151590 +0000
@@ -2,27 +2,27 @@
 package Testing
   package Complex
     model CycleComplex
-      //import ThermalSeparation;
+      //import ThermalSeparation;
       Real x_CO2_removed = max(1e-7, 1 - Absorber.Ndot_v[Absorber.n] * Absorber.x_v[Absorber.n, 3] / (Absorber.Ndot_v_in * Absorber.x_v_in[3]));
-      Modelica.SIunits.MassFlowRate water_diff = Absorber.Ndot_v_in * Absorber.x_v_in[1] * 0.018 - Absorber.Ndot_v[Absorber.n] * Absorber.x_v[Absorber.n, 1] * 0.018;
-      //Real qspec = sumpV.Q_in/(1000^2) * 1/(max(0.04,Desorber.mdot_v[Desorber.n]*Desorber.X_v[Desorber.n,2]));
-      // Modelica.SIunits.MassFlowRate water_diff1_gas = Desorber.Ndot_v_in*Desorber.x_v_in[1]*0.018 - Desorber.Ndot_v[Desorber.n]*Desorber.x_v[Desorber.n,1]*0.018;
-      // Modelica.SIunits.MassFlowRate water_diff1_liq = Desorber.Ndot_l_in*Desorber.x_l_in[1]*0.018 - Desorber.Ndot_l[1]*Desorber.x_l[1,1]*0.018;
-      //
-      // Modelica.SIunits.MassFlowRate bal_reboiler = sumpV.liquidPortIn.Vdot*sumpV.mediumLiquidIn.d + sumpV.gasPortOut.Vdot*sumpV.mediumVapour.d + sumpV.liquidPortOut.Vdot*sumpV.mediumLiquid.d;
-      // Modelica.SIunits.MassFlowRate bal_condenser = flash_Condenser_simple.gasPortIn.Vdot*flash_Condenser_simple.mediumVapourIn.d + flash_Condenser_simple.gasPortOut.Vdot*flash_Condenser_simple.mediumVapour.d + flash_Condenser_simple.liquidPortOut.Vdot*flash_Condenser_simple.mediumLiquid.d;
-      // Modelica.SIunits.MassFlowRate bal_desorber = Desorber.upStreamIn.Vdot*Desorber.mediumVapourIn.d + Desorber.downStreamIn.Vdot*Desorber.mediumLiquidIn.d+Desorber.upStreamOut.Vdot*Desorber.mediumVapour[20].d+Desorber.downStreamOut.Vdot*Desorber.mediumLiquid[1].d;
-      // Modelica.SIunits.MassFlowRate bal_absorber = Absorber.upStreamIn.Vdot*Absorber.mediumVapourIn.d + Absorber.downStreamIn.Vdot*Absorber.mediumLiquidIn.d+Absorber.upStreamOut.Vdot*Absorber.mediumVapour[30].d+Absorber.downStreamOut.Vdot*Absorber.mediumLiquid[1].d;
-      // Modelica.SIunits.MassFlowRate bal_pump = idealPumpControlledVdot.liquidIn.Vdot*idealPumpControlledVdot.mediumLiquidIn.d+idealPumpControlledVdot.liquidOut.Vdot*idealPumpControlledVdot.mediumLiquid.d;
-      // Modelica.SIunits.MassFlowRate bal_pump1 = idealPumpControlledVdot1.liquidIn.Vdot*idealPumpControlledVdot1.mediumLiquidIn.d+idealPumpControlledVdot1.liquidOut.Vdot*idealPumpControlledVdot1.mediumLiquid.d;
-      // Modelica.SIunits.MassFlowRate bal_HEX = counterFlowHeatExchanger.hotLiquidIn.Vdot*counterFlowHeatExchanger.hotLiquidTube.mediumLiquidIn.d+counterFlowHeatExchanger.coldLiquidIn.Vdot*counterFlowHeatExchanger.coldLiquidTube.mediumLiquidIn.d+counterFlowHeatExchanger.hotLiquidOut.Vdot*counterFlowHeatExchanger.hotLiquidTube.mediumLiquid.d+counterFlowHeatExchanger.coldLiquidOut.Vdot*counterFlowHeatExchanger.coldLiquidTube.mediumLiquid.d;
-      // Modelica.SIunits.MassFlowRate bal_cooler = cooler.hotLiquidIn.Vdot*cooler.mediumLiquidIn.d + cooler.coldLiquidOut.Vdot*cooler.mediumLiquid.d;
-      // Modelica.SIunits.MassFlowRate bal_tank = tank.portIn.Vdot*tank.mediumLiquidIn.d+tank.portOut.Vdot*tank.mediumLiquid.d;
-      // Modelica.SIunits.MassFlowRate bal_tank1 = tank1.portIn.Vdot*tank1.mediumLiquidIn.d+tank1.portOut.Vdot*tank1.mediumLiquid.d;
-      // Modelica.SIunits.MassFlowRate bal_comb = combLiquid_x.liquidPortIn1.Vdot*combLiquid_x.mediumIn1.d+combLiquid_x.liquidPortIn2.Vdot*combLiquid_x.mediumIn2.d+combLiquid_x.liquidPortOut.Vdot*combLiquid_x.mediumOut.d;
-      // Modelica.SIunits.MassFlowRate bal_comb1 = combLiquid_x1.liquidPortIn1.Vdot*combLiquid_x1.mediumIn1.d+combLiquid_x1.liquidPortIn2.Vdot*combLiquid_x1.mediumIn2.d+combLiquid_x1.liquidPortOut.Vdot*combLiquid_x1.mediumOut.d;
-      //
-      // Modelica.SIunits.MassFlowRate bal_total = Absorber.upStreamIn.Vdot*Absorber.mediumVapourIn.d+Absorber.upStreamOut.Vdot*Absorber.mediumVapour[30].d+ flash_Condenser_simple.gasPortOut.Vdot*flash_Condenser_simple.mediumVapour.d+combLiquid_x1.liquidPortIn1.Vdot*combLiquid_x1.mediumIn1.d;
+      Modelica.Units.SI.MassFlowRate water_diff = Absorber.Ndot_v_in * Absorber.x_v_in[1] * 0.018 - Absorber.Ndot_v[Absorber.n] * Absorber.x_v[Absorber.n, 1] * 0.018;
+      //Real qspec = sumpV.Q_in/(1000^2) * 1/(max(0.04,Desorber.mdot_v[Desorber.n]*Desorber.X_v[Desorber.n,2]));
+      // Modelica.SIunits.MassFlowRate water_diff1_gas = Desorber.Ndot_v_in*Desorber.x_v_in[1]*0.018 - Desorber.Ndot_v[Desorber.n]*Desorber.x_v[Desorber.n,1]*0.018;
+      // Modelica.SIunits.MassFlowRate water_diff1_liq = Desorber.Ndot_l_in*Desorber.x_l_in[1]*0.018 - Desorber.Ndot_l[1]*Desorber.x_l[1,1]*0.018;
+      //
+      // Modelica.SIunits.MassFlowRate bal_reboiler = sumpV.liquidPortIn.Vdot*sumpV.mediumLiquidIn.d + sumpV.gasPortOut.Vdot*sumpV.mediumVapour.d + sumpV.liquidPortOut.Vdot*sumpV.mediumLiquid.d;
+      // Modelica.SIunits.MassFlowRate bal_condenser = flash_Condenser_simple.gasPortIn.Vdot*flash_Condenser_simple.mediumVapourIn.d + flash_Condenser_simple.gasPortOut.Vdot*flash_Condenser_simple.mediumVapour.d + flash_Condenser_simple.liquidPortOut.Vdot*flash_Condenser_simple.mediumLiquid.d;
+      // Modelica.SIunits.MassFlowRate bal_desorber = Desorber.upStreamIn.Vdot*Desorber.mediumVapourIn.d + Desorber.downStreamIn.Vdot*Desorber.mediumLiquidIn.d+Desorber.upStreamOut.Vdot*Desorber.mediumVapour[20].d+Desorber.downStreamOut.Vdot*Desorber.mediumLiquid[1].d;
+      // Modelica.SIunits.MassFlowRate bal_absorber = Absorber.upStreamIn.Vdot*Absorber.mediumVapourIn.d + Absorber.downStreamIn.Vdot*Absorber.mediumLiquidIn.d+Absorber.upStreamOut.Vdot*Absorber.mediumVapour[30].d+Absorber.downStreamOut.Vdot*Absorber.mediumLiquid[1].d;
+      // Modelica.SIunits.MassFlowRate bal_pump = idealPumpControlledVdot.liquidIn.Vdot*idealPumpControlledVdot.mediumLiquidIn.d+idealPumpControlledVdot.liquidOut.Vdot*idealPumpControlledVdot.mediumLiquid.d;
+      // Modelica.SIunits.MassFlowRate bal_pump1 = idealPumpControlledVdot1.liquidIn.Vdot*idealPumpControlledVdot1.mediumLiquidIn.d+idealPumpControlledVdot1.liquidOut.Vdot*idealPumpControlledVdot1.mediumLiquid.d;
+      // Modelica.SIunits.MassFlowRate bal_HEX = counterFlowHeatExchanger.hotLiquidIn.Vdot*counterFlowHeatExchanger.hotLiquidTube.mediumLiquidIn.d+counterFlowHeatExchanger.coldLiquidIn.Vdot*counterFlowHeatExchanger.coldLiquidTube.mediumLiquidIn.d+counterFlowHeatExchanger.hotLiquidOut.Vdot*counterFlowHeatExchanger.hotLiquidTube.mediumLiquid.d+counterFlowHeatExchanger.coldLiquidOut.Vdot*counterFlowHeatExchanger.coldLiquidTube.mediumLiquid.d;
+      // Modelica.SIunits.MassFlowRate bal_cooler = cooler.hotLiquidIn.Vdot*cooler.mediumLiquidIn.d + cooler.coldLiquidOut.Vdot*cooler.mediumLiquid.d;
+      // Modelica.SIunits.MassFlowRate bal_tank = tank.portIn.Vdot*tank.mediumLiquidIn.d+tank.portOut.Vdot*tank.mediumLiquid.d;
+      // Modelica.SIunits.MassFlowRate bal_tank1 = tank1.portIn.Vdot*tank1.mediumLiquidIn.d+tank1.portOut.Vdot*tank1.mediumLiquid.d;
+      // Modelica.SIunits.MassFlowRate bal_comb = combLiquid_x.liquidPortIn1.Vdot*combLiquid_x.mediumIn1.d+combLiquid_x.liquidPortIn2.Vdot*combLiquid_x.mediumIn2.d+combLiquid_x.liquidPortOut.Vdot*combLiquid_x.mediumOut.d;
+      // Modelica.SIunits.MassFlowRate bal_comb1 = combLiquid_x1.liquidPortIn1.Vdot*combLiquid_x1.mediumIn1.d+combLiquid_x1.liquidPortIn2.Vdot*combLiquid_x1.mediumIn2.d+combLiquid_x1.liquidPortOut.Vdot*combLiquid_x1.mediumOut.d;
+      //
+      // Modelica.SIunits.MassFlowRate bal_total = Absorber.upStreamIn.Vdot*Absorber.mediumVapourIn.d+Absorber.upStreamOut.Vdot*Absorber.mediumVapour[30].d+ flash_Condenser_simple.gasPortOut.Vdot*flash_Condenser_simple.mediumVapour.d+combLiquid_x1.liquidPortIn1.Vdot*combLiquid_x1.mediumIn1.d;
       ThermalSeparation.Components.Columns.StructuredPackedColumn Absorber(inertVapour = {false, true, false, true}, inertLiquid = {false, false, true}, nS = 2, redeclare model HeatTransferWall =
             ThermalSeparation.Wall.Adiabatic,                                                                                                                                                                                         mapping = {{1, 1}, {3, 2}}, wettedInitial = false, x_l_start_const = {0.88, 0.01, 0.11}, redeclare record
                                                                                                                                                                                                         Geometry =
@@ -114,7 +114,7 @@
       ThermalSeparation.Components.Pumps.idealPumpControlledVdot idealPumpControlledVdot(V_flow_start = 0.9, T = 1, dT = 0.5, redeclare package MediumLiquid =
             Media.H2O_CO2_MEA_Liq)                                                                                                                                                    annotation (
         Placement(transformation(extent = {{11, -10}, {-11, 10}}, rotation = 90, origin = {51, -88})));
-      Modelica.Blocks.Continuous.LimPID PID(yMin = 0, y_start = 0.9, yMax = 1.2, controllerType = Modelica.Blocks.Types.SimpleController.PI, initType = Modelica.Blocks.Types.InitPID.InitialOutput, k = 1, Ti = 10) annotation (
+      Modelica.Blocks.Continuous.LimPID PID(yMin = 0, y_start = 0.9, yMax = 1.2, controllerType = Modelica.Blocks.Types.SimpleController.PI, initType = Modelica.Blocks.Types.Init.InitialOutput, k = 1, Ti = 10) annotation (
         Placement(transformation(extent = {{4, -4}, {-4, 4}}, rotation = 0, origin = {34, -54})));
       ThermalSeparation.Components.LiquidVolumes.Tank tank(inertLiquid = {false, false, true}, x_l_start = {0.868, 0.022, 0.11}, d_volume = 3, redeclare package MediumLiquid =
             Media.H2O_CO2_MEA_Liq,                                                                                                                                                                     p_gas = 100000, T_start = 393.15, level_start = 10) annotation (
@@ -125,7 +125,7 @@
       ThermalSeparation.Components.Pumps.idealPumpControlledVdot idealPumpControlledVdot1(V_flow_start = 0.9, T = 1, dT = 0.5, redeclare package MediumLiquid =
             Media.H2O_CO2_MEA_Liq)                                                                                                                                                     annotation (
         Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {-24, -88})));
-      Modelica.Blocks.Continuous.LimPID PID1(controllerType = Modelica.Blocks.Types.SimpleController.PI, k = 100, Ti = 0.1, yMin = 0, initType = Modelica.Blocks.Types.InitPID.InitialOutput, y_start = 0.1, yMax = 1.2) annotation (
+      Modelica.Blocks.Continuous.LimPID PID1(controllerType = Modelica.Blocks.Types.SimpleController.PI, k = 100, Ti = 0.1, yMin = 0, initType = Modelica.Blocks.Types.Init.InitialOutput, y_start = 0.1, yMax = 1.2) annotation (
         Placement(transformation(extent = {{-4, -4}, {4, 4}}, rotation = 0, origin = {-26, -55})));
       Modelica.Blocks.Sources.RealExpression captureRatio1(y = x_CO2_removed) annotation (
         Placement(transformation(extent = {{-5, -4}, {5, 4}}, rotation = 180, origin = {43, -62})));
@@ -136,7 +136,7 @@
       ThermalSeparation.Components.SourcesSinks.CombLiquid_x combLiquid_x(x_start = {0.868, 0.022, 0.11}, redeclare package Medium =
             Media.H2O_CO2_MEA_Liq,                                                                                                                          T_start = 393.15) annotation (
         Placement(transformation(extent = {{-5, -5}, {5, 5}}, rotation = 270, origin = {100, -45})));
-      Modelica.Blocks.Continuous.LimPID PID2(yMax = 300000000, yMin = 50000000, y_start = 201000000, initType = Modelica.Blocks.Types.InitPID.InitialOutput, controllerType = Modelica.Blocks.Types.SimpleController.PI, k = 10000, Ti = 0.005) annotation (
+      Modelica.Blocks.Continuous.LimPID PID2(yMax = 300000000, yMin = 50000000, y_start = 201000000, initType = Modelica.Blocks.Types.Init.InitialOutput, controllerType = Modelica.Blocks.Types.SimpleController.PI, k = 10000, Ti = 0.005) annotation (
         Placement(transformation(extent = {{-4, 4}, {4, -4}}, rotation = 0, origin = {62, -28})));
       Modelica.Blocks.Sources.RealExpression T_Reboiler(y = sumpV.T) annotation (
         Placement(transformation(extent = {{-6, -4}, {6, 4}}, rotation = 0, origin = {46, -16})));
@@ -237,7 +237,7 @@
 
     model Cycle_Heyden_StartUp
       Real x_CO2_removed = max(1e-7, 1 - Absorber.x_v[Absorber.n, 3] / max(0.001, sourceGas_Vdot.x[3]));
-      Modelica.SIunits.MassFlowRate water_diff = Absorber.Ndot_v_in * Absorber.x_v_in[1] * 0.018 - Absorber.Ndot_v[Absorber.n] * Absorber.x_v[Absorber.n, 1] * 0.018;
+      Modelica.Units.SI.MassFlowRate water_diff = Absorber.Ndot_v_in * Absorber.x_v_in[1] * 0.018 - Absorber.Ndot_v[Absorber.n] * Absorber.x_v[Absorber.n, 1] * 0.018;
       Real qspec = sumpV.Q_in / 1000 ^ 2 * 1 / max(0.04, Desorber.mdot_v[Desorber.n] * Desorber.X_v[Desorber.n, 2]);
       ThermalSeparation.Components.Columns.StructuredPackedColumn_newStartUpShutDown Absorber(inertVapour = {false, true, false, true}, inertLiquid = {false, false, true}, nS = 2, mapping = {{1, 1}, {3, 2}}, wettedInitial = false, redeclare model
                                                                                                                                                                                                         Holdup =
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Examples/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Examples/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Examples/package.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Examples/package.mo"	2022-03-10 09:58:37.080151612 +0000
@@ -1,7 +1,8 @@
 within ThermalSeparation;
 package Examples "Examples"
       extends Icons.Library.Green;
-  import SI = Modelica.SIunits;
+  import Modelica.Units.SI;
+
 
 
   annotation(preferedView="info");
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/RandomPackedColumn/EnhancementMS.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/RandomPackedColumn/EnhancementMS.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/RandomPackedColumn/EnhancementMS.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/RandomPackedColumn/EnhancementMS.mo"	2022-03-10 09:58:36.240151505 +0000
@@ -1,9 +1,8 @@
-ï»¿within ThermalSeparation.FilmModel.RandomPackedColumn;
+within ThermalSeparation.FilmModel.RandomPackedColumn;
 model EnhancementMS
   "enhancement of reaction on liquid side, Maxwell-Stefan on gas side"
 
-// this model is for some reason not compiling due to a structual singularity
-
+// this model is for some reason not compiling due to a structual singularity
   import ThermalSeparation;
 extends BaseNonEqType;
 extends ThermalSeparation.FilmModel.BaseClasses.EnhancementMS(redeclare record
@@ -75,57 +74,55 @@
 ThermalSeparation.Units.CoefficentOfMassTransfer k_av_vap[n];
 SI.DiffusionCoefficient D_av_liq[n];
 SI.DiffusionCoefficient D_av_vap[n];
-equation
-
-        //Erstellen der K Matrix:
-       for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSL loop
-       for m in i:nSL loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_l[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_l[j,i,m] = max(massTransferCoeffLiq.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_l[j,i,m] = max(k_l[j,m,i],1e-10);
-         end for;
-     end for;
-         end for;
-                for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSV loop
-       for m in i:nSV loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_v[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_v[j,i,m] = max(massTransferCoeffVap.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_v[j,i,m] = max(k_v[j,m,i],1e-10);
-         end for;
-     end for;
-      end for;
+equation
+//Erstellen der K Matrix:
+  for j in 1:n loop
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSL loop
+      for m in i:nSL loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_l[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_l[j, i, m] = max(massTransferCoeffLiq.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+      for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_l[j, i, m] = max(k_l[j, m, i], 1e-10);
+      end for;
+    end for;
+  end for;
+  for j in 1:n loop
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSV loop
+      for m in i:nSV loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_v[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_v[j, i, m] = max(massTransferCoeffVap.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+      for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_v[j, i, m] = max(k_v[j, m, i], 1e-10);
+      end for;
+    end for;
+  end for;
 
    alphaLiq=heatTransferCoeffLiq.alpha;
-   alphaVap=heatTransferCoeffVap.alpha;
-//   k_l_diluted = massTransferCoeffLiqEnhance.k;
-
-  for j in 1:n loop
-     D_av_vap[j]=sum(D_vap[j,:])/aux[nSV-1];
-      D_av_liq[j]=sum(D_liq[j,:])/aux[nSL-1];
-    k_av_vap[j]=sum(massTransferCoeffVap.k[j,:])/aux[nSV-1];
-      k_av_liq[j]=sum(massTransferCoeffLiq.k[j,:])/aux[nSL-1];
-     A_I[j] = interfacialArea.a[j]*geometry.H*geometry.A/n;
-      w_sup_liq[j] = max(1e-10,Vdot_l[j]/geometry.A);
-      w_sup_vap[j] = max(1e-10,Vdot_v[j]/geometry.A);
+   alphaVap=heatTransferCoeffVap.alpha;
+//   k_l_diluted = massTransferCoeffLiqEnhance.k;
+  for j in 1:n loop
+    D_av_vap[j] = sum(D_vap[j, :]) / aux[nSV - 1];
+    D_av_liq[j] = sum(D_liq[j, :]) / aux[nSL - 1];
+    k_av_vap[j] = sum(massTransferCoeffVap.k[j, :]) / aux[nSV - 1];
+    k_av_liq[j] = sum(massTransferCoeffLiq.k[j, :]) / aux[nSL - 1];
+    A_I[j] = interfacialArea.a[j] * geometry.H * geometry.A / n;
+    w_sup_liq[j] = max(1e-10, Vdot_l[j] / geometry.A);
+    w_sup_vap[j] = max(1e-10, Vdot_v[j] / geometry.A);
   end for;
 end EnhancementMS;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/RandomPackedColumn/MS.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/RandomPackedColumn/MS.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/RandomPackedColumn/MS.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/RandomPackedColumn/MS.mo"	2022-03-10 09:58:36.204151500 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.FilmModel.RandomPackedColumn;
+within ThermalSeparation.FilmModel.RandomPackedColumn;
 model MS "Maxwell-Stefan mass transfer - no film reaction"
 extends BaseNonEqType;
 extends ThermalSeparation.FilmModel.BaseClasses.MaxwellStefan(redeclare record
@@ -64,45 +64,44 @@
      SI.DiffusionCoefficient D_vap[n,aux[nSV-1]]=diffCoeffVap.D;
      SI.Velocity w_sup_l[n] "superficial liquid velocity";
      SI.Velocity w_sup_v[n] "superficial vapour velocity";
-equation
-
-           //Erstellen der K Matrix:
-       for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSL loop
-       for m in i:nSL loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_l[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_l[j,i,m] = max(massTransferCoeffLiq.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_l[j,i,m] = max(k_l[j,m,i],1e-10);
-         end for;
-     end for;
-         end for;
-                for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSV loop
-       for m in i:nSV loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_v[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_v[j,i,m] = max(massTransferCoeffVap.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_v[j,i,m] = max(k_v[j,m,i],1e-10);
-         end for;
-     end for;
-      end for;
+equation
+//Erstellen der K Matrix:
+  for j in 1:n loop
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSL loop
+      for m in i:nSL loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_l[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_l[j, i, m] = max(massTransferCoeffLiq.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+      for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_l[j, i, m] = max(k_l[j, m, i], 1e-10);
+      end for;
+    end for;
+  end for;
+   for j in 1:n loop
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSV loop
+      for m in i:nSV loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_v[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_v[j, i, m] = max(massTransferCoeffVap.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+      for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_v[j, i, m] = max(k_v[j, m, i], 1e-10);
+      end for;
+    end for;
+  end for;
 
    alphaLiq=heatTransferCoeffLiq.alpha;
    alphaVap=heatTransferCoeffVap.alpha;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/SprayColumn/MS.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/SprayColumn/MS.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/SprayColumn/MS.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/SprayColumn/MS.mo"	2022-03-10 09:58:36.156151493 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.FilmModel.SprayColumn;
+within ThermalSeparation.FilmModel.SprayColumn;
 model MS "Maxwell-Stefan mass transfer - no film reaction"
 extends SprayColumn.BaseNonEqType(nn=n);
 extends ThermalSeparation.FilmModel.BaseClasses.MaxwellStefan(redeclare record
@@ -56,45 +56,44 @@
      SI.DiffusionCoefficient D_vap[n,aux[nSV-1]]=diffCoeffVap.D;
      SI.Velocity w_sup_l[n] "superficial liquid velocity";
      SI.Velocity w_sup_v[n] "superficial vapour velocity";
-equation
-
-           //Erstellen der K Matrix:
-       for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSL loop
-       for m in i:nSL loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_l[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_l[j,i,m] = max(massTransferCoeffLiq.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_l[j,i,m] = max(k_l[j,m,i],1e-10);
-         end for;
-     end for;
-         end for;
-                for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSV loop
-       for m in i:nSV loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_v[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_v[j,i,m] = max(massTransferCoeffVap.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_v[j,i,m] = max(k_v[j,m,i],1e-10);
-         end for;
-     end for;
-      end for;
+equation
+//Erstellen der K Matrix:
+  for j in 1:n loop
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSL loop
+      for m in i:nSL loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_l[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_l[j, i, m] = max(massTransferCoeffLiq.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+      for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_l[j, i, m] = max(k_l[j, m, i], 1e-10);
+      end for;
+    end for;
+  end for;
+ for j in 1:n loop
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSV loop
+      for m in i:nSV loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_v[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_v[j, i, m] = max(massTransferCoeffVap.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+      for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_v[j, i, m] = max(k_v[j, m, i], 1e-10);
+      end for;
+    end for;
+  end for;
 
    alphaLiq=heatTransferCoeffLiq.alpha;
    alphaVap=heatTransferCoeffVap.alpha;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/SprayColumn/MS_film.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/SprayColumn/MS_film.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/SprayColumn/MS_film.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/SprayColumn/MS_film.mo"	2022-03-10 09:58:36.140151492 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.FilmModel.SprayColumn;
+within ThermalSeparation.FilmModel.SprayColumn;
 model MS_film "Maxwell-Stefan mass transfer - film reaction"
   import ThermalSeparation;
 extends SprayColumn.BaseNonEqType(nn=n);
@@ -86,21 +86,21 @@
                   //Erstellen der K Matrix:
 
                 for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSV loop
-       for m in i:nSV loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_v[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_v[j,i,m] = max(massTransferCoeffVap.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_v[j,i,m] = max(k_v[j,m,i],1e-10);
-         end for;
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSV loop
+ for m in i:nSV loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_v[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_v[j, i, m] = max(massTransferCoeffVap.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+ for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_v[j, i, m] = max(k_v[j, m, i], 1e-10);
+      end for;
      end for;
       end for;
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/SprayColumn/MS_mod.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/SprayColumn/MS_mod.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/SprayColumn/MS_mod.mo"	2022-03-10 09:57:37.912144114 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/SprayColumn/MS_mod.mo"	2022-03-10 09:58:36.128151490 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.FilmModel.SprayColumn;
+within ThermalSeparation.FilmModel.SprayColumn;
 model MS_mod "modified Maxwell-Stefan mass transfer - no film reaction"
 extends SprayColumn.BaseNonEqType(nn=n);
 extends ThermalSeparation.FilmModel.BaseClasses.MaxwellStefan_mod(redeclare record
@@ -56,49 +56,49 @@
      SI.DiffusionCoefficient D_vap[n,aux[nSV-1]]=diffCoeffVap.D;
      SI.Velocity w_sup_l[n] "superficial liquid velocity";
      SI.Velocity w_sup_v[n] "superficial vapour velocity";
-equation
-                       //Erstellen der K Matrix:
-       for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSL loop
-       for m in i:nSL loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_l[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_l[j,i,m] = max(massTransferCoeffLiq.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_l[j,i,m] = max(k_l[j,m,i],1e-10);
-         end for;
-     end for;
-         end for;
-                for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSV loop
-       for m in i:nSV loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_v[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_v[j,i,m] = max(massTransferCoeffVap.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_v[j,i,m] = max(k_v[j,m,i],1e-10);
-         end for;
-     end for;
-      end for;
+equation
+//Erstellen der K Matrix:
+  for j in 1:n loop
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSL loop
+      for m in i:nSL loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_l[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_l[j, i, m] = max(massTransferCoeffLiq.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+      for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_l[j, i, m] = max(k_l[j, m, i], 1e-10);
+      end for;
+    end for;
+  end for;
+ for j in 1:n loop
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSV loop
+      for m in i:nSV loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_v[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_v[j, i, m] = max(massTransferCoeffVap.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+      for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_v[j, i, m] = max(k_v[j, m, i], 1e-10);
+      end for;
+    end for;
+  end for;
 
    alphaLiq=heatTransferCoeffLiq.alpha;
-   alphaVap=heatTransferCoeffVap.alpha;
-   //  A_I = 300*ones(n);
-       A_I=fill(400*geometry.H*geometry.A/n,n);
+   alphaVap=heatTransferCoeffVap.alpha;
+//  A_I = 300*ones(n);
+  A_I = fill(400 * geometry.H * geometry.A / n, n);
 
        for j in 1:n loop
      D_av_vap[j]=sum(D_vap[j,:])/aux[nSV-1];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/EnhancementMS.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/EnhancementMS.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/EnhancementMS.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/EnhancementMS.mo"	2022-03-10 09:58:36.080151484 +0000
@@ -1,9 +1,8 @@
-ï»¿within ThermalSeparation.FilmModel.StructuredPackedColumn;
+within ThermalSeparation.FilmModel.StructuredPackedColumn;
 model EnhancementMS
   "enhancement of reaction on liquid side, Maxwell-Stefan on gas side"
 
-// this model is for some reason not compiling due to a structual singularity
-
+// this model is for some reason not compiling due to a structual singularity
   import ThermalSeparation;
 extends BaseNonEqType;
 extends ThermalSeparation.FilmModel.BaseClasses.EnhancementMS(redeclare record
@@ -80,21 +79,21 @@
  k_l = massTransferCoeffLiqEnhance.k;
 
                 for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSV loop
-       for m in i:nSV loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_v[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_v[j,i,m] = max(massTransferCoeffVap.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_v[j,i,m] = max(k_v[j,m,i],1e-10);
-         end for;
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSV loop
+ for m in i:nSV loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_v[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_v[j, i, m] = max(massTransferCoeffVap.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+ for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_v[j, i, m] = max(k_v[j, m, i], 1e-10);
+      end for;
      end for;
       end for;
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/MS.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/MS.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/MS.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/MS.mo"	2022-03-10 09:58:36.044151480 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.FilmModel.StructuredPackedColumn;
+within ThermalSeparation.FilmModel.StructuredPackedColumn;
 model MS "Maxwell-Stefan mass transfer - no film reaction"
 extends BaseNonEqType;
 extends ThermalSeparation.FilmModel.BaseClasses.MaxwellStefan(redeclare record
@@ -63,45 +63,44 @@
      SI.DiffusionCoefficient D_vap[n,aux[nSV-1]]=diffCoeffVap.D;
      SI.Velocity w_sup_l[n] "superficial liquid velocity";
      SI.Velocity w_sup_v[n] "superficial vapour velocity";
-equation
-
-           //Erstellen der K Matrix:
-       for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSL loop
-       for m in i:nSL loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_l[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_l[j,i,m] = max(massTransferCoeffLiq.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_l[j,i,m] = max(k_l[j,m,i],1e-10);
-         end for;
-     end for;
-         end for;
-                for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSV loop
-       for m in i:nSV loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_v[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_v[j,i,m] = max(massTransferCoeffVap.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_v[j,i,m] = max(k_v[j,m,i],1e-10);
-         end for;
-     end for;
-      end for;
+equation
+//Erstellen der K Matrix:
+  for j in 1:n loop
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSL loop
+      for m in i:nSL loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_l[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_l[j, i, m] = max(massTransferCoeffLiq.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+      for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_l[j, i, m] = max(k_l[j, m, i], 1e-10);
+      end for;
+    end for;
+  end for;
+   for j in 1:n loop
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSV loop
+      for m in i:nSV loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_v[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_v[j, i, m] = max(massTransferCoeffVap.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+      for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_v[j, i, m] = max(k_v[j, m, i], 1e-10);
+      end for;
+    end for;
+  end for;
 
    alphaLiq=heatTransferCoeffLiq.alpha;
    alphaVap=heatTransferCoeffVap.alpha;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/MS_film.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/MS_film.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/MS_film.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/MS_film.mo"	2022-03-10 09:58:36.024151476 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.FilmModel.StructuredPackedColumn;
+within ThermalSeparation.FilmModel.StructuredPackedColumn;
 model MS_film "Maxwell-Stefan mass transfer - film reaction"
   import ThermalSeparation;
 extends BaseNonEqType;
@@ -58,8 +58,8 @@
 SI.DiffusionCoefficient D_av_liq[n];
 SI.DiffusionCoefficient D_av_vap[n];
 
-//SI.DiffusionCoefficient D_liq_matrix[n,nSL,nSL];
-SI.Length t_comp[n,aux[nSL-1]] "film thickness for each component";
+//SI.DiffusionCoefficient D_liq_matrix[n,nSL,nSL];
+  SI.Length t_comp[n,aux[nSL-1]] "film thickness for each component";
     SI.CoefficientOfHeatTransfer alphaLiq[n]=heatTransferCoeffLiq.alpha;
 
            MediumVapour.DiffusionCoefficient[n] diffCoeffVap(T=T_v, p=p_v[1:n]);
@@ -96,21 +96,21 @@
 
          /*** K matrix***/
                          for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSV loop
-       for m in i:nSV loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_v[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_v[j,i,m] = max(massTransferCoeffVap.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_v[j,i,m] = max(k_v[j,m,i],1e-10);
-         end for;
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSV loop
+ for m in i:nSV loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_v[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_v[j, i, m] = max(massTransferCoeffVap.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+ for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_v[j, i, m] = max(k_v[j, m, i], 1e-10);
+      end for;
      end for;
       end for;
 end MS_film;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/MS_mod.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/MS_mod.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/MS_mod.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/StructuredPackedColumn/MS_mod.mo"	2022-03-10 09:58:36.008151475 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.FilmModel.StructuredPackedColumn;
+within ThermalSeparation.FilmModel.StructuredPackedColumn;
 model MS_mod "modified Maxwell-Stefan mass transfer - no film reaction"
   import ThermalSeparation;
 extends BaseNonEqType;
@@ -65,45 +65,44 @@
      SI.DiffusionCoefficient D_vap[n,aux[nSV-1]]=diffCoeffVap.D;
      SI.Velocity w_sup_l[n] "superficial liquid velocity";
      SI.Velocity w_sup_v[n] "superficial vapour velocity";
-equation
-
-                   //Erstellen der K Matrix:
-       for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSL loop
-       for m in i:nSL loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_l[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_l[j,i,m] = max(massTransferCoeffLiq.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_l[j,i,m] = max(k_l[j,m,i],1e-10);
-         end for;
-     end for;
-         end for;
-                for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSV loop
-       for m in i:nSV loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_v[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_v[j,i,m] = max(massTransferCoeffVap.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_v[j,i,m] = max(k_v[j,m,i],1e-10);
-         end for;
-     end for;
-      end for;
+equation
+//Erstellen der K Matrix:
+  for j in 1:n loop
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSL loop
+      for m in i:nSL loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_l[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_l[j, i, m] = max(massTransferCoeffLiq.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+      for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_l[j, i, m] = max(k_l[j, m, i], 1e-10);
+      end for;
+    end for;
+  end for;
+  for j in 1:n loop
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSV loop
+      for m in i:nSV loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_v[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_v[j, i, m] = max(massTransferCoeffVap.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+      for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_v[j, i, m] = max(k_v[j, m, i], 1e-10);
+      end for;
+    end for;
+  end for;
 
    alphaLiq=heatTransferCoeffLiq.alpha;
    alphaVap=heatTransferCoeffVap.alpha;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/TrayColumn/MS_mod.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/TrayColumn/MS_mod.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/TrayColumn/MS_mod.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/FilmModel/TrayColumn/MS_mod.mo"	2022-03-10 09:58:35.932151466 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.FilmModel.TrayColumn;
+within ThermalSeparation.FilmModel.TrayColumn;
 model MS_mod "modified Maxwell-Stefan mass transfer - no film reaction"
   import ThermalSeparation;
 extends BaseNonEqType(nn=n);
@@ -69,45 +69,44 @@
      SI.DiffusionCoefficient D_vap[n,aux[nSV-1]]=diffCoeffVap.D;
      SI.Velocity w_sup_l[n] "superficial liquid velocity";
      SI.Velocity w_sup_v[n] "superficial vapour velocity";
-equation
-
-                           //Erstellen der K Matrix:
-       for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSL loop
-       for m in i:nSL loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_l[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_l[j,i,m] = max(massTransferCoeffLiq.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_l[j,i,m] = max(k_l[j,m,i],1e-10);
-         end for;
-     end for;
-         end for;
-                for j in 1:n loop
-    //Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
-     for i in 1:nSV loop
-       for m in i:nSV loop
-         if i==m then
-           //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
-           k_v[j,i,m] = 10;
-         else
-           //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
-           k_v[j,i,m] = max(massTransferCoeffVap.k[j,m-2+i],1e-10);
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //k_12 = k_21, k_13 = k_31 etc.
-           k_v[j,i,m] = max(k_v[j,m,i],1e-10);
-         end for;
-     end for;
-      end for;
+equation
+//Erstellen der K Matrix:
+  for j in 1:n loop
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSL loop
+      for m in i:nSL loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_l[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_l[j, i, m] = max(massTransferCoeffLiq.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+      for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_l[j, i, m] = max(k_l[j, m, i], 1e-10);
+      end for;
+    end for;
+  end for;
+  for j in 1:n loop
+//Erstellen einer Matrix aus den binÃ¤ren StoffÃ¼bergangskoeffizienten
+    for i in 1:nSV loop
+      for m in i:nSV loop
+        if i == m then
+//die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+          k_v[j, i, m] = 10;
+        else
+//die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+          k_v[j, i, m] = max(massTransferCoeffVap.k[j, m - 2 + i], 1e-10);
+        end if;
+      end for;
+      for m in 1:i - 1 loop
+//k_12 = k_21, k_13 = k_31 etc.
+        k_v[j, i, m] = max(k_v[j, m, i], 1e-10);
+      end for;
+    end for;
+  end for;
 
    alphaLiq=heatTransferCoeffLiq.alpha;
    alphaVap=heatTransferCoeffVap.alpha;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/PackedColumn/Geometry.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/PackedColumn/Geometry.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/PackedColumn/Geometry.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/PackedColumn/Geometry.mo"	2022-03-10 09:58:12.532148501 +0000
@@ -9,7 +9,7 @@
    parameter ThermalSeparation.Units.VolumetricArea a=
                                          600
     "specific gas-liquid interfacial area in m2/m3";
- //(Fluiddynamik in Füllkörper und Packungskolonnen)
+ //(Fluiddynamik in FÃ¼llkÃ¶rper und Packungskolonnen)
   parameter Real C_L = 0.4 "constant used for pressure drop calculation";
   parameter SI.Diameter d_char = 0.01
     "characteristic length of filling material, for Re calculation";
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/PackedColumn/Mellapak250Y_theta60.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/PackedColumn/Mellapak250Y_theta60.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/PackedColumn/Mellapak250Y_theta60.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/PackedColumn/Mellapak250Y_theta60.mo"	2022-03-10 09:58:12.532148501 +0000
@@ -1,5 +1,5 @@
 within ThermalSeparation.Geometry.PackedColumn;
-record Mellapak250Y_theta60 "Mellapak 250Y mit theta=60°"
+record Mellapak250Y_theta60 "Mellapak 250Y mit theta=60Â°"
 //Mellapak 250Y; steel 1.4571
   extends Geometry(H=30, d=0.2, eps=0.98, rho_solid=7980*ones(n), c_solid= 500, a=250, sigma_crit=75e-3, zeta=0.1, d_char=0.025);//, theta=45);
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/PlateColumn/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/PlateColumn/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/PlateColumn/package.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/PlateColumn/package.mo"	2022-03-10 09:58:35.900151462 +0000
@@ -1,4 +1,5 @@
 within ThermalSeparation.Geometry;
 package PlateColumn 
-import SI = Modelica.SIunits;
+import Modelica.Units.SI;
+
 end PlateColumn;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/RandomPackedColumn/Geometry.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/RandomPackedColumn/Geometry.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/RandomPackedColumn/Geometry.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/RandomPackedColumn/Geometry.mo"	2022-03-10 09:58:35.880151460 +0000
@@ -1,28 +1,28 @@
-ï»¿within ThermalSeparation.Geometry.RandomPackedColumn;
+within ThermalSeparation.Geometry.RandomPackedColumn;
 record Geometry
   extends ThermalSeparation.Geometry.BasicGeoPackedColumn;
 
-  //packing data
+//packing data
  parameter Real zeta = 0.01 "pressure loss coefficient";
 
- //(Fluiddynamik in FÃ¼llkÃ¶rper und Packungskolonnen)
+//(Fluiddynamik in FÃ¼llkÃ¶rper und Packungskolonnen)
   parameter Real C_L = 0.4 "constant used for pressure drop calculation";
   parameter SI.Diameter d_char = 0.01
     "characteristic length of filling material, for Re calculation";
   parameter SI.SurfaceTension sigma_crit = 33e-3
     "critical surface tension, at which the liquid is teared";
-  //Onda et al.: (Mersmann)
-  // PE: 33e-3 N/m, PVC: 40e-3 N/m, Keramik: 61e-3 N/m, Glas: 73e-3 N/m, Stahl: 75e-3 N/m
+  //Onda et al.: (Mersmann)
+  // PE: 33e-3 N/m, PVC: 40e-3 N/m, Keramik: 61e-3 N/m, Glas: 73e-3 N/m, Stahl: 75e-3 N/m
   parameter Real C= if d_char < 0.015 then 2 else 5.24
     "constant used for mass transfer coeff. calculation";
-  //Wert aus Mersmann, p. 337
+  //Wert aus Mersmann, p. 337
   final parameter SI.Area A_free = A*eps
     "free cross sectional area, where vapour or liquid can be found";
 
-    //Structured Packing:
-//     parameter SI.Angle theta=60 "corrugation angle in deg";
-//     parameter SI.Length S= 0.007
-//     "side length of corrugation; corrugation spacing";
+//Structured Packing:
+  //     parameter SI.Angle theta=60 "corrugation angle in deg";
+  //     parameter SI.Length S= 0.007
+  //     "side length of corrugation; corrugation spacing";
     final parameter Real cos_gamma = if sigma_crit < 55e-3 then 0.9 else 5.211*10^(-16.835*sigma_crit);
     final parameter Real F_SE=0.35;
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/RandomPackedColumn/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/RandomPackedColumn/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/RandomPackedColumn/package.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/RandomPackedColumn/package.mo"	2022-03-10 09:58:35.884151459 +0000
@@ -1,4 +1,5 @@
 within ThermalSeparation.Geometry;
 package RandomPackedColumn 
-import SI = Modelica.SIunits;
+import Modelica.Units.SI;
+
 end RandomPackedColumn;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/SprayColumn.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/SprayColumn.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/SprayColumn.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/SprayColumn.mo"	2022-03-10 09:58:35.872151457 +0000
@@ -1,6 +1,6 @@
 within ThermalSeparation.Geometry;
 package SprayColumn
-  import SI = Modelica.SIunits;
+  import Modelica.Units.SI;
   record Example1
     extends Geometry(eps = 0.5, rho_solid = 1000*ones(n), c_solid = 4, a=3);
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/StructuredPackedColumn/Geometry.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/StructuredPackedColumn/Geometry.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/StructuredPackedColumn/Geometry.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/StructuredPackedColumn/Geometry.mo"	2022-03-10 09:58:35.860151456 +0000
@@ -1,25 +1,25 @@
-ï»¿within ThermalSeparation.Geometry.StructuredPackedColumn;
+within ThermalSeparation.Geometry.StructuredPackedColumn;
 record Geometry
   extends ThermalSeparation.Geometry.BasicGeoPackedColumn;
 
-  //Packungsparameter
+//Packungsparameter
  parameter Real zeta = 0.01 "pressure loss coefficient";
 
- //(Fluiddynamik in FÃ¼llkÃ¶rper und Packungskolonnen)
+//(Fluiddynamik in FÃ¼llkÃ¶rper und Packungskolonnen)
   parameter Real C_L = 0.4 "constant used for pressure drop calculation";
   parameter SI.Diameter d_char = 0.01
     "characteristic length of filling material, for Re calculation";
   parameter SI.SurfaceTension sigma_crit = 33e-3
     "critical surface tension, at which the liquid is teared";
-  //Onda et al.: (Mersmann)
-  // PE: 33e-3 N/m, PVC: 40e-3 N/m, Keramik: 61e-3 N/m, Glas: 73e-3 N/m, Stahl: 75e-3 N/m
+  //Onda et al.: (Mersmann)
+  // PE: 33e-3 N/m, PVC: 40e-3 N/m, Keramik: 61e-3 N/m, Glas: 73e-3 N/m, Stahl: 75e-3 N/m
   parameter Real C= if d_char < 0.015 then 2 else 5.24
     "constant used for mass transfer coeff. calculation";
-  //Wert aus Mersmann, p. 337
+  //Wert aus Mersmann, p. 337
   final parameter SI.Area A_free = A*eps
     "free cross sectional area, where vapour or liquid can be found";
 
-    //Structured Packing:
+//Structured Packing:
     parameter SI.Angle theta=60 "corrugation angle in deg";
     parameter SI.Length S= 0.007
     "side length of corrugation; corrugation spacing";
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/StructuredPackedColumn/Mellapak250Y_theta60.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/StructuredPackedColumn/Mellapak250Y_theta60.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/StructuredPackedColumn/Mellapak250Y_theta60.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/StructuredPackedColumn/Mellapak250Y_theta60.mo"	2022-03-10 09:58:35.852151455 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Geometry.StructuredPackedColumn;
+within ThermalSeparation.Geometry.StructuredPackedColumn;
 record Mellapak250Y_theta60 "Mellapak 250Y mit theta=60Â°"
 //Mellapak 250Y; steel 1.4571
   extends Geometry(H=30, d=0.2, eps=0.98, rho_solid=7980*ones(n), c_solid= 500, a=250, sigma_crit=75e-3, zeta=0.1, d_char=0.025);//, theta=45);
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/StructuredPackedColumn/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/StructuredPackedColumn/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/StructuredPackedColumn/package.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/StructuredPackedColumn/package.mo"	2022-03-10 09:58:35.864151456 +0000
@@ -1,4 +1,5 @@
 within ThermalSeparation.Geometry;
 package StructuredPackedColumn 
-import SI = Modelica.SIunits;
+import Modelica.Units.SI;
+
 end StructuredPackedColumn;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/package.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Geometry/package.mo"	2022-03-10 09:58:35.920151464 +0000
@@ -1,6 +1,7 @@
 within ThermalSeparation;
 package Geometry "Geometry blue prints for the different column types"
-import SI = Modelica.SIunits;
+import Modelica.Units.SI;
+
 
 
   annotation(preferedView="info");
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/DiffusionCoeff/Liquid/test.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/DiffusionCoeff/Liquid/test.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/DiffusionCoeff/Liquid/test.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/DiffusionCoeff/Liquid/test.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -30,7 +30,7 @@
     eigk[i] = eigSh[i]*eigD[i]/2.21e-2;
   end for;
 
-  //Problem: D ist nicht konstant sondern abhängig von T und c, deswegen kann es sein, daß man hier gar keinen algorithm verwenden darf!
+  //Problem: D ist nicht konstant sondern abhÃ¤ngig von T und c, deswegen kann es sein, daÃŸ man hier gar keinen algorithm verwenden darf!
 algorithm
   for i in 1:n-1 loop
     m[i]:=0;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/DiffusionCoeff/Vapour/Fuller.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/DiffusionCoeff/Vapour/Fuller.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/DiffusionCoeff/Vapour/Fuller.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/DiffusionCoeff/Vapour/Fuller.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -3,10 +3,10 @@
   extends
     ThermalSeparation.HeatAndMassTransfer.DiffusionCoeff.Vapour.BaseDiffusionCoeffGas;
 
-  //Werte für N2, H2O, CO2, O2, Taylor S. 69
+  //Werte fÃ¼r N2, H2O, CO2, O2, Taylor S. 69
   //parameter Real V[:]={18.5, 13.1, 16.3, 26.7};
 protected
-  parameter Integer counter1[nS-1]={nS-i+1 for i in 2:nS};//für nS=4: {0,3,2,1};
+  parameter Integer counter1[nS-1]={nS-i+1 for i in 2:nS};//fÃ¼r nS=4: {0,3,2,1};
   final parameter Real C= 1.013e-2;
   Integer counter[nS];
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/DiffusionCoeff/Vapour/KineticTheory.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/DiffusionCoeff/Vapour/KineticTheory.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/DiffusionCoeff/Vapour/KineticTheory.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/DiffusionCoeff/Vapour/KineticTheory.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -6,7 +6,7 @@
     ThermalSeparation.HeatAndMassTransfer.DiffusionCoeff.Vapour.BaseDiffusionCoeffGas;
 
 protected
-  parameter Integer counter1[nS-1]={nS-i+1 for i in 2:nS};//für nS=4: {0,3,2,1};
+  parameter Integer counter1[nS-1]={nS-i+1 for i in 2:nS};//fÃ¼r nS=4: {0,3,2,1};
   Integer counter[nS];
   final parameter Real C= 1.883e-2;
   Real sigma_mix[a] "Lennard-Jones force constant), constant value";
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/HTResistance.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/HTResistance.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/HTResistance.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/HTResistance.mo"	2022-03-10 09:58:35.828151452 +0000
@@ -5,12 +5,12 @@
 
   parameter Integer n(min=1) annotation(dialog(enable=false));
 
-  input Modelica.SIunits.Temperature T[n];
-  input Modelica.SIunits.Area A[n];
-  input Modelica.SIunits.HeatFlowRate Qdot[n](start=fill(1e8,n));
-  input Modelica.SIunits.Pressure p[n];
+  input Modelica.Units.SI.Temperature T[n];
+  input Modelica.Units.SI.Area A[n];
+  input Modelica.Units.SI.HeatFlowRate Qdot[n](start=fill(1e8,n));
+  input Modelica.Units.SI.Pressure p[n];
 
-  Modelica.SIunits.Temperature Twall[n];
+  Modelica.Units.SI.Temperature Twall[n];
   Real alpha[n] "heat transfer coefficient";
 
   end BaseHTResistance;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PackedColumn/Liquid/Onda.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PackedColumn/Liquid/Onda.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PackedColumn/Liquid/Onda.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PackedColumn/Liquid/Onda.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -23,7 +23,7 @@
   Boolean liquidExists[n](each start=false) "true if liquid is on the stage";
 
 equation
-  // Werte belegen, damit das System nicht singulär wird:
+  // Werte belegen, damit das System nicht singulÃ¤r wird:
 //   Re[:]=fill(0,n);
 //   Sc[:,:]=fill(0,n,a);
 //   Sh[:,:]=fill(0,n,a);
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PackedColumn/Vapour/Constant.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PackedColumn/Vapour/Constant.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PackedColumn/Vapour/Constant.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PackedColumn/Vapour/Constant.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -11,7 +11,7 @@
 //liquids: 1e-4 to 1e-5 (for liquids in pores, the value can be smaller, for example 1e-6)
 equation
 
-    // Werte belegen, damit das System nicht singulär wird:
+    // Werte belegen, damit das System nicht singulÃ¤r wird:
 //   Re[:]=fill(0,n);
 //   Sc[:,:]=fill(0,n,a);
 //   Sh[:,:]=fill(0,n,a);
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Liquid/Const_K.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Liquid/Const_K.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Liquid/Const_K.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Liquid/Const_K.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -11,7 +11,7 @@
 //liquids: 1e-4 to 1e-5 (for liquids in pores, the value can be smaller, for example 1e-6)
   //1e-4, 1e-2
 equation
-    // Werte belegen, damit das System nicht singulär wird:
+    // Werte belegen, damit das System nicht singulÃ¤r wird:
 //   Re[:]=fill(0,n);
 //   Sc[:,:]=fill(0,n,a);
 //   Sh[:,:]=fill(0,n,a);
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Liquid/Stichlmair.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Liquid/Stichlmair.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Liquid/Stichlmair.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Liquid/Stichlmair.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -1,10 +1,10 @@
 within ThermalSeparation.HeatAndMassTransfer.PlateColumn.Liquid;
 model Stichlmair
   extends Base;
-//Stichlmair: Grundlagen der Dimensionierung des Gas/Flüssigkeit-Kontaktapparates Bodenkolonne, Weinheim, NY: Verlag Chemie, 1978, p. 142
+//Stichlmair: Grundlagen der Dimensionierung des Gas/FlÃ¼ssigkeit-Kontaktapparates Bodenkolonne, Weinheim, NY: Verlag Chemie, 1978, p. 142
 
 equation
-    // Werte belegen, damit das System nicht singulär wird:
+    // Werte belegen, damit das System nicht singulÃ¤r wird:
 //   Re[:]=fill(0,n);
 //   Sc[:,:]=fill(0,n,a);
 //   Sh[:,:]=fill(0,n,a);
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Vapour/Const_K.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Vapour/Const_K.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Vapour/Const_K.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Vapour/Const_K.mo"	2022-03-10 09:58:12.516148500 +0000
@@ -11,7 +11,7 @@
 //liquids: 1e-4 to 1e-5 (for liquids in pores, the value can be smaller, for example 1e-6)
   //1e-4, 1e-2
 equation
-    // Werte belegen, damit das System nicht singulär wird:
+    // Werte belegen, damit das System nicht singulÃ¤r wird:
 //   Re[:]=fill(0,n);
 //   Sc[:,:]=fill(0,n,a);
 //   Sh[:,:]=fill(0,n,a);
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Vapour/Stichlmair.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Vapour/Stichlmair.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Vapour/Stichlmair.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/PlateColumn/Vapour/Stichlmair.mo"	2022-03-10 09:58:12.516148500 +0000
@@ -1,9 +1,9 @@
 within ThermalSeparation.HeatAndMassTransfer.PlateColumn.Vapour;
 model Stichlmair
   extends Base;
-//Stichlmair: Grundlagen der Dimensionierung des Gas/Flüssigkeit-Kontaktapparates Bodenkolonne, Weinheim, NY: Verlag Chemie, 1978, p. 142
+//Stichlmair: Grundlagen der Dimensionierung des Gas/FlÃ¼ssigkeit-Kontaktapparates Bodenkolonne, Weinheim, NY: Verlag Chemie, 1978, p. 142
 equation
-    // Werte belegen, damit das System nicht singulär wird:
+    // Werte belegen, damit das System nicht singulÃ¤r wird:
 //   Re[:]=fill(0,n);
 //   Sc[:,:]=fill(0,n,a);
 //   Sh[:,:]=fill(0,n,a);
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/RandomPackedColumn/Liquid/Onda.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/RandomPackedColumn/Liquid/Onda.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/RandomPackedColumn/Liquid/Onda.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/RandomPackedColumn/Liquid/Onda.mo"	2022-03-10 09:58:35.660151432 +0000
@@ -1,6 +1,6 @@
-ï»¿within ThermalSeparation.HeatAndMassTransfer.RandomPackedColumn.Liquid;
+within ThermalSeparation.HeatAndMassTransfer.RandomPackedColumn.Liquid;
 model Onda "correlation from Onda, for random packings"
-//extends ThermalSeparation.FilmModel.BaseClasses.PackedColumn.BaseMSLiquid;
+  //extends ThermalSeparation.FilmModel.BaseClasses.PackedColumn.BaseMSLiquid;
   extends BaseLiqMT;
   parameter ThermalSeparation.Units.CoefficentOfMassTransfer k_l_0=
                                                         1e-4
@@ -9,12 +9,13 @@
   ThermalSeparation.Units.VolumetricArea a_wetted[
                                      n];
 
-//variables used in a_wetted
+//variables used in a_wetted
   Real aA[n];
   Real aB[n];
   Real aC[n];
   Real aD[n];
-//variables used in k_l
+
+//variables used in k_l
 protected
   Real klA[n];
   Real klB[n];
@@ -23,10 +24,10 @@
   Boolean liquidExists[n](each start=false) "true if liquid is on the stage";
 
 equation
-  // Werte belegen, damit das System nicht singulÃ¤r wird:
-//   Re[:]=fill(0,n);
-//   Sc[:,:]=fill(0,n,a);
-//   Sh[:,:]=fill(0,n,a);
+// Werte belegen, damit das System nicht singulÃ¤r wird:
+//   Re[:]=fill(0,n);
+//   Sc[:,:]=fill(0,n,a);
+//   Sh[:,:]=fill(0,n,a);
   for j in 1:n loop
     a_wetted[j] = max(1e1,geometry.a *(1- exp(-1.45*(aA[j])^0.75 * (aB[j])^0.1 * (aC[j])^(-0.05) * (aD[j])^0.2)));
       aA[j] = geometry.sigma_crit/sigma[j];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/RandomPackedColumn/Vapour/Constant.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/RandomPackedColumn/Vapour/Constant.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/RandomPackedColumn/Vapour/Constant.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/RandomPackedColumn/Vapour/Constant.mo"	2022-03-10 09:58:35.636151428 +0000
@@ -1,20 +1,19 @@
-ï»¿within ThermalSeparation.HeatAndMassTransfer.RandomPackedColumn.Vapour;
+within ThermalSeparation.HeatAndMassTransfer.RandomPackedColumn.Vapour;
 model Constant "constant value for k"
- // extends ThermalSeparation.FilmModel.BaseClasses.PackedColumn.BaseMSVapour;
-extends BaseVapMT;
+ // extends ThermalSeparation.FilmModel.BaseClasses.PackedColumn.BaseMSVapour;
+  extends BaseVapMT;
   parameter ThermalSeparation.Units.CoefficentOfMassTransfer k_v_const=
                                                           1e-2
     "mass transfer coefficient for gas";
 
-//Wesselingh: Mass Transfer in Multicomponent Mixtures, p. 52
-//gases: 1e-1 to 1e-2 (for gases in pores, the value can be smaller, for example 5e-3)
-//liquids: 1e-4 to 1e-5 (for liquids in pores, the value can be smaller, for example 1e-6)
+//Wesselingh: Mass Transfer in Multicomponent Mixtures, p. 52
+  //gases: 1e-1 to 1e-2 (for gases in pores, the value can be smaller, for example 5e-3)
+  //liquids: 1e-4 to 1e-5 (for liquids in pores, the value can be smaller, for example 1e-6)
 equation
-
-    // Werte belegen, damit das System nicht singulÃ¤r wird:
-//   Re[:]=fill(0,n);
-//   Sc[:,:]=fill(0,n,a);
-//   Sh[:,:]=fill(0,n,a);
+// Werte belegen, damit das System nicht singulÃ¤r wird:
+//   Re[:]=fill(0,n);
+//   Sc[:,:]=fill(0,n,a);
+//   Sh[:,:]=fill(0,n,a);
     for j in 1:n loop
     k[j,:] = fill(k_v_const,n_k);
   end for;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/SprayColumn/Vapour.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/SprayColumn/Vapour.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/SprayColumn/Vapour.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/SprayColumn/Vapour.mo"	2022-03-10 09:58:35.604151424 +0000
@@ -1,21 +1,20 @@
-ï»¿within ThermalSeparation.HeatAndMassTransfer.SprayColumn;
+within ThermalSeparation.HeatAndMassTransfer.SprayColumn;
 package Vapour
   model Constant "constant value for k"
-   // extends ThermalSeparation.FilmModel.BaseClasses.SprayColumn.BaseMSVapour;
+   // extends ThermalSeparation.FilmModel.BaseClasses.SprayColumn.BaseMSVapour;
   extends BaseVapMT;
     parameter ThermalSeparation.Units.CoefficentOfMassTransfer k_v_const=
                                                             1e-2
       "mass transfer coefficient for gas";
 
-  //Wesselingh: Mass Transfer in Multicomponent Mixtures, p. 52
-  //gases: 1e-1 to 1e-2 (for gases in pores, the value can be smaller, for example 5e-3)
-  //liquids: 1e-4 to 1e-5 (for liquids in pores, the value can be smaller, for example 1e-6)
+//Wesselingh: Mass Transfer in Multicomponent Mixtures, p. 52
+  //gases: 1e-1 to 1e-2 (for gases in pores, the value can be smaller, for example 5e-3)
+  //liquids: 1e-4 to 1e-5 (for liquids in pores, the value can be smaller, for example 1e-6)
   equation
-
-      // Werte belegen, damit das System nicht singulÃ¤r wird:
-  //   Re[:]=fill(0,n);
-  //   Sc[:,:]=fill(0,n,a);
-  //   Sh[:,:]=fill(0,n,a);
+// Werte belegen, damit das System nicht singulÃ¤r wird:
+//   Re[:]=fill(0,n);
+//   Sc[:,:]=fill(0,n,a);
+//   Sh[:,:]=fill(0,n,a);
       for j in 1:n loop
       k[j,:] = fill(k_v_const,n_k);
     end for;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/StructuredPackedColumn/Vapour/Constant.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/StructuredPackedColumn/Vapour/Constant.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/StructuredPackedColumn/Vapour/Constant.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/StructuredPackedColumn/Vapour/Constant.mo"	2022-03-10 09:58:35.524151413 +0000
@@ -1,20 +1,19 @@
-ï»¿within ThermalSeparation.HeatAndMassTransfer.StructuredPackedColumn.Vapour;
+within ThermalSeparation.HeatAndMassTransfer.StructuredPackedColumn.Vapour;
 model Constant "constant value for k"
- // extends ThermalSeparation.FilmModel.BaseClasses.PackedColumn.BaseMSVapour;
-extends BaseVapMT;
+ // extends ThermalSeparation.FilmModel.BaseClasses.PackedColumn.BaseMSVapour;
+  extends BaseVapMT;
   parameter ThermalSeparation.Units.CoefficentOfMassTransfer k_v_const=
                                                           1e-2
     "mass transfer coefficient for gas";
 
-//Wesselingh: Mass Transfer in Multicomponent Mixtures, p. 52
-//gases: 1e-1 to 1e-2 (for gases in pores, the value can be smaller, for example 5e-3)
-//liquids: 1e-4 to 1e-5 (for liquids in pores, the value can be smaller, for example 1e-6)
+//Wesselingh: Mass Transfer in Multicomponent Mixtures, p. 52
+  //gases: 1e-1 to 1e-2 (for gases in pores, the value can be smaller, for example 5e-3)
+  //liquids: 1e-4 to 1e-5 (for liquids in pores, the value can be smaller, for example 1e-6)
 equation
-
-    // Werte belegen, damit das System nicht singulÃ¤r wird:
-//   Re[:]=fill(0,n);
-//   Sc[:,:]=fill(0,n,a);
-//   Sh[:,:]=fill(0,n,a);
+// Werte belegen, damit das System nicht singulÃ¤r wird:
+//   Re[:]=fill(0,n);
+//   Sc[:,:]=fill(0,n,a);
+//   Sh[:,:]=fill(0,n,a);
     for j in 1:n loop
     k[j,:] = fill(k_v_const,n_k);
   end for;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/ThermodynamicFactorLiq/NRTLBinary.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/ThermodynamicFactorLiq/NRTLBinary.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/ThermodynamicFactorLiq/NRTLBinary.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/ThermodynamicFactorLiq/NRTLBinary.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -1,6 +1,6 @@
 within ThermalSeparation.HeatAndMassTransfer.ThermodynamicFactorLiq;
 model NRTLBinary
-  //nur zur Überprüfung von NRTLMulticomponent
+  //nur zur ÃœberprÃ¼fung von NRTLMulticomponent
   parameter Integer n=3;
   parameter Real x[3,2]={{0.8,0.2},{0.2,0.8},{0.5,0.5}};
   output Real Gamma[n];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/ThermodynamicFactorLiq/UniquacBinary.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/ThermodynamicFactorLiq/UniquacBinary.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/ThermodynamicFactorLiq/UniquacBinary.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/ThermodynamicFactorLiq/UniquacBinary.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -1,6 +1,6 @@
 within ThermalSeparation.HeatAndMassTransfer.ThermodynamicFactorLiq;
 model UniquacBinary
-//nur zur Überprüfung von UNIQUACMulticomponent
+//nur zur ÃœberprÃ¼fung von UNIQUACMulticomponent
 
   parameter Integer n = 1;
   parameter Integer nS= 2;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/TrayColumn/Vapour/Const_K.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/TrayColumn/Vapour/Const_K.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/TrayColumn/Vapour/Const_K.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/TrayColumn/Vapour/Const_K.mo"	2022-03-10 09:58:35.416151400 +0000
@@ -1,20 +1,20 @@
-ï»¿within ThermalSeparation.HeatAndMassTransfer.TrayColumn.Vapour;
+within ThermalSeparation.HeatAndMassTransfer.TrayColumn.Vapour;
 model Const_K
- // extends ThermalSeparation.FilmModel.BaseClasses.TrayColumn.BaseMSVapour;
-extends BaseVapMT;
+ // extends ThermalSeparation.FilmModel.BaseClasses.TrayColumn.BaseMSVapour;
+  extends BaseVapMT;
   parameter ThermalSeparation.Units.CoefficentOfMassTransfer k_v_const=
                                                           1e-3
     "mass transfer coefficient for gas";
 
-//Wesselingh: Mass Transfer in Multicomponent Mixtures, p. 52
-//gases: 1e-1 to 1e-2 (for gases in pores, the value can be smaller, for example 5e-3)
-//liquids: 1e-4 to 1e-5 (for liquids in pores, the value can be smaller, for example 1e-6)
-  //1e-4, 1e-2
+//Wesselingh: Mass Transfer in Multicomponent Mixtures, p. 52
+  //gases: 1e-1 to 1e-2 (for gases in pores, the value can be smaller, for example 5e-3)
+  //liquids: 1e-4 to 1e-5 (for liquids in pores, the value can be smaller, for example 1e-6)
+  //1e-4, 1e-2
 equation
-    // Werte belegen, damit das System nicht singulÃ¤r wird:
-//   Re[:]=fill(0,n);
-//   Sc[:,:]=fill(0,n,a);
-//   Sh[:,:]=fill(0,n,a);
+// Werte belegen, damit das System nicht singulÃ¤r wird:
+//   Re[:]=fill(0,n);
+//   Sc[:,:]=fill(0,n,a);
+//   Sh[:,:]=fill(0,n,a);
   for j in 1:n loop
 
     k[j,:] = fill(k_v_const,n_k);
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/TrayColumn/Vapour/Stichlmair.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/TrayColumn/Vapour/Stichlmair.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/TrayColumn/Vapour/Stichlmair.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/TrayColumn/Vapour/Stichlmair.mo"	2022-03-10 09:58:35.412151400 +0000
@@ -1,6 +1,6 @@
-ï»¿within ThermalSeparation.HeatAndMassTransfer.TrayColumn.Vapour;
+within ThermalSeparation.HeatAndMassTransfer.TrayColumn.Vapour;
 model Stichlmair
-  //extends ThermalSeparation.FilmModel.BaseClasses.TrayColumn.BaseMSVapour;
+  //extends ThermalSeparation.FilmModel.BaseClasses.TrayColumn.BaseMSVapour;
   extends BaseVapMT;
 //Stichlmair: Grundlagen der Dimensionierung des Gas/FlÃ¼ssigkeit-Kontaktapparates Bodenkolonne, Weinheim, NY: Verlag Chemie, 1978, p. 142
 equation
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/package.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/HeatAndMassTransfer/package.mo"	2022-03-10 09:58:35.832151452 +0000
@@ -1,7 +1,8 @@
 within ThermalSeparation;
 package HeatAndMassTransfer "Models for the Heat and Mass Transfer"
       extends Icons.Library.Orange;
-  import SI = Modelica.SIunits;
+  import Modelica.Units.SI;
+
 
 
   annotation(preferedView="info", Documentation(revisions="<html>
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/RandomPackedColumn/NoOutflow.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/RandomPackedColumn/NoOutflow.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/RandomPackedColumn/NoOutflow.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/RandomPackedColumn/NoOutflow.mo"	2022-03-10 09:58:35.392151396 +0000
@@ -1,9 +1,9 @@
-ï»¿within ThermalSeparation.Holdup.RandomPackedColumn;
+within ThermalSeparation.Holdup.RandomPackedColumn;
 model NoOutflow "sump: no liquid flowing out"
   extends ThermalSeparation.Holdup.RandomPackedColumn.BaseHoldup;
-  //Rocha, Bravo, Fair: Distillation Columns Containing Structured Packings: A Comprehensive Model for Their Performance 1. Hydraulic Models, Ind. Eng. Chem. Res., 1993, 32, 641-651
-  //only for structured packings
-parameter Boolean hu_stat_const = true
+  //Rocha, Bravo, Fair: Distillation Columns Containing Structured Packings: A Comprehensive Model for Their Performance 1. Hydraulic Models, Ind. Eng. Chem. Res., 1993, 32, 641-651
+  //only for structured packings
+  parameter Boolean hu_stat_const = true
     "true, if a constant value for static holdup is to be used";
 parameter Real hu_stat_user = 0.02 annotation(Dialog(enable=hu_stat_const));
 parameter Real scf_stat = 0.01
@@ -41,13 +41,13 @@
       hu_stat[j] = hu_stat_user;
     else
       hu_stat[j] = (2*sigma_l[j]*(1-geometry.cos_gamma)/(rho_l[j]*Modelica.Constants.g_n*(1-rho_v2[j]/rho_l[j])*sin_theta))^0.5 *4/geometry.S*0.01;
-    end if;
+    end if;
+//der Term mit K1 wird vernachlÃ¤ssigt, der Term wird sowieso erst wichtig, wenn deltaP/deltaZ nahe am Wert von (deltaP/deltaZ)_flood ist
+    b[j] = 1 - rho_v[j] / rho_l[j];
+//- K1[j]*deltaP[j]/deltaZ/(rho_l[j]* Modelica.Constants.g_n);
+    c[j] = (rho_l[j] / (sigma_l[j] * Modelica.Constants.g_n)) ^ 0.15 * (eta_l[j] / (geometry.S * rho_l[j])) ^ 0.2 * (3 * eta_l[j]) ^ 0.5;
 
-//der Term mit K1 wird vernachlÃ¤ssigt, der Term wird sowieso erst wichtig, wenn deltaP/deltaZ nahe am Wert von (deltaP/deltaZ)_flood ist
-b[j] = 1-rho_v[j]/rho_l[j];//- K1[j]*deltaP[j]/deltaZ/(rho_l[j]* Modelica.Constants.g_n);
-c[j] = (rho_l[j]/(sigma_l[j]*Modelica.Constants.g_n))^0.15 * (eta_l[j]/(geometry.S*rho_l[j]))^0.2 * (3*eta_l[j])^0.5;
-
-Vdot[j] =0;// max(0,sign(hu_dyn[j]) * (abs(hu_dyn[j])/(a*c[j]*frickel_dyn)*(rho_l[j]*geometry.eps*eps_liq[j]*Modelica.Constants.g_n*b[j]*sin_theta)^0.5)^(1/0.9) * geometry.A);
+Vdot[j] =0;    // max(0,sign(hu_dyn[j]) * (abs(hu_dyn[j])/(a*c[j]*frickel_dyn)*(rho_l[j]*geometry.eps*eps_liq[j]*Modelica.Constants.g_n*b[j]*sin_theta)^0.5)^(1/0.9) * geometry.A);
 
 end for;
   annotation (Documentation(info="<html>
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/SprayColumn.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/SprayColumn.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/SprayColumn.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/SprayColumn.mo"	2022-03-10 09:58:35.372151394 +0000
@@ -1,63 +1,58 @@
-ï»¿within ThermalSeparation.Holdup;
-package SprayColumn
-  partial model BaseHoldup
-    parameter Integer n(min=1) annotation(Dialog(enable=false));
-    parameter Boolean constProp = false
-      "constant values for density and surface tension";
-    parameter SI.Density rho_l_const = 1000 "constant value for liquid density" annotation(Dialog(enable = constProp));
-    parameter SI.Density rho_v_const = 2 "constant value for vapour density" annotation(Dialog(enable = constProp));
-    parameter SI.DynamicViscosity eta_v_const = 0.075
-      "constant value for surface tension"                                               annotation(Dialog(enable = constProp));
-    input SI.Density rho_l[n];
-    input SI.Density rho_v[n];
-    input SI.DynamicViscosity eta_v[n];
-    input SI.VolumeFlowRate Vdot_v[n];
-    input Real eps_liq[n];
-    input SI.VolumeFlowRate Vdot_l_in;
-    output SI.VolumeFlowRate Vdot[n];
-    output SI.Diameter d_drop[n](start=1e-3*ones(n));
-    output Real n_drop[n](start=1*ones(n));
-
-    replaceable record Geometry =
-        ThermalSeparation.Geometry.SprayColumn.Geometry;
-    Geometry geometry(n=n);
-
-    SI.Density rho_liq[n] = if constProp then fill(rho_l_const,n) else rho_l;
-    SI.Density rho_vap[n] = if constProp then fill(rho_v_const,n) else rho_v;
-    SI.DynamicViscosity eta_vap[n] = if constProp then fill(eta_v_const,n) else eta_v;
-  equation
-
-  end BaseHoldup;
-
-  model IdealDroplets
-    extends BaseHoldup;
-    parameter SI.Diameter d_drop_in=0.5e-3 "droplet diameter at liquid inlet";
-  protected
-    SI.Velocity c_rel[n](start=0*ones(n));
-    SI.Velocity c_drop[n](start=ones(n));
-    SI.Velocity c_vapour[n];
-    Real zeta[n](start=ones(n));
-    Real Re[n](start=100*ones(n));
-
-  equation
-    for j in 1:n loop
-
-   // c_rel[j] =  min(200,sqrt(max(1e-5,(1-rho_v[j]/rho_l[j])*Modelica.Constants.g_n*4/3 / zeta[j] * rho_l[j]/rho_v[j] * d_drop[j])));
-  c_rel[j] = ((1-rho_vap[j]/rho_liq[j])*Modelica.Constants.g_n*4/3 / 24 / max(1e-8,eta_vap[j])* rho_liq[j])^3*(geometry.A*eps_liq[j]/max(2e-5,Vdot_l_in) *d_drop_in^3)^2;
-  /*** fÃ¼r Gleichstrom: ***/
-   // c_drop[j] = max(0,abs(Vdot_v[j])/geometry.A + c_rel[j]);
-  /*** fÃ¼r Gegenstrom: ***/
-  c_drop[j] = max(0, c_rel[j] - abs(Vdot_v[j]/geometry.A));
-    c_vapour[j] = abs(Vdot_v[j])/geometry.A;
-    d_drop[j] = (geometry.A * geometry.H/n * eps_liq[j] / max(1e-5,n_drop[j]) *6 /Modelica.Constants.pi)^(1/3);
-    Re[j] =  max(1e-5,c_rel[j] * d_drop[j]/eta_vap[j]*rho_vap[j]);
-    zeta[j] = 24/Re[j];
-  //  zeta[j] = 24/Re[j] + 3.73/Re[j]^0.5 - 4.82e-3*Re[j]^0.5/(1 + 3e-6*Re[j]^1.5) + 0.49;
-     n_drop[j] = Vdot_l_in *6/Modelica.Constants.pi/d_drop_in^3*geometry.H/n/max(1e-5,c_drop[1]);
-
-     Vdot[j] = c_drop[j]*geometry.A * eps_liq[j];
-
-  end for;
-
-  end IdealDroplets;
-end SprayColumn;
+within ThermalSeparation.Holdup;
+
+package SprayColumn
+  partial model BaseHoldup
+    parameter Integer n(min = 1) annotation(
+      Dialog(enable = false));
+    parameter Boolean constProp = false "constant values for density and surface tension";
+    parameter SI.Density rho_l_const = 1000 "constant value for liquid density" annotation(
+      Dialog(enable = constProp));
+    parameter SI.Density rho_v_const = 2 "constant value for vapour density" annotation(
+      Dialog(enable = constProp));
+    parameter SI.DynamicViscosity eta_v_const = 0.075 "constant value for surface tension" annotation(
+      Dialog(enable = constProp));
+    input SI.Density rho_l[n];
+    input SI.Density rho_v[n];
+    input SI.DynamicViscosity eta_v[n];
+    input SI.VolumeFlowRate Vdot_v[n];
+    input Real eps_liq[n];
+    input SI.VolumeFlowRate Vdot_l_in;
+    output SI.VolumeFlowRate Vdot[n];
+    output SI.Diameter d_drop[n](start = 1e-3 * ones(n));
+    output Real n_drop[n](start = 1 * ones(n));
+    replaceable record Geometry = ThermalSeparation.Geometry.SprayColumn.Geometry;
+    Geometry geometry(n = n);
+    SI.Density rho_liq[n] = if constProp then fill(rho_l_const, n) else rho_l;
+    SI.Density rho_vap[n] = if constProp then fill(rho_v_const, n) else rho_v;
+    SI.DynamicViscosity eta_vap[n] = if constProp then fill(eta_v_const, n) else eta_v;
+  equation
+
+  end BaseHoldup;
+
+  model IdealDroplets
+    extends BaseHoldup;
+    parameter SI.Diameter d_drop_in = 0.5e-3 "droplet diameter at liquid inlet";
+  protected
+    SI.Velocity c_rel[n](start = 0 * ones(n));
+    SI.Velocity c_drop[n](start = ones(n));
+    SI.Velocity c_vapour[n];
+    Real zeta[n](start = ones(n));
+    Real Re[n](start = 100 * ones(n));
+  equation
+    for j in 1:n loop
+// c_rel[j] =  min(200,sqrt(max(1e-5,(1-rho_v[j]/rho_l[j])*Modelica.Constants.g_n*4/3 / zeta[j] * rho_l[j]/rho_v[j] * d_drop[j])));
+      c_rel[j] = ((1 - rho_vap[j] / rho_liq[j]) * Modelica.Constants.g_n * 4 / 3 / 24 / max(1e-8, eta_vap[j]) * rho_liq[j]) ^ 3 * (geometry.A * eps_liq[j] / max(2e-5, Vdot_l_in) * d_drop_in ^ 3) ^ 2;
+/*** fÃ¼r Gleichstrom: ***/
+// c_drop[j] = max(0,abs(Vdot_v[j])/geometry.A + c_rel[j]);
+/*** fÃ¼r Gegenstrom: ***/
+      c_drop[j] = max(0, c_rel[j] - abs(Vdot_v[j] / geometry.A));
+      c_vapour[j] = abs(Vdot_v[j]) / geometry.A;
+      d_drop[j] = (geometry.A * geometry.H / n * eps_liq[j] / max(1e-5, n_drop[j]) * 6 / Modelica.Constants.pi) ^ (1 / 3);
+      Re[j] = max(1e-5, c_rel[j] * d_drop[j] / eta_vap[j] * rho_vap[j]);
+      zeta[j] = 24 / Re[j];
+//  zeta[j] = 24/Re[j] + 3.73/Re[j]^0.5 - 4.82e-3*Re[j]^0.5/(1 + 3e-6*Re[j]^1.5) + 0.49;
+      n_drop[j] = Vdot_l_in * 6 / Modelica.Constants.pi / d_drop_in ^ 3 * geometry.H / n / max(1e-5, c_drop[1]);
+      Vdot[j] = c_drop[j] * geometry.A * eps_liq[j];
+    end for;
+  end IdealDroplets;
+end SprayColumn;
\ No newline at end of file
Only in converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup: SprayColumn.mo.after
Only in converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup: SprayColumn.mo.before
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/StructuredPackedColumn/NoOutflow.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/StructuredPackedColumn/NoOutflow.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/StructuredPackedColumn/NoOutflow.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/StructuredPackedColumn/NoOutflow.mo"	2022-03-10 09:58:35.344151391 +0000
@@ -1,9 +1,9 @@
-ï»¿within ThermalSeparation.Holdup.StructuredPackedColumn;
+within ThermalSeparation.Holdup.StructuredPackedColumn;
 model NoOutflow "sump: no liquid flowing out"
   extends ThermalSeparation.Holdup.StructuredPackedColumn.BaseHoldup;
-  //Rocha, Bravo, Fair: Distillation Columns Containing Structured Packings: A Comprehensive Model for Their Performance 1. Hydraulic Models, Ind. Eng. Chem. Res., 1993, 32, 641-651
-  //only for structured packings
-parameter Boolean hu_stat_const = true
+  //Rocha, Bravo, Fair: Distillation Columns Containing Structured Packings: A Comprehensive Model for Their Performance 1. Hydraulic Models, Ind. Eng. Chem. Res., 1993, 32, 641-651
+  //only for structured packings
+  parameter Boolean hu_stat_const = true
     "true, if a constant value for static holdup is to be used";
 parameter Real hu_stat_user = 0.02 annotation(Dialog(enable=hu_stat_const));
 parameter Real scf_stat = 0.01
@@ -41,13 +41,13 @@
       hu_stat[j] = hu_stat_user;
     else
       hu_stat[j] = (2*sigma_l[j]*(1-geometry.cos_gamma)/(rho_l[j]*Modelica.Constants.g_n*(1-rho_v2[j]/rho_l[j])*sin_theta))^0.5 *4/geometry.S*0.01;
-    end if;
+    end if;
+//der Term mit K1 wird vernachlÃ¤ssigt, der Term wird sowieso erst wichtig, wenn deltaP/deltaZ nahe am Wert von (deltaP/deltaZ)_flood ist
+    b[j] = 1 - rho_v[j] / rho_l[j];
+//- K1[j]*deltaP[j]/deltaZ/(rho_l[j]* Modelica.Constants.g_n);
+    c[j] = (rho_l[j] / (sigma_l[j] * Modelica.Constants.g_n)) ^ 0.15 * (eta_l[j] / (geometry.S * rho_l[j])) ^ 0.2 * (3 * eta_l[j]) ^ 0.5;
 
-//der Term mit K1 wird vernachlÃ¤ssigt, der Term wird sowieso erst wichtig, wenn deltaP/deltaZ nahe am Wert von (deltaP/deltaZ)_flood ist
-b[j] = 1-rho_v[j]/rho_l[j];//- K1[j]*deltaP[j]/deltaZ/(rho_l[j]* Modelica.Constants.g_n);
-c[j] = (rho_l[j]/(sigma_l[j]*Modelica.Constants.g_n))^0.15 * (eta_l[j]/(geometry.S*rho_l[j]))^0.2 * (3*eta_l[j])^0.5;
-
-Vdot[j] =0;// max(0,sign(hu_dyn[j]) * (abs(hu_dyn[j])/(a*c[j]*frickel_dyn)*(rho_l[j]*geometry.eps*eps_liq[j]*Modelica.Constants.g_n*b[j]*sin_theta)^0.5)^(1/0.9) * geometry.A);
+Vdot[j] =0;    // max(0,sign(hu_dyn[j]) * (abs(hu_dyn[j])/(a*c[j]*frickel_dyn)*(rho_l[j]*geometry.eps*eps_liq[j]*Modelica.Constants.g_n*b[j]*sin_theta)^0.5)^(1/0.9) * geometry.A);
 
 end for;
   annotation (Documentation(info="<html>
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/StructuredPackedColumn/Rocha.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/StructuredPackedColumn/Rocha.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/StructuredPackedColumn/Rocha.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/StructuredPackedColumn/Rocha.mo"	2022-03-10 09:58:35.336151391 +0000
@@ -1,9 +1,9 @@
-ï»¿within ThermalSeparation.Holdup.StructuredPackedColumn;
+within ThermalSeparation.Holdup.StructuredPackedColumn;
 model Rocha "correlation from Rocha"
   extends ThermalSeparation.Holdup.StructuredPackedColumn.BaseHoldup;
-  //Rocha, Bravo, Fair: Distillation Columns Containing Structured Packings: A Comprehensive Model for Their Performance 1. Hydraulic Models, Ind. Eng. Chem. Res., 1993, 32, 641-651
-  //only for structured packings
-parameter Boolean hu_stat_const = true
+  //Rocha, Bravo, Fair: Distillation Columns Containing Structured Packings: A Comprehensive Model for Their Performance 1. Hydraulic Models, Ind. Eng. Chem. Res., 1993, 32, 641-651
+  //only for structured packings
+  parameter Boolean hu_stat_const = true
     "true, if a constant value for static holdup is to be used";
 parameter Real hu_stat_user = 0.02 annotation(Dialog(enable=hu_stat_const));
 parameter Real scf_stat = 0.01
@@ -43,10 +43,10 @@
       hu_stat[j] = (2*sigma_l[j]*(1-geometry.cos_gamma)/(rho_l[j]*Modelica.Constants.g_n*(1-rho_v2[j]/rho_l[j])*sin_theta))^0.5 *4/geometry.S*0.01;
     end if;
 
-  deltaP[j] =50;// p_v[j+1]-p_v[j];
-
-//der Term mit K1 wird vernachlÃ¤ssigt, der Term wird sowieso erst wichtig, wenn deltaP/deltaZ nahe am Wert von (deltaP/deltaZ)_flood ist
-b[j] = 1-rho_v[j]/rho_l[j]- K1[j]*deltaP[j]/deltaZ/(rho_l[j]* Modelica.Constants.g_n);
+  deltaP[j] =50;
+// p_v[j+1]-p_v[j];
+//der Term mit K1 wird vernachlÃ¤ssigt, der Term wird sowieso erst wichtig, wenn deltaP/deltaZ nahe am Wert von (deltaP/deltaZ)_flood ist
+    b[j] = 1-rho_v[j]/rho_l[j]- K1[j]*deltaP[j]/deltaZ/(rho_l[j]* Modelica.Constants.g_n);
 c[j] = (rho_l[j]/(sigma_l[j]*Modelica.Constants.g_n))^0.15 * (eta_l[j]/(geometry.S*rho_l[j]))^0.2 * (3*eta_l[j])^0.5;
 
 Vdot[j] = max(0,sign(hu_dyn[j]) * (abs(hu_dyn[j])/(a*c[j]*frickel_dyn)*(rho_l[j]*geometry.eps*eps_liq[j]*Modelica.Constants.g_n*b[j]*sin_theta)^0.5)^(1/0.9) * geometry.A);
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/TrayColumn.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/TrayColumn.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/TrayColumn.mo"	2022-03-10 09:57:37.916144115 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Holdup/TrayColumn.mo"	2022-03-10 09:58:35.320151388 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Holdup;
+within ThermalSeparation.Holdup;
 package TrayColumn
   partial model BaseHoldup
     parameter Integer n(min=1) annotation(Dialog(enable = false));
@@ -37,7 +37,7 @@
   model Stichlmair "Stichlmair"
     extends BaseHoldup;
 
-      //minimum and maximum vapour load
+//minimum and maximum vapour load
     parameter ThermalSeparation.Units.F_Factor F_max_const = 1
       "guess initial max. vapour load";
      parameter ThermalSeparation.Units.F_Factor F_const = 0.2
@@ -93,7 +93,7 @@
     "Stichlmair simplified - without vapour in liquid regime"
     extends BaseHoldup;
 
-      //minimum and maximum vapour load
+//minimum and maximum vapour load
     parameter ThermalSeparation.Units.F_Factor F_max_const = 1
       "guess initial max. vapour load";
      parameter ThermalSeparation.Units.F_Factor F_const = 0.2
@@ -115,7 +115,8 @@
   equation
   for j in 1:n loop
   /*** during startUp there is no, or nearly no vapour in the liquid on the stage, since all vapour is condensing directly ***/
-      eps_liq_2ph[j] =1;// 0.99*(1-omega[j])+  max(1e-5,1 - (F[j]/F_max[j])^0.28)*omega[j];
+      eps_liq_2ph[j] =1;
+// 0.99*(1-omega[j])+  max(1e-5,1 - (F[j]/F_max[j])^0.28)*omega[j];
       F_max[j] =  F_max_corr[j]*aux_F + F_max_const*(1-aux_F);
       F_max_corr[j] =  2.5 * ((geometry.phi)^2 * sigma_liq[j]*(rho_liq[j] - rho_vap[j])*Modelica.Constants.g_n)^(1/4);
       F[j] = F_corr[j]*aux_F + F_const *(1-aux_F);
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Icons/Color.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Icons/Color.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Icons/Color.mo"	2022-03-10 09:57:37.920144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Icons/Color.mo"	2022-03-10 09:58:35.292151385 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Icons;
+within ThermalSeparation.Icons;
 package Color
   model HeatExchanger
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Interfaces/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Interfaces/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Interfaces/package.mo"	2022-03-10 09:57:37.924144116 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Interfaces/package.mo"	2022-03-10 09:58:34.672151305 +0000
@@ -1,6 +1,7 @@
 within ThermalSeparation;
 package Interfaces "Connector Classes"
-import SI = Modelica.SIunits;
+import Modelica.Units.SI;
+
 
 
 annotation(preferedView="info");
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/BaseMediumLiquid.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/BaseMediumLiquid.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/BaseMediumLiquid.mo"	2022-03-10 09:57:37.924144116 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/BaseMediumLiquid.mo"	2022-03-10 09:58:34.620151299 +0000
@@ -52,13 +52,13 @@
   output ThermalSeparation.Media.Types.Density d "Density of medium";
 
   output ThermalSeparation.Media.Types.MolarMass MM "Molar mass of mixture";
-  output SI.MolarVolume v(start=1e-5,stateSelect=StateSelect.never); //unit: m3/mol
+  output SI.MolarVolume v(start=1e-5,stateSelect=StateSelect.never);     //unit: m3/mol
   output SI.ThermalConductivity lambda;
   output SI.SpecificHeatCapacity cp;
 
-    //dynamic viscosity for each component in the liquid phase
-  //if a pure component does not exist as liquid at system pressure and temperature any value can be given
-  //as long as the corresponding entry in the constant eta_pure is false
+//dynamic viscosity for each component in the liquid phase
+    //if a pure component does not exist as liquid at system pressure and temperature any value can be given
+    //as long as the corresponding entry in the constant eta_pure is false
   output SI.DynamicViscosity eta_comp[nSubstance];
 
   /*** for feed stage ***/
@@ -91,7 +91,8 @@
             extent={{-102,100},{98,-100}},
             lineColor={0,0,255},
             fillColor={255,255,255},
-            fillPattern=FillPattern.Solid)}));
+            fillPattern=FillPattern.Solid)}));
+
 end BaseProperties;
 
 replaceable partial model ActivityCoefficient
@@ -153,13 +154,13 @@
    input SI.DynamicViscosity eta[nSubstance]
       "viscosity of pure liquid at system pressure and temperature";
 
-   // Diffusion coefficents in the following form: D12, D13, D14, D23, D24, D34
-   // the numbers correspond to the ordering of the substances
+// Diffusion coefficents in the following form: D12, D13, D14, D23, D24, D34
+    // the numbers correspond to the ordering of the substances
    output SI.DiffusionCoefficient D[a](start=fill(1e-5,a)) "Maxwell-Stefan diffusion coefficients";
    output SI.DiffusionCoefficient D_matrix[nSubstance,nSubstance]
       "Maxwell-Stefan diffusion coefficients in matrix form, where D_12 = D_21";
 
-   //for diluted systems:
+//for diluted systems:
    parameter Boolean diluted = false
       "system is diluted: if the variable diluted is set to true, the extending class must supply an equation for D_diluted";
    parameter Integer solvent = 1 "index of solvent for diluted systems";
@@ -176,21 +177,21 @@
         "dummy values for the variable D_diluted; not to be used";
  end if;
 
-     for i in 1:nSubstance loop
-       for m in i:nSubstance loop
-         if i==m then
-           //dummy values for entries on the diagonal, since they are never used
-           //To Do: put self-diffusion coefficients here
-           D_matrix[i,m] = 10;
-         else
-           //entries of vector D are put on the right place in the matrix
-           D_matrix[i,m] = D[m-2+i];
-           end if;
-         end for;
-         for m in 1:i-1 loop
-           //D_12 = D_21, D_13 = D_31 etc.
-           D_matrix[i,m] = D_matrix[m,i];
-         end for;
+     for i in 1:nSubstance loop
+ for m in i:nSubstance loop
+        if i == m then
+//dummy values for entries on the diagonal, since they are never used
+//To Do: put self-diffusion coefficients here
+          D_matrix[i, m] = 10;
+        else
+//entries of vector D are put on the right place in the matrix
+          D_matrix[i, m] = D[m - 2 + i];
+        end if;
+      end for;
+ for m in 1:i - 1 loop
+//D_12 = D_21, D_13 = D_31 etc.
+        D_matrix[i, m] = D_matrix[m, i];
+      end for;
      end for;
 
   annotation (Icon(graphics={
@@ -198,7 +199,8 @@
           extent={{-100,100},{100,-100}},
           lineColor={0,0,255},
           fillColor={255,255,255},
-          fillPattern=FillPattern.Solid)}));
+          fillPattern=FillPattern.Solid)}));
+
 end DiffusionCoefficient;
 
   replaceable model SaturationPressure
@@ -254,7 +256,7 @@
 
   ThermalSeparation.Media.Types.MolarMass MM
       "Molar mass (of mixture or single fluid)";
-  SI.MolarVolume v(start=1e-5,stateSelect=StateSelect.never); //Einheit: m3/mol
+  SI.MolarVolume v(start=1e-5,stateSelect=StateSelect.never);     //Einheit: m3/mol
   SI.MoleFraction x[nSubstance];
   SI.Density d;
   ThermalSeparation.Units.MolarEnthalpy h;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/C2H5OH_Water_Liq.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/C2H5OH_Water_Liq.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/C2H5OH_Water_Liq.mo"	2022-03-10 09:57:37.924144116 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/C2H5OH_Water_Liq.mo"	2022-03-10 09:58:34.564151292 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Media;
+within ThermalSeparation.Media;
 package C2H5OH_Water_Liq "2 components: C2H5OH, H2O"
   extends BaseMediumLiquid(has_etaSubstance={true,true}, nSubstance=2, Tcrit= {513.9, 647.3}, pcrit= {61.48e5, 2.2064e7}, Vcrit = {167.00e-6, 55.95e-6},omega = { 0.037,
  0.022}, mu = {1.7, 1.8}, MMX= {0.046,0.018}, eq_Tsonopoulos = {4, 6}, henry=fill(false,nSubstance));
@@ -28,15 +28,16 @@
     constant Real IPSTAR=1.0e-6
       "normalization pressure for inverse function in region 2 IF97";
 
-  constant SI.DynamicViscosity sigma_EtOH=0.02255;// bei 20 Â°C N/m
-  constant SI.DynamicViscosity sigma_H2O=0.0728;// bei 20 Â°C N/m
-
+  constant SI.DynamicViscosity sigma_EtOH=0.02255;
+  // bei 20 Â°C N/m
+  constant SI.DynamicViscosity sigma_H2O=0.0728;
+  // bei 20 Â°C N/m
   Real MM_min;
   Real MM_var;
   SI.MassFraction w[n](start=fill(0.03,n));
 
      CalcSpecificEnthalpy calcSpecificEnthalpy(T0=T0, p=p, T=T, x=x);
-  //Real lambda;
+  //Real lambda;
   Real lambda_EtOH = 0.155;
   Real lambda_H2O= 0.66;
   /***density and enthalpy ***/
@@ -62,78 +63,80 @@
     MM= MM_var;
     MM_var = max(MM_min,sum(x[j]*MMX[j] for j in 1:n));
 
-    h = calcSpecificEnthalpy.h;//h_Jkg * MM;
-    u = h - p/d*MM;
-    p_sat[1]=10^(8.11220-1592.864/((T-273.15)+226.184))*133.322; // Saturationpressure for Ethanol Perry's Chemical Engineers 13-14 in Pa (T=20-93Â°C)
-    p_sat[2]=10^(8.07131-1730.63/((T-273.15)+233.426))*133.322; // Saturationpressure for Water Perry's Chemical Engineers 13-14 in Pa (T=1-100Â°C)
-
-            /*** density ***/
-            d1=761.2; // bei 50 Â°C aus VDI WÃ¤rmeatlas
-  //     d2 = p/( RH2O * T * pi * gpi);
-  //     pi = p/ PSTAR1;
-  //     gpi = pi1*(pi1*(o[10]*(0.000095038934535162 + o[2]*(
-  //       8.4812393955936e-6 + 2.55615384360309e-9*o[6])) + pi1*(o[12]*(
-  //       8.9701127632000e-6 + (2.60684891582404e-6 + 5.7366919751696e-13*o[13])
-  //       *o[7]) + pi1*(2.02584984300585e-6*o[14] + o[16]*((1.01874413933128e-8
-  //        + 1.39398969845072e-9*o[11])*o[36] + o[19]*(1.44400475720615e-17*o[
-  //       34] + o[15]*(-3.3300108005598e-19*o[32] + o[20]*(-7.6373766822106e-22
-  //       *o[30] + pi1*(3.5842867920213e-22*o[28] + pi1*(-5.6507093202352e-23*o[
-  //       26] + 2.99318679335866e-24*o[24]*pi1))))))))) + o[8]*(
-  //       0.00094368642146534 + o[7]*(0.00060003561586052 + (-0.000095322787813974
-  //        + o[1]*(8.8283690661692e-6 + 1.45389992595188e-15*o[9]))*tau1))) + o[
-  //       5]*(-0.000283190801238040 + o[1]*(0.00060706301565874 + o[6]*(
-  //       0.0189900682184190 + tau1*(0.032529748770505 + (0.0218417171754140 +
-  //       0.000052838357969930*o[1])*tau1))));
-  //     pi1 = 7.1000000000000 - pi;
-  //     tau =  TSTAR1 /T;
-  //     tau1 = -1.22200000000000 + tau;
-  //       o[1] =  tau1*tau1;
-  //   o[2] = o[1]*o[1];
-  //   o[3] = o[2]*o[2];
-  //   o[4] = o[3]*tau1;
-  //   o[5] = 1/o[4];
-  //   o[6] = o[1]*o[2];
-  //   o[7] = o[1]*tau1;
-  //   o[8] = 1/o[7];
-  //   o[9] = o[1]*o[2]*o[3];
-  //   o[10] = 1/o[2];
-  //   o[11] = o[2]*tau1;
-  //   o[12] = 1/o[11];
-  //   o[13] = o[2]*o[3];
-  //   o[14] = 1/o[3];
-  //   o[15] = pi1*pi1;
-  //   o[16] = o[15]*pi1;
-  //   o[17] = o[15]*o[15];
-  //   o[18] = o[17]*o[17];
-  //   o[19] = o[17]*o[18]*pi1;
-  //   o[20] = o[15]*o[17];
-  //   o[21] = o[3]*o[3];
-  //   o[22] = o[21]*o[21];
-  //   o[23] = o[22]*o[3]*tau1;
-  //   o[24] = 1/o[23];
-  //   o[25] = o[22]*o[3];
-  //   o[26] = 1/o[25];
-  //   o[27] = o[1]*o[2]*o[22]*tau1;
-  //   o[28] = 1/o[27];
-  //   o[29] = o[1]*o[2]*o[22];
-  //   o[30] = 1/o[29];
-  //   o[31] = o[1]*o[2]*o[21]*o[3]*tau1;
-  //   o[32] = 1/o[31];
-  //   o[33] = o[2]*o[21]*o[3]*tau1;
-  //   o[34] = 1/o[33];
-  //   o[35] = o[1]*o[3]*tau1;
-  //   o[36] = 1/o[35];
-  //   o[37] = o[1]*o[3];
-  //   o[38] = 1/o[37];
-  //   o[39] = 1/o[6];
-  //   o[40] = o[1]*o[22]*o[3];
-  //   o[41] = 1/o[40];
-  //   o[42] = 1/o[22];
-  //   o[43] = o[1]*o[2]*o[21]*o[3];
-  //   o[44] = 1/o[43];
-  //   o[45] = 1/o[13];
-
-      lambda=x[1]*lambda_EtOH+x[2]*lambda_H2O;
+    h = calcSpecificEnthalpy.h;
+//h_Jkg * MM;
+      u = h - p / d * MM;
+    p_sat[1]=10^(8.11220-1592.864/((T-273.15)+226.184))*133.322;
+// Saturationpressure for Ethanol Perry's Chemical Engineers 13-14 in Pa (T=20-93Â°C)
+      p_sat[2] = 10 ^ (8.07131 - 1730.63 / (T - 273.15 + 233.426)) * 133.322;
+// Saturationpressure for Water Perry's Chemical Engineers 13-14 in Pa (T=1-100Â°C)
+/*** density ***/
+      d1 = 761.2;
+// bei 50 Â°C aus VDI WÃ¤rmeatlas
+//     d2 = p/( RH2O * T * pi * gpi);
+//     pi = p/ PSTAR1;
+//     gpi = pi1*(pi1*(o[10]*(0.000095038934535162 + o[2]*(
+//       8.4812393955936e-6 + 2.55615384360309e-9*o[6])) + pi1*(o[12]*(
+//       8.9701127632000e-6 + (2.60684891582404e-6 + 5.7366919751696e-13*o[13])
+//       *o[7]) + pi1*(2.02584984300585e-6*o[14] + o[16]*((1.01874413933128e-8
+//        + 1.39398969845072e-9*o[11])*o[36] + o[19]*(1.44400475720615e-17*o[
+//       34] + o[15]*(-3.3300108005598e-19*o[32] + o[20]*(-7.6373766822106e-22
+//       *o[30] + pi1*(3.5842867920213e-22*o[28] + pi1*(-5.6507093202352e-23*o[
+//       26] + 2.99318679335866e-24*o[24]*pi1))))))))) + o[8]*(
+//       0.00094368642146534 + o[7]*(0.00060003561586052 + (-0.000095322787813974
+//        + o[1]*(8.8283690661692e-6 + 1.45389992595188e-15*o[9]))*tau1))) + o[
+//       5]*(-0.000283190801238040 + o[1]*(0.00060706301565874 + o[6]*(
+//       0.0189900682184190 + tau1*(0.032529748770505 + (0.0218417171754140 +
+//       0.000052838357969930*o[1])*tau1))));
+//     pi1 = 7.1000000000000 - pi;
+//     tau =  TSTAR1 /T;
+//     tau1 = -1.22200000000000 + tau;
+//       o[1] =  tau1*tau1;
+//   o[2] = o[1]*o[1];
+//   o[3] = o[2]*o[2];
+//   o[4] = o[3]*tau1;
+//   o[5] = 1/o[4];
+//   o[6] = o[1]*o[2];
+//   o[7] = o[1]*tau1;
+//   o[8] = 1/o[7];
+//   o[9] = o[1]*o[2]*o[3];
+//   o[10] = 1/o[2];
+//   o[11] = o[2]*tau1;
+//   o[12] = 1/o[11];
+//   o[13] = o[2]*o[3];
+//   o[14] = 1/o[3];
+//   o[15] = pi1*pi1;
+//   o[16] = o[15]*pi1;
+//   o[17] = o[15]*o[15];
+//   o[18] = o[17]*o[17];
+//   o[19] = o[17]*o[18]*pi1;
+//   o[20] = o[15]*o[17];
+//   o[21] = o[3]*o[3];
+//   o[22] = o[21]*o[21];
+//   o[23] = o[22]*o[3]*tau1;
+//   o[24] = 1/o[23];
+//   o[25] = o[22]*o[3];
+//   o[26] = 1/o[25];
+//   o[27] = o[1]*o[2]*o[22]*tau1;
+//   o[28] = 1/o[27];
+//   o[29] = o[1]*o[2]*o[22];
+//   o[30] = 1/o[29];
+//   o[31] = o[1]*o[2]*o[21]*o[3]*tau1;
+//   o[32] = 1/o[31];
+//   o[33] = o[2]*o[21]*o[3]*tau1;
+//   o[34] = 1/o[33];
+//   o[35] = o[1]*o[3]*tau1;
+//   o[36] = 1/o[35];
+//   o[37] = o[1]*o[3];
+//   o[38] = 1/o[37];
+//   o[39] = 1/o[6];
+//   o[40] = o[1]*o[22]*o[3];
+//   o[41] = 1/o[40];
+//   o[42] = 1/o[22];
+//   o[43] = o[1]*o[2]*o[21]*o[3];
+//   o[44] = 1/o[43];
+//   o[45] = 1/o[13];
+      lambda = x[1] * lambda_EtOH + x[2] * lambda_H2O;
       cp=4000;
 
     annotation (Icon(graphics={
@@ -177,8 +180,8 @@
     parameter Integer nS=2;
   parameter SI.Temperature T = 373.15;
   parameter SI.Pressure p = 100000;
-  parameter SI.MoleFraction x[nS] = {0.3,0.7};//,0.05}};
-
+  parameter SI.MoleFraction x[nS] = {0.3,0.7};
+  //,0.05}};
   BaseProperties BP(
       T=T,
       p=p,
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/C2H5OH_Water_Vap.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/C2H5OH_Water_Vap.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/C2H5OH_Water_Vap.mo"	2022-03-10 09:57:37.924144116 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/C2H5OH_Water_Vap.mo"	2022-03-10 09:58:34.536151288 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Media;
+within ThermalSeparation.Media;
 package C2H5OH_Water_Vap "2 components: C2H5OH, H2O"
  constant SI.Temperature Tcrit_user[nS]= {513.9, 647.3};
 
@@ -26,6 +26,7 @@
        {ThermalSeparation.Media.IdealGasMixtures.BaseClasses.Common.SingleGasesData.C2H5OH,
          ThermalSeparation.Media.IdealGasMixtures.BaseClasses.Common.SingleGasesData.H2O},
                                    R_const=data.R);
+
    redeclare replaceable model extends BaseProperties
 
     CalcSpecificEnthalpy calcSpecificEnthalpy(T0=T0,T=T, x=x, p=p);
@@ -42,7 +43,7 @@
    MM_min=min(MMX);
 
    MM = max(MM_min,sum(x[j]*MMX[j] for j in 1:nS));
-   //d=sum(c.*MMX);
+//d=sum(c.*MMX);
    h = calcSpecificEnthalpy.h + sum(x.*evapEnthalpy.h);
      u = h - Modelica.Constants.R*T;
 
@@ -61,7 +62,8 @@
     parameter Integer nS=2;
   parameter SI.Temperature T = 373.15;
   parameter SI.Pressure p = 100000;
-  parameter SI.MoleFraction x[nS] = {0.3,0.7};//,0.05}};
+  parameter SI.MoleFraction x[nS] = {0.3,0.7};
+ //,0.05}};
   parameter SI.Concentration c[nS]={1,1};
 
   BaseProperties BP(T=T,p=p,x=x,c=c, x_star=x);
@@ -70,31 +72,30 @@
   redeclare replaceable model extends EvaporationEnthalpy
 
   protected
-        constant ThermalSeparation.Units.MolarEnthalpy h_v_H2O =  2382.2e3*MMX[2];// spezifische Verdampfungsenthalpie bei 50Â°C
+        constant ThermalSeparation.Units.MolarEnthalpy h_v_H2O =  2382.2e3*MMX[2];
+ // spezifische Verdampfungsenthalpie bei 50Â°C
            ThermalSeparation.Units.MolarEnthalpy h_v_EtOH;
   equation
       /*** enthalpy ***/
     h[1] = h_v_EtOH;
     h[2] = h_v_H2O;
 
-    h_v_EtOH = (50.43*exp(0.4475*(T/Tcrit_user[1]))*(1-(T/Tcrit_user[1]))^0.4989)*1000;  // J/mol
-
+    h_v_EtOH = (50.43*exp(0.4475*(T/Tcrit_user[1]))*(1-(T/Tcrit_user[1]))^0.4989)*1000;  // J/mol
   end EvaporationEnthalpy;
 
   redeclare replaceable model extends CalcSpecificEnthalpy
 
     /***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
 
-   constant SI.MolarHeatCapacity cp_v_EtOH = 1765*MMX[1]; // J/kgK
+   constant SI.MolarHeatCapacity cp_v_EtOH = 1765*MMX[1];       // J/kgK
     constant SI.MolarHeatCapacity cp_v_H2O = 2027*MMX[2];
     constant SI.MolarHeatCapacity cp_l_EtOH = 2443.48*MMX[1];
     constant SI.MolarHeatCapacity cp_l_H2O = 4187*MMX[2];
-     // constant ThermalSeparation.Units.MolarEnthalpy h_v_H2O =  2382.2e3*MMX[2];// spezifische Verdampfungsenthalpie bei 50Â°C
-
+     // constant ThermalSeparation.Units.MolarEnthalpy h_v_H2O =  2382.2e3*MMX[2];// spezifische Verdampfungsenthalpie bei 50Â°C
       SI.MolarMass MM;
 
-   //  ThermalSeparation.Units.MolarEnthalpy h_v_EtOH;
-
+//  ThermalSeparation.Units.MolarEnthalpy h_v_EtOH;
+   
   protected
          ThermalSeparation.Units.MolarEnthalpy h_l_Jkg;
      ThermalSeparation.Units.MolarEnthalpy h_v_Jkg;
@@ -104,19 +105,18 @@
      ThermalSeparation.Units.MolarEnthalpy h_v_H2O_Jkg;
 
   equation
-    MM = sum(x[j]*MMX[j] for j in 1:nS);
-
-   // h_v_EtOH = (50.43*exp(0.4475*(T/Tcrit_user[1]))*(1-(T/Tcrit_user[1]))^0.4989)*1000;  // J/mol
-
-    h_l_EtOH_Jkg=cp_l_EtOH*(351.5-T0); //T_boil ethanol constant 351.5 K
-  h_l_H2O_Jkg=cp_l_H2O*(373.15-T0);  // T boil water constant 373.15 K
-  h_v_EtOH_Jkg=cp_v_EtOH*(T-351.5);
+    MM = sum(x[j]*MMX[j] for j in 1:nS);
+// h_v_EtOH = (50.43*exp(0.4475*(T/Tcrit_user[1]))*(1-(T/Tcrit_user[1]))^0.4989)*1000;  // J/mol
+      h_l_EtOH_Jkg = cp_l_EtOH * (351.5 - T0);
+//T_boil ethanol constant 351.5 K
+      h_l_H2O_Jkg = cp_l_H2O * (373.15 - T0);
+// T boil water constant 373.15 K
+      h_v_EtOH_Jkg = cp_v_EtOH * (T - 351.5);
   h_v_H2O_Jkg=cp_v_H2O*(T-373.15);
   h_l_Jkg=x[1]*h_l_EtOH_Jkg+x[2]*h_l_H2O_Jkg;
   h_v_Jkg=x[1]*h_v_EtOH_Jkg+x[2]*h_v_H2O_Jkg;
 
-  h =h_l_Jkg +  h_v_Jkg; ///
-
+  h =h_l_Jkg +  h_v_Jkg; ///
     annotation (Icon(graphics={
                           Rectangle(
               extent={{-100,100},{100,-100}},
@@ -124,7 +124,6 @@
               fillColor={255,255,255},
               fillPattern=FillPattern.Solid)}));
   end CalcSpecificEnthalpy;
-
   annotation (Documentation(info="<html>
   
 </html>"));
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/ActivityCoefficient/Functions.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/ActivityCoefficient/Functions.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/ActivityCoefficient/Functions.mo"	2022-03-10 09:57:37.924144116 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/ActivityCoefficient/Functions.mo"	2022-03-10 09:58:34.504151284 +0000
@@ -54,7 +54,7 @@
   function MargulesFun
       input Integer nS=3;
       input Integer k;
-      input Modelica.SIunits.MoleFraction x[nS];
+      input Modelica.Units.SI.MoleFraction x[nS];
       input Real A[nS,nS];
       output Real Margules=0;
   protected
@@ -87,8 +87,8 @@
   function NRTLFun
    input Integer nS;
    input Integer k;
-   input Modelica.SIunits.MoleFraction x[nS];
-   input Modelica.SIunits.Temperature T;
+   input Modelica.Units.SI.MoleFraction x[nS];
+   input Modelica.Units.SI.Temperature T;
    input Real alpha[nS,nS];
    input Real g[nS,nS];
    output Real NRTL=0;
@@ -138,8 +138,8 @@
     parameter Integer z; // z wird hier nicht gesetzt.... sollte 10 sein!
     input Integer nS;
     input Integer k;
-    input Modelica.SIunits.MoleFraction x[nS];
-    input Modelica.SIunits.Temperature T;
+    input Modelica.Units.SI.MoleFraction x[nS];
+    input Modelica.Units.SI.Temperature T;
     input Real r[nS];
     input Real q[nS];
     input Real u[nS,nS];
@@ -188,7 +188,7 @@
   function WilsonFun
    input Integer nS;
    input Integer k;
-   input Modelica.SIunits.MoleFraction x[nS];
+   input Modelica.Units.SI.MoleFraction x[nS];
    input Real Lambda[nS,nS];
 
    output Real Wilson=0;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/ActivityCoefficient/Margules.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/ActivityCoefficient/Margules.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/ActivityCoefficient/Margules.mo"	2022-03-10 09:57:37.924144116 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/ActivityCoefficient/Margules.mo"	2022-03-10 09:58:34.468151280 +0000
@@ -1,13 +1,13 @@
-ï»¿within ThermalSeparation.Media.Correlations.ActivityCoefficient;
+within ThermalSeparation.Media.Correlations.ActivityCoefficient;
 model Margules
   extends BaseActivityCoefficient;
     parameter Integer aux[:] = {1,3,6,10,15, 21, 28, 36, 45};
   parameter Integer aux2 = aux[nS-1]
     "number of binary mass transfer coefficients depending on the number of substances";
 
- // parameter Real a[nS+5] = fill(100,nS+5)
-  //  "vector with binary coefficients: for example: {a12, a13, a23}";
-  //                                        //hier nochmal gucken.. wusste nicht genau was das ist und hab es so geÃ¤ndert dass es lÃ¤uft!
+// parameter Real a[nS+5] = fill(100,nS+5)
+  //  "vector with binary coefficients: for example: {a12, a13, a23}";
+  //                                        //hier nochmal gucken.. wusste nicht genau was das ist und hab es so geÃ¤ndert dass es lÃ¤uft!
   parameter Real a[aux2] = fill(100,aux2);
 protected
   Real A[nS,nS] "matrix with the binary coefficients";
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/ActivityCoefficient/UNIFAC.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/ActivityCoefficient/UNIFAC.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/ActivityCoefficient/UNIFAC.mo"	2022-03-10 09:57:37.924144116 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/ActivityCoefficient/UNIFAC.mo"	2022-03-10 09:58:34.444151276 +0000
@@ -1,36 +1,42 @@
-ï»¿within ThermalSeparation.Media.Correlations.ActivityCoefficient;
+within ThermalSeparation.Media.Correlations.ActivityCoefficient;
 model UNIFAC
-            //** Alle Werte sowie Beispiel in Gmehling & Kolbe S. 246 ff.*** // Nur fÃ¼r binÃ¤re Gemische
+            //** Alle Werte sowie Beispiel in Gmehling & Kolbe S. 246 ff.*** // Nur fÃ¼r binÃ¤re Gemische
   extends BaseActivityCoefficient;
 
-   //mÃ¼ssen ins Medienmodel:
-   parameter Integer SG_1=2;//Anzahl der verschiedenen Strukturgruppen einer Komponente (z.B. '1'=n-Hexan, '2'=Butanon)
+//mÃ¼ssen ins Medienmodel:
+   parameter Integer SG_1=2;
+  //Anzahl der verschiedenen Strukturgruppen einer Komponente (z.B. '1'=n-Hexan, '2'=Butanon)
    parameter Integer SG_2=3;
-   parameter Integer SG_v=3;//Anzahl der insgesamt verschiedenen Strukturgruppen
-   parameter Real Q_m[SG_v]={0.848,0.54,1.488} "group volume";//relative van der Waalsschen GruppenoberflÃ¤chen
+   parameter Integer SG_v=3;
+  //Anzahl der insgesamt verschiedenen Strukturgruppen
+   parameter Real Q_m[SG_v]={0.848,0.54,1.488} "group volume";
+  //relative van der Waalsschen GruppenoberflÃ¤chen
    parameter Real Q_1[SG_1]={0.848,0.54};
    parameter Real Q_2[SG_2]={0.848,0.54,1.488};
-   parameter Real R_m[SG_v]={0.9011,0.6744,1.6724} "group surface area";//relative van der Waalsschen Gruppenvolumina
+   parameter Real R_m[SG_v]={0.9011,0.6744,1.6724} "group surface area";
+  //relative van der Waalsschen Gruppenvolumina
   parameter Real A_m[SG_v,SG_v]={{0,0,476.4},{0,0,476.4},{26.76,26.76,0}}
-    "binary interaction parameter between the group";                                                                       //Matrix mit Werten fÃ¼r die Gruppenwechselwirkungsparameter der Hauptstrukturgruppen
+    "binary interaction parameter between the group";                                                                         //Matrix mit Werten fÃ¼r die Gruppenwechselwirkungsparameter der Hauptstrukturgruppen
    parameter Real A_1[SG_1,SG_1]={{0,0},{0,0}};
    parameter Real A_2[SG_2,SG_2]={{0,0,476.4},{0,0,476.4},{26.76,26.76,0}};
 
-   parameter Real v[nS,SG_v]={{2,4,0},{1,1,1}}; // Anzahl der einzelnen Strukturgruppen innerhalb eines MolekÃ¼ls
-
+   parameter Real v[nS,SG_v]={{2,4,0},{1,1,1}}; 
+// Anzahl der einzelnen Strukturgruppen innerhalb eines MolekÃ¼ls
 protected
    Real psi_m[SG_v,SG_v];
    Real psi_1[SG_1,SG_1];
    Real psi_2[SG_2,SG_2];
-//   Real psi_21[n,SG_v,SG_v];
+  //   Real psi_21[n,SG_v,SG_v];
    Real X_m[SG_v];
    Real X_1[SG_1];
    Real X_2[SG_2];
    Real theta_m[SG_v];
    Real theta_1[SG_1];
    Real theta_2[SG_2];
-   Real ln_Gamma_m[SG_v];//GruppenaktivitÃ¤tskoeffizient der Mischung
-   Real ln_Gamma_r_1[SG_1];//GruppenaktivitÃ¤tskoeffizient der Reinstoffe
+   Real ln_Gamma_m[SG_v];
+  //GruppenaktivitÃ¤tskoeffizient der Mischung
+   Real ln_Gamma_r_1[SG_1];
+  //GruppenaktivitÃ¤tskoeffizient der Reinstoffe
    Real ln_Gamma_r_2[SG_2];
    Real V[nS];
    Real F[nS];
@@ -47,42 +53,33 @@
   V[i]=r[i]/sum(r[k]*x_l[k] for k in 1:nS);
   F[i]=q[i]/sum(q[k]*x_l[k] for k in 1:nS);
 
- end for;
-
-// Mischungs-Gammas
-
-//     for j in 1:n loop
-//       for i in 1:SG_v loop
-//         for k in 1:SG_v loop
-//           psi_m[j,i,k]=exp(-A_m[i,k]/T[j]);
-//           //psi_21[j,k,i]=exp(-A_21[k,i]/T[j]);
-//         end for;
-//       end for;
-//     end for;
-
- for k in 1:SG_v loop
-      ln_Gamma_m[k]=Q_m[k]*(1-Modelica.Math.log(sum(theta_m[m]*(psi_m[m,k]) for m in 1:SG_v))-sum(theta_m[m]*psi_m[k,m]/sum(theta_m[n]*psi_m[n,m] for n in 1:SG_v)
-                                                                                                  for m in 1:SG_v));
-
-      X_m[k]=sum(v[i,k]*x_l[i] for i in 1:nS)/sum(sum(v[i,u]*x_l[i] for u in 1:SG_v)
-                                                                                    for i in 1:nS);
-      theta_m[k]=Q_m[k]*X_m[k]/sum(Q_m[u]*X_m[u] for u in 1:SG_v);
-     for i in 1:SG_v loop
-        psi_m[k,i]=exp(-A_m[k,i]/T);
-        //psi_21[j,k,i]=exp(-A_21[k,i]/T[j]);
-     end for;
- end for;
-
-// Reinstoff-Gammas
-
-  for i in 1:SG_1 loop
-    ln_Gamma_r_1[i]=Q_1[i]*(1-Modelica.Math.log(sum(theta_1[m]*(psi_1[m,i]) for m in 1:SG_1))-sum(theta_1[m]*psi_1[i,m]/sum(theta_1[n]*psi_1[n,m] for n in 1:SG_1)
-                                                                                                  for m in 1:SG_1));
-    X_1[i]=v[1,i]*x_l[1]/sum(v[1,u]*x_l[1] for u in 1:SG_1);
-    theta_1[i]=Q_1[i]*X_1[i]/sum(Q_1[u]*X_1[u] for u in 1:SG_1);
-   for k in 1:SG_1 loop
-     psi_1[i,k]=exp(-A_1[i,k]/T);
-   end for;
+ end for;
+// Mischungs-Gammas
+//     for j in 1:n loop
+//       for i in 1:SG_v loop
+//         for k in 1:SG_v loop
+//           psi_m[j,i,k]=exp(-A_m[i,k]/T[j]);
+//           //psi_21[j,k,i]=exp(-A_21[k,i]/T[j]);
+//         end for;
+//       end for;
+//     end for;
+  for k in 1:SG_v loop
+    ln_Gamma_m[k] = Q_m[k] * (1 - Modelica.Math.log(sum(theta_m[m] * psi_m[m, k] for m in 1:SG_v)) - sum(theta_m[m] * psi_m[k, m] / sum(theta_m[n] * psi_m[n, m] for n in 1:SG_v) for m in 1:SG_v));
+    X_m[k] = sum(v[i, k] * x_l[i] for i in 1:nS) / sum(sum(v[i, u] * x_l[i] for u in 1:SG_v) for i in 1:nS);
+    theta_m[k] = Q_m[k] * X_m[k] / sum(Q_m[u] * X_m[u] for u in 1:SG_v);
+    for i in 1:SG_v loop
+      psi_m[k, i] = exp(-A_m[k, i] / T);
+//psi_21[j,k,i]=exp(-A_21[k,i]/T[j]);
+    end for;
+  end for;
+// Reinstoff-Gammas
+  for i in 1:SG_1 loop
+    ln_Gamma_r_1[i] = Q_1[i] * (1 - Modelica.Math.log(sum(theta_1[m] * psi_1[m, i] for m in 1:SG_1)) - sum(theta_1[m] * psi_1[i, m] / sum(theta_1[n] * psi_1[n, m] for n in 1:SG_1) for m in 1:SG_1));
+    X_1[i] = v[1, i] * x_l[1] / sum(v[1, u] * x_l[1] for u in 1:SG_1);
+    theta_1[i] = Q_1[i] * X_1[i] / sum(Q_1[u] * X_1[u] for u in 1:SG_1);
+    for k in 1:SG_1 loop
+      psi_1[i, k] = exp(-A_1[i, k] / T);
+    end for;
   end for;
   for i in 1:SG_2 loop
     ln_Gamma_r_2[i]=Q_2[i]*(1-Modelica.Math.log(sum(theta_2[m]*(psi_2[m,i]) for m in 1:SG_2))-sum(theta_2[m]*psi_2[i,m]/sum(theta_2[n]*psi_2[n,m] for n in 1:SG_2)
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Liquid/DiffMolecules.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Liquid/DiffMolecules.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Liquid/DiffMolecules.mo"	2022-03-10 09:57:37.924144116 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Liquid/DiffMolecules.mo"	2022-03-10 09:58:34.400151271 +0000
@@ -1,8 +1,8 @@
-ï»¿within ThermalSeparation.Media.Correlations.DiffusionCoefficient.Liquid;
+within ThermalSeparation.Media.Correlations.DiffusionCoefficient.Liquid;
 model DiffMolecules
   "liquid binary MS diffusion coefficients in a solution which does not contain ions"
-  //calculates the binary MS diffusion coefficient based on the binary infinite dilution diffusion coefficient
-  //Gleichung zur Bestimmung von D auf richtige Implementierung getestet fÃ¼r nS=2 und nS=3 (n=1)
+  //calculates the binary MS diffusion coefficient based on the binary infinite dilution diffusion coefficient
+  //Gleichung zur Bestimmung von D auf richtige Implementierung getestet fÃ¼r nS=2 und nS=3 (n=1)
   parameter Integer nS(min=2)=2;
   parameter Integer ic[nS]=zeros(nS) "electric charge";
   parameter Boolean has_etaSubstance[nS];
@@ -13,12 +13,12 @@
    input SI.DynamicViscosity eta[nS]
     "viscosity of pure liquid at system pressure and temperature";
 
-  //The values on the diagonal do not have a physical meaning, nevertheless they are part of the equation to calculate D
-  //(The expression if first multiplied and than divided by those values.)
+//The values on the diagonal do not have a physical meaning, nevertheless they are part of the equation to calculate D
+  //(The expression if first multiplied and than divided by those values.)
  SI.DiffusionCoefficient D0[nS,nS]= d_molecules.D
     "matrix of binary infinite dilution diffusion coefficients";
 
-   //Diff.koeff. z.B.: D12, D13, D14, D23, D24, D34
+//Diff.koeff. z.B.: D12, D13, D14, D23, D24, D34
    output SI.DiffusionCoefficient D[a];
 
 /*** Diffusion model for molecules (=nonelectrolytes or undissociated electrolytes) ***/
@@ -30,7 +30,7 @@
 
 protected
    parameter Integer counter1[nS-1]={nS-i+1 for i in 2:nS};
-   parameter Integer counter[nS]=cat(1,{0},counter1);  //fÃ¼r nS=4: {0,3,2,1};
+   parameter Integer counter[nS]=cat(1,{0},counter1);    //fÃ¼r nS=4: {0,3,2,1};
     SI.MoleFraction x_mod[nS]
     "modified mole fraction to treat liquid systems with dissolved ideal gas components";
     SI.MoleFraction x_mod0[nS]
@@ -42,27 +42,25 @@
   parameter Integer a = aux[nS-1]
     "number of binary diffusion coefficients depending on the number of substances";
 
-equation
- //counter[1]=0;
- //counter[2:nS] = counter1;
- if eta_pure then
-   x_mod=x;
-   x_mod0 = x "x_mod0 not used in this case";
- else
-   for i in 1:nS loop
-     x_mod0[i] = if has_etaSubstance[i] then x[i] else 0;
-     x_mod[i] = x_mod0[i]/sum(x_mod0[:]);
-   end for;
- end if;
-
-    for i in 1:nS-1 loop
-      for k in i+1:nS loop
-        /*** MOLECULES ***/
-           //Kooijman, H. A. and Taylor, R.: Estimation of Diffusion Coefficients in Multicomponent Liquid Systems: equation (23)
-          D[k-i+sum(counter[1:i])] = D0[i,k]^x_mod[k] * D0[k,i]^x_mod[i] * product((D0[i,:].*D0[k,:]).^(x_mod[:]/2)) /((D0[i,i]*D0[k,i])^(x_mod[i]/2)) /((D0[i,k]*D0[k,k])^(x_mod[k]/2));
-      end for;
-      end for;
-
+equation
+//counter[1]=0;
+//counter[2:nS] = counter1;
+  if eta_pure then
+    x_mod = x;
+    x_mod0 = x "x_mod0 not used in this case";
+  else
+    for i in 1:nS loop
+      x_mod0[i] = if has_etaSubstance[i] then x[i] else 0;
+      x_mod[i] = x_mod0[i] / sum(x_mod0[:]);
+    end for;
+  end if;
+ for i in 1:nS - 1 loop
+    for k in i + 1:nS loop
+/*** MOLECULES ***/
+//Kooijman, H. A. and Taylor, R.: Estimation of Diffusion Coefficients in Multicomponent Liquid Systems: equation (23)
+      D[k - i + sum(counter[1:i])] = D0[i, k] ^ x_mod[k] * D0[k, i] ^ x_mod[i] * product((D0[i, :] .* D0[k, :]) .^ (x_mod[:] / 2)) / (D0[i, i] * D0[k, i]) ^ (x_mod[i] / 2) / (D0[i, k] * D0[k, k]) ^ (x_mod[k] / 2);
+    end for;
+  end for;
 initial algorithm
   eta_pure:=true;
   for i in 1:nS loop
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Liquid/DiffMoleculesIons.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Liquid/DiffMoleculesIons.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Liquid/DiffMoleculesIons.mo"	2022-03-10 09:57:37.924144116 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Liquid/DiffMoleculesIons.mo"	2022-03-10 09:58:34.384151269 +0000
@@ -1,7 +1,7 @@
-ï»¿within ThermalSeparation.Media.Correlations.DiffusionCoefficient.Liquid;
+within ThermalSeparation.Media.Correlations.DiffusionCoefficient.Liquid;
 model DiffMoleculesIons
   "liquid binary MS diffusion coefficients for a solution which may contain ions"
-  //calculates the binary MS diffusion coefficient based on the binary infinite dilution diffusion coefficient
+  //calculates the binary MS diffusion coefficient based on the binary infinite dilution diffusion coefficient
   parameter Integer nS(min=2)=2;
   parameter Integer ic[nS]=zeros(nS) "electric charge";
   parameter Boolean has_etaSubstance[nS];
@@ -12,12 +12,12 @@
    input SI.DynamicViscosity eta[nS]
     "viscosity of pure liquid at system pressure and temperature";
 
-  //The values on the diagonal do not have a physical meaning, nevertheless they are part of the equation to calculate D
-  //(The expression if first multiplied and than divided by those values.)
+//The values on the diagonal do not have a physical meaning, nevertheless they are part of the equation to calculate D
+  //(The expression if first multiplied and than divided by those values.)
  SI.DiffusionCoefficient D0[nS,nS]= d_molecules.D
     "matrix of binary infinite dilution diffusion coefficients";
 
-   //Diff.koeff. z.B.: D12, D13, D14, D23, D24, D34
+//Diff.koeff. z.B.: D12, D13, D14, D23, D24, D34
    output SI.DiffusionCoefficient D[a];
 
 /*** Diffusion model for molecules (=nonelectrolytes or undissociated electrolytes) ***/
@@ -36,7 +36,7 @@
 
 protected
    parameter Integer counter1[nS-1]={nS-i+1 for i in 2:nS};
-   Integer counter[nS];  //fÃ¼r nS=4: {0,3,2,1};
+   Integer counter[nS];    //fÃ¼r nS=4: {0,3,2,1};
     SI.MoleFraction x_mod[nS]
     "modified mole fraction to treat liquid systems with dissolved ideal gas components";
     SI.MoleFraction x_mod0[nS]
@@ -65,19 +65,18 @@
       for k in i+1:nS loop
 
         /*** IONS ***/
-         if ic[i] <> 0 and ic[k] <>0 then
-         //The binary diffusion coefficient of an ion i with respect to an ion j is set to the mean of the effective diffusivities of the two ions:
-          D[k-i+sum(counter[1:i])] = (d_ion.D[i] + d_ion.D[k])/2;
-           elseif ic[i] <> 0 and ic[k] == 0 then
-          //The binary diffusion coefficient of the ion with respect to any molecular species is set equal to the diffusivity of the ion in the liquid mixture:
-          D[k-i+sum(counter[1:i])] = d_ion.D[i];
+         if ic[i] <> 0 and ic[k] <>0 then
+//The binary diffusion coefficient of an ion i with respect to an ion j is set to the mean of the effective diffusivities of the two ions:
+        D[k - i + sum(counter[1:i])] = (d_ion.D[i] + d_ion.D[k]) / 2;
+           elseif ic[i] <> 0 and ic[k] == 0 then
+//The binary diffusion coefficient of the ion with respect to any molecular species is set equal to the diffusivity of the ion in the liquid mixture:
+        D[k - i + sum(counter[1:i])] = d_ion.D[i];
          elseif ic[i] ==0 and ic[k] <> 0 then
          D[k-i+sum(counter[1:i])] = d_ion.D[k];
-         else
-
-        /*** MOLECULES ***/
-           //Kooijman, H. A. and Taylor, R.: Estimation of Diffusion Coefficients in Multicomponent Liquid Systems: equation (23)
-          D[k-i+sum(counter[1:i])] = D0[i,k]^x_mod[k] * D0[k,i]^x_mod[i] * product((D0[i,:].*D0[k,:]).^(x_mod[:]/2)) /((D0[i,i]*D0[k,i])^(x_mod[i]/2)) /((D0[i,k]*D0[k,k])^(x_mod[k]/2));
+         else
+/*** MOLECULES ***/
+//Kooijman, H. A. and Taylor, R.: Estimation of Diffusion Coefficients in Multicomponent Liquid Systems: equation (23)
+        D[k - i + sum(counter[1:i])] = D0[i, k] ^ x_mod[k] * D0[k, i] ^ x_mod[i] * product((D0[i, :] .* D0[k, :]) .^ (x_mod[:] / 2)) / (D0[i, i] * D0[k, i]) ^ (x_mod[i] / 2) / (D0[i, k] * D0[k, k]) ^ (x_mod[k] / 2);
         end if;
       end for;
       end for;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Vapour/Fuller.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Vapour/Fuller.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Vapour/Fuller.mo"	2022-03-10 09:57:37.924144116 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Vapour/Fuller.mo"	2022-03-10 09:58:34.308151260 +0000
@@ -1,19 +1,20 @@
-ï»¿within ThermalSeparation.Media.Correlations.DiffusionCoefficient.Vapour;
+within ThermalSeparation.Media.Correlations.DiffusionCoefficient.Vapour;
 model Fuller "correlation of Fuller"
   extends
     ThermalSeparation.Media.Correlations.DiffusionCoefficient.Vapour.BaseDiffusionCoeffGas;
 
-  //Werte fÃ¼r N2, H2O, CO2, O2, Taylor S. 69
+//Werte fÃ¼r N2, H2O, CO2, O2, Taylor S. 69
   parameter SI.MolarMass MMX[nS];
   parameter SI.Volume V[nS] "diffusion volumes";
 protected
-  parameter Integer counter1[nS-1]={nS-i+1 for i in 2:nS};//fÃ¼r nS=4: {0,3,2,1};
+  parameter Integer counter1[nS-1]={nS-i+1 for i in 2:nS};
+  //fÃ¼r nS=4: {0,3,2,1};
   final parameter Real C= 1.013e-2;
   parameter Integer counter[nS]=cat(1,{0},counter1);
 
 equation
- // counter[1]=0;
-  //counter[2:nS] = counter1;
+// counter[1]=0;
+//counter[2:nS] = counter1;
 
 for i in 1:nS-1 loop
   for k in i+1:nS loop
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Vapour/KineticTheory.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Vapour/KineticTheory.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Vapour/KineticTheory.mo"	2022-03-10 09:57:37.924144116 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/DiffusionCoefficient/Vapour/KineticTheory.mo"	2022-03-10 09:58:34.300151259 +0000
@@ -1,13 +1,14 @@
-ï»¿within ThermalSeparation.Media.Correlations.DiffusionCoefficient.Vapour;
+within ThermalSeparation.Media.Correlations.DiffusionCoefficient.Vapour;
 model KineticTheory
   "theoretical equation for the mutual diffusion coefficient in a low-pressure binary gas mixture (ideal gas!)"
-  //z.B. Taylor, p. 68
+  //z.B. Taylor, p. 68
   extends
     ThermalSeparation.Media.Correlations.DiffusionCoefficient.Vapour.BaseDiffusionCoeffGas;
     parameter Real sigma[nS];
     parameter Real epsilon_k[nS];
 protected
-  parameter Integer counter1[nS-1]={nS-i+1 for i in 2:nS};//fÃ¼r nS=4: {0,3,2,1};
+  parameter Integer counter1[nS-1]={nS-i+1 for i in 2:nS};
+  //fÃ¼r nS=4: {0,3,2,1};
   Integer counter[nS];
   Real sigma_mix[a] "Lennard-Jones force constant), constant value";
   Real epsilon_k_mix[a]
@@ -15,7 +16,7 @@
   final parameter Real C= 1.883e-2;
 
   Real omega[a] "collision integral";
-  Modelica.Blocks.Tables.CombiTable1D table_omega[a](each table=collisionIntegral);
+  Modelica.Blocks.Tables.CombiTable1Dv table_omega[a](each table=collisionIntegral);
 
 equation
    for i in 1:a loop
@@ -28,7 +29,7 @@
 
 for i in 1:nS-1 loop
   for k in i+1:nS loop
-    //the factor 1000 is due to unit conversion
+//the factor 1000 is due to unit conversion
  D[k-i+ sum(counter[1:i])] = ((MMX[i] + MMX[k])/(MMX[i] * MMX[k] *1000))^0.5 * C * T^(3/2)/(p*sigma_mix[k-i+ sum(counter[1:i])]^2 * omega[k-i+ sum(counter[1:i])]);
   end for;
   end for;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/FugacityCoefficient.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/FugacityCoefficient.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/FugacityCoefficient.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/FugacityCoefficient.mo"	2022-03-10 09:58:34.288151258 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Media.Correlations;
+within ThermalSeparation.Media.Correlations;
 package FugacityCoefficient
  /*** Reid, Prausnitz: The Properties of Gases & Liquids, 4th edition, McGraw-Hill: Tabelle 3.3 ***/
 
@@ -397,12 +397,12 @@
     Real omegam(start=0);
     Real z4 "ln(f/P)m des Gemischs";
     Real z1 "H0-H/RTcm";
-    Modelica.Blocks.Tables.CombiTable2D table_residualEnthalpy0( table = leeKesler_residualEnthalpy0);
-    Modelica.Blocks.Tables.CombiTable2D table_residualEnthalpy1(table = leeKesler_residualEnthalpy1);
-    Modelica.Blocks.Tables.CombiTable2D table_Z0(table = leeKesler_Z0);
-    Modelica.Blocks.Tables.CombiTable2D table_Z1( table = leeKesler_Z1);
-    Modelica.Blocks.Tables.CombiTable2D table_fugacityPressureRatio0(table = leeKesler_fugacityPressureRatio0);
-    Modelica.Blocks.Tables.CombiTable2D table_fugacityPressureRatio1(table = leeKesler_fugacityPressureRatio1);
+    Modelica.Blocks.Tables.CombiTable2Ds table_residualEnthalpy0( table = leeKesler_residualEnthalpy0);
+    Modelica.Blocks.Tables.CombiTable2Ds table_residualEnthalpy1(table = leeKesler_residualEnthalpy1);
+    Modelica.Blocks.Tables.CombiTable2Ds table_Z0(table = leeKesler_Z0);
+    Modelica.Blocks.Tables.CombiTable2Ds table_Z1( table = leeKesler_Z1);
+    Modelica.Blocks.Tables.CombiTable2Ds table_fugacityPressureRatio0(table = leeKesler_fugacityPressureRatio0);
+    Modelica.Blocks.Tables.CombiTable2Ds table_fugacityPressureRatio1(table = leeKesler_fugacityPressureRatio1);
 
   protected
     Real z2[nS] "Erste Summe in Formel 5-8.16";
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/Reaction/MolarReactionEnthalpy/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/Reaction/MolarReactionEnthalpy/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/Reaction/MolarReactionEnthalpy/package.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/Reaction/MolarReactionEnthalpy/package.mo"	2022-03-10 09:58:33.884151207 +0000
@@ -1,5 +1,10 @@
-ï»¿within ThermalSeparation.Media.Correlations.Reaction;
+within ThermalSeparation.Media.Correlations.Reaction;
 package MolarReactionEnthalpy 
-//andere Modelle, um ReaktionswÃ¤rmen (MolarReactionEnthalpy) zu bestimmen?? logarithmisch, exponentiell, linearkombination
+//andere Modelle, um ReaktionswÃ¤rmen (MolarReactionEnthalpy) zu bestimmen?? logarithmisch, exponentiell, linearkombination
+
+
+
+
+
 
 end MolarReactionEnthalpy;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/SaturationFugacityCoefficient/SaturationFugacitycoefficient.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/SaturationFugacityCoefficient/SaturationFugacitycoefficient.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/SaturationFugacityCoefficient/SaturationFugacitycoefficient.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Correlations/SaturationFugacityCoefficient/SaturationFugacitycoefficient.mo"	2022-03-10 09:58:33.812151196 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Media.Correlations.SaturationFugacityCoefficient;
+within ThermalSeparation.Media.Correlations.SaturationFugacityCoefficient;
 model SaturationFugacitycoefficient "fuer phi_sat in Medienmodell"
       // Gmehling und Kolbe, Thermodynamik s.120
   extends
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_MEA_Liq/DensityWater.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_MEA_Liq/DensityWater.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_MEA_Liq/DensityWater.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_MEA_Liq/DensityWater.mo"	2022-03-10 09:58:33.792151194 +0000
@@ -1,10 +1,10 @@
 within ThermalSeparation.Media.H2O_CO2_MEA_Liq;
 function DensityWater "Return density from p and T"
     extends Modelica.Icons.Function;
-    input Modelica.SIunits.AbsolutePressure p "Pressure";
-    input Modelica.SIunits.Temperature T "Temperature";
+    input Modelica.Units.SI.AbsolutePressure p "Pressure";
+    input Modelica.Units.SI.Temperature T "Temperature";
 
-   output Modelica.SIunits.Density d "Density";
+   output Modelica.Units.SI.Density d "Density";
 algorithm
     d :=
       ThermalSeparation.Media.WaterBasedLiquid.BaseClasses.IF97_Utilities.rho_pT(
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_MEA_Liq/Test.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_MEA_Liq/Test.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_MEA_Liq/Test.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_MEA_Liq/Test.mo"	2022-03-10 09:58:33.788151195 +0000
@@ -3,10 +3,10 @@
 
 parameter Integer nS=3;
 
-parameter Modelica.SIunits.Temperature T=383;
-parameter Modelica.SIunits.Temperature T0=293;
-parameter Modelica.SIunits.Pressure p=2e5;
-parameter Modelica.SIunits.MoleFraction x[nS]={0.888,0.037,0.075};
+parameter Modelica.Units.SI.Temperature T=383;
+parameter Modelica.Units.SI.Temperature T0=293;
+parameter Modelica.Units.SI.Pressure p=2e5;
+parameter Modelica.Units.SI.MoleFraction x[nS]={0.888,0.037,0.075};
 
 /* dummy inouts */
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_MEA_Liq/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_MEA_Liq/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_MEA_Liq/package.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_MEA_Liq/package.mo"	2022-03-10 09:58:33.780151192 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Media;
+within ThermalSeparation.Media;
 package H2O_CO2_MEA_Liq "H2O,CO2,MEA: CO2 separation with MEA"
 extends ThermalSeparation.Media.BaseMediumLiquidReaction(has_etaSubstance={true,false,false},
     nSubstance=3,
@@ -14,7 +14,7 @@
     reacComp={2},
     nu={{-1,-1,-1}},
     nS_reac = 3);
-   // all values except for water properties and molar masses are dummy values
+   // all values except for water properties and molar masses are dummy values
 
 constant Integer ic[nSubstance]=zeros(nSubstance);
 
@@ -23,11 +23,11 @@
 
   redeclare replaceable model extends BaseProperties
 
-   Real alpha; // loading in mol CO2 / mol MEA
-   // Real m[nSubstance]; // molarity in mol i / kg H2O
+   Real alpha;    // loading in mol CO2 / mol MEA
+      // Real m[nSubstance]; // molarity in mol i / kg H2O
    Real m_av; // average molarity
-   Modelica.SIunits.Temperature Theta = T - 273.15;
-                                      // Temperature in Â°C
+   Modelica.Units.SI.Temperature Theta = T - 273.15;
+                                      // Temperature in Â°C
    Real d_koeff[8];
    CalcSpecificEnthalpy calcSpecificEnthalpy(T0=T0, T=T, p=p, x=x);
 
@@ -40,18 +40,14 @@
    /* calculation of density (cf. Oexmann) */
 
       d = d_koeff[1] + d_koeff[2] * Theta + d_koeff[3] * Theta^2 + d_koeff[4] * alpha + d_koeff[5] * alpha^2 + d_koeff[6] * m_av +
-          d_koeff[7] * alpha^2 + d_koeff[8] * alpha * m_av;
-
-     //d = 986.9;
-
-     d_koeff = {1.005e3,-5.993e-1,0,2.492e1,1.135e2,6.172e0,-3.57e-1,1.917e1};
-
-     m_av = x[3]/(x[1]*MMX[1]);
-
-     // m_av = sum(m[i] for i in 1:nSubstance)/nSubstance;
-
-     //alpha = x[2] / x[3]; // c_carba = c_CO2;
-     alpha = x[2]/max(1e-7,x[3]);
+          d_koeff[7] * alpha^2 + d_koeff[8] * alpha * m_av;
+//d = 986.9;
+      d_koeff = {1.005e3, -5.993e-1, 0, 2.492e1, 1.135e2, 6.172e0, -3.57e-1, 1.917e1};
+
+     m_av = x[3]/(x[1]*MMX[1]);
+// m_av = sum(m[i] for i in 1:nSubstance)/nSubstance;
+//alpha = x[2] / x[3]; // c_carba = c_CO2;
+      alpha = x[2] / max(1e-7, x[3]);
 
      MM = sum(x[i]*MMX[i] for i in 1:nSubstance);
 
@@ -59,18 +55,18 @@
 
      u = h - p / d * MM;
 
-     eta = 0.001002; // for water @ 20Â°C
-
-     sigma = 0.0728; // for water @ 20Â°C
-
-     v = MM / d;
-
-      for i in 2:nSubstance loop
-      p_sat[i] = 1e5; // dummy value
+     eta = 0.001002;
+// for water @ 20Â°C
+      sigma = 0.0728;
+// for water @ 20Â°C
+      v = MM / d;
+  for i in 2:nSubstance loop
+        p_sat[i] = 1e5;
+// dummy value
       end for;
-      Modelica.Math.log(p_sat[1]) = 73.649 - 7258.2 / T - 7.3037 * Modelica.Math.log(T) + 4.1653e-6 * T^2; //water
-
-      lambda =0.55;
+      Modelica.Math.log(p_sat[1]) = 73.649 - 7258.2 / T - 7.3037 * Modelica.Math.log(T) + 4.1653e-6 * T^2;
+//water
+      lambda = 0.55;
       cp=4000;
 
   end BaseProperties;
@@ -95,8 +91,7 @@
   redeclare model extends HenryCoefficient
 
   equation
-  // He=fill(1,nSubstance); // not needed or neglected
-
+// He=fill(1,nSubstance); // not needed or neglected
   end HenryCoefficient;
 
 
@@ -104,29 +99,33 @@
   /*** model which shall be used to calculate the diffusion coefficients in a binary mixture ***/
 
   equation
-     D[1] = 2.35e-6 * Modelica.Math.exp(-2119/T); //diff. coeff H2O - CO2
-     D[2] = 2.35e-6 * Modelica.Math.exp(-2119/T); //diff. coeff H2O - MEA (at the moment still same coeff as H2O - CO2)
-     D[3] = 2.35e-6 * Modelica.Math.exp(-2119/T); //dummy value for diff coeff CO2 - MEA
-     D_diluted[1] = D[1]; //diff. coeff at infinity dissolution of CO2 in H2O (at the moment still same coeff as H2O - CO2)
-     D_diluted[2] = D[2]; //diff. coeff at infinity dissolution of MEA in H2O (at the moment still same coeff as H2O - CO2)
-     D_diluted[3] = D[3]; //self- diffusion coeff. of water (at the moment still same coeff as H2O - CO2)
-
+     D[1] = 2.35e-6 * Modelica.Math.exp(-2119/T);
+//diff. coeff H2O - CO2
+      D[2] = 2.35e-6 * Modelica.Math.exp(-2119 / T);
+//diff. coeff H2O - MEA (at the moment still same coeff as H2O - CO2)
+      D[3] = 2.35e-6 * Modelica.Math.exp(-2119 / T);
+//dummy value for diff coeff CO2 - MEA
+      D_diluted[1] = D[1];
+//diff. coeff at infinity dissolution of CO2 in H2O (at the moment still same coeff as H2O - CO2)
+      D_diluted[2] = D[2];
+//diff. coeff at infinity dissolution of MEA in H2O (at the moment still same coeff as H2O - CO2)
+      D_diluted[3] = D[3]; //self- diffusion coeff. of water (at the moment still same coeff as H2O - CO2)
   end DiffusionCoefficient;
 
 
   redeclare model extends CalcSpecificEnthalpy
 
   Real alpha(start=0.2); // loading in mol CO2 / mol MEA
-  Modelica.SIunits.SpecificHeatCapacity cp_mix;
+  Modelica.Units.SI.SpecificHeatCapacity cp_mix;
                                   // heat capacity of solution
-  Modelica.SIunits.SpecificHeatCapacity cp_tot;
-                                  // introduced for better initialization
+  Modelica.Units.SI.SpecificHeatCapacity cp_tot;
+                                  // introduced for better initialization
   Real cp_koeff[11];
-  // Real m[nSubstance]; // molarity in mol i / kg H2O
+  // Real m[nSubstance]; // molarity in mol i / kg H2O
   Real m_av; // average molarity
-  Modelica.SIunits.Temperature Theta=T - 273.15;
+  Modelica.Units.SI.Temperature Theta=T - 273.15;
                                      // Temperature in Â°C
-  Modelica.SIunits.MolarMass MM;
+  Modelica.Units.SI.MolarMass MM;
 
   parameter Real omega_k=0.05
     "large value if change between constant and variable shall be steep";
@@ -140,13 +139,11 @@
                cp_koeff[7] * m_av^2 + cp_koeff[8] * Theta * alpha + cp_koeff[9] * Theta * m_av + cp_koeff[10] * alpha * m_av +
                cp_koeff[11] * Theta * alpha * m_av;
 
-     cp_koeff = {4.294e0,-1.859e-3,2.575e-5,-7.819e-1,6.536e-1,-1.124e-1,4.746e-3,8.181e-4,8.267e-5,-5.364e-2,-1.909e-4};
-
-  //      for i in 2:nSubstance loop
-  //      m[i] = x[i]/(max(x[1],1e-7)*MMX[1]);
-  //      end for;
-
-     m_av = x[3]/(x[1]*MMX[1]);
+     cp_koeff = {4.294e0,-1.859e-3,2.575e-5,-7.819e-1,6.536e-1,-1.124e-1,4.746e-3,8.181e-4,8.267e-5,-5.364e-2,-1.909e-4};
+//      for i in 2:nSubstance loop
+//      m[i] = x[i]/(max(x[1],1e-7)*MMX[1]);
+//      end for;
+      m_av = x[3] / (x[1] * MMX[1]);
 
      alpha = x[2] / max(x[3],1e-7);
 
@@ -154,11 +151,9 @@
 
      cp_tot = min(4500,cp_mix);
 
-     h = cp_tot * (T-T0) * MM;
-     //h = 4100 * (T-T0) * MM;
-
-     MM = sum(x[i]*MMX[i] for i in 1:nSubstance);
-
+     h = cp_tot * (T-T0) * MM;
+//h = 4100 * (T-T0) * MM;
+      MM = sum(x[i] * MMX[i] for i in 1:nSubstance);
     annotation (Icon(graphics={
                           Rectangle(
               extent={{-100,100},{100,-100}},
@@ -180,7 +175,8 @@
   equation
 
     h_R[1] = (h_koeff[1] + h_koeff[2] * alpha + h_koeff[3] *alpha^2 + h_koeff[4] * alpha^3);
-  end MolarReactionEnthalpy;
+  end MolarReactionEnthalpy;
+
 
 
 end H2O_CO2_MEA_Liq;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_Vap/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_Vap/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_Vap/package.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_CO2_Vap/package.mo"	2022-03-10 09:58:33.736151187 +0000
@@ -1,12 +1,12 @@
-ï»¿within ThermalSeparation.Media;
+within ThermalSeparation.Media;
 package H2O_CO2_Vap "H2O,CO2: CO2 separation with MEA"
      constant Integer henry[:] = {2};
                                      //1.63e9
-     constant Modelica.SIunits.Pressure henry_H[:]={0,1.63e9}
+     constant Modelica.Units.SI.Pressure henry_H[:]={0,1.63e9}
   "Henry coefficient";
      constant Real henry_C[:]={0,2400}
   "constant to calculate temperature dependency";
-     constant Modelica.SIunits.Temperature henry_T_norm=298 "norm temperature";
+     constant Modelica.Units.SI.Temperature henry_T_norm=298 "norm temperature";
 
 import
   ThermalSeparation.Media.IdealGasMixtures.BaseClasses.PartialMedium.Choices.ReferenceEnthalpy;
@@ -59,18 +59,16 @@
   equation
   for i in 1:nX loop
    X[i] = max(1e-5,min(1,x[i]*MMX[i]/MM));
-  end for;
-  //cp=specificHeatCapacityCp(state);
-
-  p_start=state.p;
+  end for;
+//cp=specificHeatCapacityCp(state);
+      p_start = state.p;
     assert(T >= 200 and T <= 6000, "
 Temperature T (="   + String(T) + " K = 200 K) is not in the allowed range
 200 K <= T <= 6000 K
-required from medium model \""   + mediumName + "\".");
-
-    //bei der Gleichung MM=molarMass(state): Index-Problem!
-  // MM = max(min(MMX),sum(x.*MMX));//molarMass(state);
-  d=sum(c.*MMX);
+required from medium model \""   + mediumName + "\".");
+//bei der Gleichung MM=molarMass(state): Index-Problem!
+// MM = max(min(MMX),sum(x.*MMX));//molarMass(state);
+      d = sum(c .* MMX);
 
     h =calcSpecificEnthalpy.h;
 
@@ -86,30 +84,31 @@
   redeclare replaceable model extends CalcSpecificEnthalpy
   constant Real f_psat = 1;
   constant Boolean psat_Antoine = false;
-   output Modelica.SIunits.Temperature T_sat_water;
+   output Modelica.Units.SI.Temperature T_sat_water;
 protected
-   Modelica.SIunits.SpecificEnthalpy hX[nSubstance];
+   Modelica.Units.SI.SpecificEnthalpy hX[nSubstance];
     /***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
     Real pi "dimensionless pressure";
     Real[20] o "vector of auxiliary variables";
 
     /*** evaporation enthalpy of water ***/
-    Modelica.SIunits.SpecificEnthalpy r_water;
+    Modelica.Units.SI.SpecificEnthalpy r_water;
     Real tau;
     Real chvap[5];
 
     /*** heat capacity ***/
-      parameter Modelica.SIunits.SpecificHeatCapacity cp_water=4200;
+      parameter Modelica.Units.SI.SpecificHeatCapacity cp_water=4200;
       Real cp_H2O_vap;
       Real cp_CO2_vap;
       Real cp_coeff_H2O[5];
       Real cp_coeff_CO2[5];
 
-  equation
-        /***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
-      //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
-      pi =  max(1e-4,p*x[1])*1e-6/f_psat;//min(p,data.PCRIT)*data.IPSTAR;
-    o[1] =  pi^0.25;
+  equation
+/***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+      pi = max(1e-4, p * x[1]) * 1e-6 / f_psat;
+//min(p,data.PCRIT)*data.IPSTAR;
+      o[1] = pi ^ 0.25;
     o[2] =  -3.2325550322333e6*o[1];
     o[3] =  max(1e-10,pi)^0.5;
     o[4] =  -724213.16703206*o[3];
@@ -138,13 +137,12 @@
        1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
   end if;
 
-        h = x[1]*hX[1] +  x[2]*hX[2];
-
-          //hX[1] = (cp_water*(T_sat_water-T0)  + 1875*(T-T_sat_water)) *MMX[1] + MMX[1] * r_water;
-          //hX[1] = (cp_water*(T-T0)  + 1875*(T-T)) *MMX[1] + MMX[1] * r_water; // hier T_sat_water = T da Gleichgewicht
-          hX[1] = cp_H2O_vap*(T-T0) + r_water;  // Oexmann doesn't consider liquid part of gas enthalpy
-
-      hX[2] = cp_CO2_vap * (T-T0);
+        h = x[1]*hX[1] +  x[2]*hX[2];
+//hX[1] = (cp_water*(T_sat_water-T0)  + 1875*(T-T_sat_water)) *MMX[1] + MMX[1] * r_water;
+//hX[1] = (cp_water*(T-T0)  + 1875*(T-T)) *MMX[1] + MMX[1] * r_water; // hier T_sat_water = T da Gleichgewicht
+      hX[1] = cp_H2O_vap * (T - T0) + r_water;
+// Oexmann doesn't consider liquid part of gas enthalpy
+      hX[2] = cp_CO2_vap * (T - T0);
 
         tau = 1 - (T/647.3);
         r_water = 8.31451 * 647.3 *
@@ -152,10 +150,9 @@
                                         chvap[2] * max(1e-7,tau)^(2.0/3.0)  +
                                         chvap[3] * max(1e-7,tau) +
                                         chvap[4] * max(1e-7,tau)^(2.0)  +
-                                        chvap[5] * max(1e-7,tau)^(6.0));
-
-        // coefficients for water vaporisation
-        chvap ={5.6297, 13.962, -11.673, 2.1784, -0.31666};
+                                        chvap[5] * max(1e-7,tau)^(6.0));
+// coefficients for water vaporisation
+      chvap = {5.6297, 13.962, -11.673, 2.1784, -0.31666};
 
         cp_H2O_vap = cp_coeff_H2O[1] + cp_coeff_H2O[2] *((cp_coeff_H2O[3]/T)/Modelica.Math.sinh(cp_coeff_H2O[3]/T))^2 + cp_coeff_H2O[4] * ((cp_coeff_H2O[5]/T)/Modelica.Math.cosh(cp_coeff_H2O[5]/T))^2;
         cp_CO2_vap = cp_coeff_CO2[1] + cp_coeff_CO2[2] *((cp_coeff_CO2[3]/T)/Modelica.Math.sinh(cp_coeff_CO2[3]/T))^2 + cp_coeff_CO2[4] * ((cp_coeff_CO2[5]/T)/Modelica.Math.cosh(cp_coeff_CO2[5]/T))^2;
@@ -174,7 +171,7 @@
   redeclare replaceable model extends EvaporationEnthalpy
 
 protected
-    Modelica.SIunits.SpecificEnthalpy r_water;
+    Modelica.Units.SI.SpecificEnthalpy r_water;
     Real tau;
     Real chvap[5];
   equation
@@ -189,8 +186,7 @@
                                         chvap[3] * tau +
                                         chvap[4] * tau^(2.0)  +
                                         chvap[5] * tau^(6.0));
-
-        // coefficients for water vaporisation
+// coefficients for water vaporisation
         chvap ={5.6297, 13.962, -11.673, 2.1784, -0.31666};
 
   annotation (Icon(graphics={
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_O2_CO2_N2_Vap/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_O2_CO2_N2_Vap/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_O2_CO2_N2_Vap/package.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/H2O_O2_CO2_N2_Vap/package.mo"	2022-03-10 09:58:33.696151182 +0000
@@ -1,14 +1,14 @@
-ï»¿within ThermalSeparation.Media;
+within ThermalSeparation.Media;
 package H2O_O2_CO2_N2_Vap "H2O,O2,CO2,N2: CO2 separation with MEA"
   constant Real f_psat = 0.907;
 constant Boolean psat_Antoine = false;
      constant Integer henry[:] = {3};
                                      //1.63e9
-     constant Modelica.SIunits.Pressure henry_H[:]={0,0,1.63e8,0}
+     constant Modelica.Units.SI.Pressure henry_H[:]={0,0,1.63e8,0}
   "Henry coefficient";
      constant Real henry_C[:]={0,1500,2400,1300}
   "constant to calculate temperature dependency";
-     constant Modelica.SIunits.Temperature henry_T_norm=298 "norm temperature";
+     constant Modelica.Units.SI.Temperature henry_T_norm=298 "norm temperature";
   import
   ThermalSeparation.Media.IdealGasMixtures.BaseClasses.PartialMedium.Choices.ReferenceEnthalpy;
 
@@ -53,18 +53,16 @@
  equation
   for i in 1:nX loop
    X[i] = max(1e-5,min(1,x[i]*MMX[i]/MM));
-  end for;
- // cp=specificHeatCapacityCp(state);
-
-  p_start=state.p;
+  end for;
+// cp=specificHeatCapacityCp(state);
+      p_start = state.p;
     assert(T >= 200 and T <= 6000, "
 Temperature T (="   + String(T) + " K = 200 K) is not in the allowed range
 200 K <= T <= 6000 K
-required from medium model \""   + mediumName + "\".");
-
-    //bei der Gleichung MM=molarMass(state): Index-Problem!
-  // MM = max(1e-6,sum(x.*MMX));//molarMass(state);
-  d=sum(c.*MMX);
+required from medium model \""   + mediumName + "\".");
+//bei der Gleichung MM=molarMass(state): Index-Problem!
+// MM = max(1e-6,sum(x.*MMX));//molarMass(state);
+      d = sum(c .* MMX);
 
     h =calcSpecificEnthalpy.h;
 
@@ -79,26 +77,25 @@
 
   redeclare replaceable model extends CalcSpecificEnthalpy
 
-   output Modelica.SIunits.Temperature T_sat_water;
+   output Modelica.Units.SI.Temperature T_sat_water;
 
     /***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
 
 protected
-   Modelica.SIunits.SpecificEnthalpy hX[4];
+   Modelica.Units.SI.SpecificEnthalpy hX[4];
       Real pi "dimensionless pressure";
     Real[20] o "vector of auxiliary variables";
 
     /*** evaporation enthalpy of water ***/
-    Modelica.SIunits.SpecificEnthalpy r_water=-2462.5*T + 3177.8e3;
+    Modelica.Units.SI.SpecificEnthalpy r_water=-2462.5*T + 3177.8e3;
 
     /*** heat capacity ***/
-      parameter Modelica.SIunits.SpecificHeatCapacity cp_water=4200;
+      parameter Modelica.Units.SI.SpecificHeatCapacity cp_water=4200;
 
   equation
         /***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
-      //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
-    /*** Antoine-Gleichung von Siemens ***/
-
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+/*** Antoine-Gleichung von Siemens ***/
       pi =  max(1e-4,p*x[1])*1e-6/f_psat;
     o[1] =  pi^0.25;
     o[2] =  -3.2325550322333e6*o[1];
@@ -145,7 +142,8 @@
   redeclare replaceable model extends EvaporationEnthalpy
 
 protected
-    Modelica.SIunits.SpecificEnthalpy r_water=-2462.5*T + 3177.8e3;
+    Modelica.Units.SI.SpecificEnthalpy r_water=-2462.5*T + 3177.8e3;
+
   equation
       /*** enthalpy ***/
     h[1] = MMX[1]*r_water;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/BaseIdealGasMixture.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/BaseIdealGasMixture.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/BaseIdealGasMixture.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/BaseIdealGasMixture.mo"	2022-03-10 09:58:33.656151178 +0000
@@ -1,8 +1,8 @@
-ï»¿within ThermalSeparation.Media.IdealGasMixtures.BaseClasses;
+within ThermalSeparation.Media.IdealGasMixtures.BaseClasses;
 partial package BaseIdealGasMixture
     extends ThermalSeparation.Media.BaseMediumVapour(MMX=data[:].MM, delta_hv_medium=false);
-  import SI = Modelica.SIunits;
-  extends Modelica.Icons.Library;
+  import Modelica.Units.SI;
+  extends Modelica.Icons.Package;
   import Modelica.Math;
 
  constant
@@ -27,7 +27,7 @@
     "Default mass fractions of medium";
   constant AbsolutePressure p_default=101325
     "Default value for pressure of medium (for initialization)";
-  constant Temperature T_default = Modelica.SIunits.Conversions.from_degC(20)
+  constant Temperature T_default = Modelica.Units.Conversions.from_degC(20)
     "Default value for temperature of medium (for initialization)";
   constant SpecificEnthalpy h_default = ThermalSeparation.Media.IdealGasMixtures.BaseClasses.BaseIdealGasMixture.specificEnthalpy_pTX(
                                                              p_default, T_default, X_default)
@@ -116,11 +116,11 @@
     parameter Boolean preferredMediumStates=false
       "= true if StateSelect.prefer shall be used for the independent property variables of the medium"
       annotation (Hide=true, Evaluate=true, Dialog(tab="Advanced"));
-    SI.Conversions.NonSIunits.Temperature_degC T_degC=
-        Modelica.SIunits.Conversions.to_degC(T)
+    Modelica.Units.NonSI.Temperature_degC T_degC=
+        Modelica.Units.Conversions.to_degC(T)
       "Temperature of medium in [degC]";
-    SI.Conversions.NonSIunits.Pressure_bar p_bar=
-     Modelica.SIunits.Conversions.to_bar(p)
+    Modelica.Units.NonSI.Pressure_bar p_bar=
+     Modelica.Units.Conversions.to_bar(p)
       "Absolute pressure of medium in [bar]";
      parameter Boolean standardOrderComponents = true
       "if true, last element in components is computed from 1-sum(Xi)";
@@ -655,7 +655,7 @@
  function mixtureViscosityChung
     "Return the viscosity of gas mixtures without access to component viscosities (Chung, et. al. rules)"
  extends Modelica.Icons.Function;
-    import SI = Modelica.SIunits;
+    import Modelica.Units.SI;
    input Temperature T "Temperature";
    input Temperature[:] Tc "Critical temperatures";
    input MolarVolume[:] Vcrit "Critical volumes (m3/mol)";
@@ -1314,7 +1314,7 @@
     package Init
       "Type, constants and menu choices to define initialization, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer NoInit=1;
       constant Integer InitialStates=2;
       constant Integer SteadyState=3;
@@ -1340,7 +1340,7 @@
     package ReferenceEnthalpy
       "Type, constants and menu choices to define reference enthalpy, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer ZeroAt0K=1;
       constant Integer ZeroAt25C=2;
       constant Integer UserDefined=3;
@@ -1366,7 +1366,7 @@
     package ReferenceEntropy
       "Type, constants and menu choices to define reference entropy, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer ZeroAt0K=1;
       constant Integer ZeroAt0C=2;
       constant Integer UserDefined=3;
@@ -1390,7 +1390,7 @@
     package pd
       "Type, constants and menu choices to define whether p or d are known, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer default=1;
       constant Integer p_known=2;
       constant Integer d_known=3;
@@ -1413,7 +1413,7 @@
     package Th
       "Type, constants and menu choices to define whether T or h are known, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer default=1;
       constant Integer T_known=2;
       constant Integer h_known=3;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/FluidData.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/FluidData.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/FluidData.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/FluidData.mo"	2022-03-10 09:58:33.492151157 +0000
@@ -1,6 +1,6 @@
 within ThermalSeparation.Media.IdealGasMixtures.BaseClasses.Common;
 package FluidData "Critical data, dipole moments and related data"
-  extends Modelica.Icons.Library;
+  extends Modelica.Icons.Package;
 
   import ThermalSeparation.Media.IdealGasMixtures.BaseClasses.PartialMedium;
   import
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/Functions.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/Functions.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/Functions.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/Functions.mo"	2022-03-10 09:58:33.444151150 +0000
@@ -18,11 +18,7 @@
     input SI.Temperature T "Temperature";
     output SI.SpecificHeatCapacity cp "Specific heat capacity at temperature T";
   algorithm
-    cp := smooth(0,if T < data.Tlimit then data.R*(1/(T*T)*(data.alow[1] + T*(
-      data.alow[2] + T*(1.*data.alow[3] + T*(data.alow[4] + T*(data.alow[5] + T
-      *(data.alow[6] + data.alow[7]*T))))))) else data.R*(1/(T*T)*(data.ahigh[1]
-       + T*(data.ahigh[2] + T*(1.*data.ahigh[3] + T*(data.ahigh[4] + T*(data.
-      ahigh[5] + T*(data.ahigh[6] + data.ahigh[7]*T))))))));
+    cp := smooth(0,if T < data.Tlimit then data.R_s * (1 / (T * T) * (data.alow[1] + T * (data.alow[2] + T * (1. * data.alow[3] + T * (data.alow[4] + T * (data.alow[5] + T * (data.alow[6] + data.alow[7] * T))))))) else data.R_s * (1 / (T * T) * (data.ahigh[1] + T * (data.ahigh[2] + T * (1. * data.ahigh[3] + T * (data.ahigh[4] + T * (data.ahigh[5] + T * (data.ahigh[6] + data.ahigh[7] * T))))))));
     annotation (Inline=true,smoothOrder=2);
   end cp_T;
 
@@ -33,7 +29,7 @@
     input SI.Temperature T "Temperature";
     output SI.SpecificHeatCapacity cp "Specific heat capacity at temperature T";
   algorithm
-    cp := data.R*(1/(T*T)*(data.alow[1] + T*(
+    cp := data.R_s*(1/(T*T)*(data.alow[1] + T*(
       data.alow[2] + T*(1.*data.alow[3] + T*(data.alow[4] + T*(data.alow[5] + T
       *(data.alow[6] + data.alow[7]*T)))))));
     annotation (Inline=false, derivative(zeroDerivative=data) = cp_Tlow_der);
@@ -47,7 +43,7 @@
     input Real dT "Temperature derivative";
     output Real cp_der "Derivative of specific heat capacity";
   algorithm
-    cp_der := dT*data.R/(T*T*T)*(-2*data.alow[1] + T*(
+    cp_der := dT* data.R_s/(T*T*T)*(-2*data.alow[1] + T*(
       -data.alow[2] + T*T*(data.alow[4] + T*(2.*data.alow[5] + T
       *(3.*data.alow[6] + 4.*data.alow[7]*T)))));
     annotation(smoothOrder=2);
@@ -69,12 +65,7 @@
     output SI.SpecificEnthalpy h "Specific enthalpy at temperature T";
 
   algorithm
-    h := smooth(0, (if T < data.Tlimit then data.R*((-data.alow[1] + T*(data.blow[
-      1] + data.alow[2]*Modelica.Math.log(T) + T*(1.*data.alow[3] + T*(0.5*data.alow[
-      4] + T*(1/3*data.alow[5] + T*(0.25*data.alow[6] + 0.2*data.alow[7]*T))))))
-      /T) else data.R*((-data.ahigh[1] + T*(data.bhigh[1] + data.ahigh[2]*
-      Modelica.Math.log(T) + T*(1.*data.ahigh[3] + T*(0.5*data.ahigh[4] + T*(1/
-      3*data.ahigh[5] + T*(0.25*data.ahigh[6] + 0.2*data.ahigh[7]*T))))))/T))
+    h := smooth(0, (if T < data.Tlimit then data.R_s * (((-data.alow[1]) + T * (data.blow[1] + data.alow[2] * Modelica.Math.log(T) + T * (1. * data.alow[3] + T * (0.5 * data.alow[4] + T * (1 / 3 * data.alow[5] + T * (0.25 * data.alow[6] + 0.2 * data.alow[7] * T)))))) / T) else data.R_s * (((-data.ahigh[1]) + T * (data.bhigh[1] + data.ahigh[2] * Modelica.Math.log(T) + T * (1. * data.ahigh[3] + T * (0.5 * data.ahigh[4] + T * (1 / 3 * data.ahigh[5] + T * (0.25 * data.ahigh[6] + 0.2 * data.ahigh[7] * T)))))) / T))
        + (if exclEnthForm then -data.Hf else 0.0) + (if (refChoice == Choices.ReferenceEnthalpy.ZeroAt0K)
        then data.H0 else 0.0) + (if refChoice == Choices.ReferenceEnthalpy.UserDefined
        then h_off else 0.0));
@@ -118,7 +109,7 @@
     output SI.SpecificEnthalpy h "Specific enthalpy at temperature T";
 
   algorithm
-    h := data.R*((-data.alow[1] + T*(data.blow[1] + data.alow[2]*
+    h := data.R_s*((-data.alow[1] + T*(data.blow[1] + data.alow[2]*
       Modelica.Math.log(T) + T*(1.*data.alow[3] + T*(0.5*data.alow[4] + T*(1/3*
       data.alow[5] + T*(0.25*data.alow[6] + 0.2*data.alow[7]*T))))))/T) + (if
       exclEnthForm then -data.Hf else 0.0) + (if (refChoice == Choices.ReferenceEnthalpy.ZeroAt0K)
@@ -156,12 +147,8 @@
     input SI.Temperature T "Temperature";
     output SI.SpecificEntropy s "Specific entropy at temperature T";
   algorithm
-    s := if T < data.Tlimit then data.R*(data.blow[2] - 0.5*data.alow[1]/(T*T)
-       - data.alow[2]/T + data.alow[3]*Modelica.Math.log(T) + T*(data.alow[4]
-       + T*(0.5*data.alow[5] + T*(1/3*data.alow[6] + 0.25*data.alow[7]*T))))
-       else data.R*(data.bhigh[2] - 0.5*data.ahigh[1]/(T*T) - data.ahigh[2]/T
-       + data.ahigh[3]*Modelica.Math.log(T) + T*(data.ahigh[4] + T*(0.5*data.ahigh[
-      5] + T*(1/3*data.ahigh[6] + 0.25*data.ahigh[7]*T))));
+    s := if T < data.Tlimit then data.R_s * (data.blow[2] - 0.5 * data.alow[1] / (T * T) - data.alow[2] / T + data.alow[3] * Modelica.Math.log(T) + T * (data.alow[4] + T * (0.5 * data.alow[5] + T * (1 / 3 * data.alow[6] + 0.25 * data.alow[7] * T))))
+       else data.R_s * (data.bhigh[2] - 0.5 * data.ahigh[1] / (T * T) - data.ahigh[2] / T + data.ahigh[3] * Modelica.Math.log(T) + T * (data.ahigh[4] + T * (0.5 * data.ahigh[5] + T * (1 / 3 * data.ahigh[6] + 0.25 * data.ahigh[7] * T))));
     annotation (Inline=true, smoothOrder=2);
   end s0_T;
 
@@ -171,7 +158,7 @@
     input SI.Temperature T "Temperature";
     output SI.SpecificEntropy s "Specific entropy at temperature T";
   algorithm
-    s := data.R*(data.blow[2] - 0.5*data.alow[1]/(T*T) - data.alow[2]/T + data.alow[
+    s := data.R_s*(data.blow[2] - 0.5*data.alow[1]/(T*T) - data.alow[2]/T + data.alow[
       3]*Modelica.Math.log(T) + T*(data.alow[4] + T*(0.5*data.alow[5] + T*(1/3*
       data.alow[6] + 0.25*data.alow[7]*T))));
     annotation (Inline=true);
@@ -184,7 +171,7 @@
     input Real T_der "Temperature derivative";
     output SI.SpecificEntropy s "Specific entropy at temperature T";
   algorithm
-    s := data.R*(data.blow[2] - 0.5*data.alow[1]/(T*T) - data.alow[2]/T + data.alow[
+    s := data.R_s*(data.blow[2] - 0.5*data.alow[1]/(T*T) - data.alow[2]/T + data.alow[
       3]*Modelica.Math.log(T) + T*(data.alow[4] + T*(0.5*data.alow[5] + T*(1/3*
       data.alow[6] + 0.25*data.alow[7]*T))));
     annotation (Inline=true);
@@ -193,12 +180,12 @@
   function dynamicViscosityLowPressure
     "Dynamic viscosity of low pressure gases"
     extends Modelica.Icons.Function;
-    input SI.Temp_K T "Gas temperature";
-    input SI.Temp_K Tc "Critical temperature of gas";
+    input SI.Temperature T "Gas temperature";
+    input SI.Temperature Tc "Critical temperature of gas";
     input SI.MolarMass M "Molar mass of gas";
     input SI.MolarVolume Vc "Critical molar volume of gas";
     input Real w "Acentric factor of gas";
-    input Modelica.SIunits.ElectricDipoleMomentOfMolecule mu
+    input Modelica.Units.SI.ElectricDipoleMomentOfMolecule mu
       "Dipole moment of gas molecule";
     input Real k =  0.0 "Special correction for highly polar substances";
     output SI.DynamicViscosity eta "Dynamic viscosity of gas";
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/OneNonLinearEquation.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/OneNonLinearEquation.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/OneNonLinearEquation.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/OneNonLinearEquation.mo"	2022-03-10 09:58:33.388151143 +0000
@@ -1,7 +1,7 @@
 within ThermalSeparation.Media.IdealGasMixtures.BaseClasses.Common;
 package OneNonLinearEquation
   "Determine solution of a non-linear algebraic equation in one unknown without derivatives in a reliable and efficient way"
-  extends Modelica.Icons.Library;
+  extends Modelica.Icons.Package;
 
    replaceable record f_nonlinear_Data "Data specific for function f_nonlinear"
      extends Modelica.Icons.Record;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/SingleGasNasa.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/SingleGasNasa.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/SingleGasNasa.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/SingleGasNasa.mo"	2022-03-10 09:58:33.368151140 +0000
@@ -35,7 +35,7 @@
     AbsolutePressure triplePointPressure "triple point pressure";
     Temperature meltingPoint "melting point at 101325 Pa";
     Temperature normalBoilingPoint "normal boiling point (at 101325 Pa)";
-    Modelica.SIunits.ElectricDipoleMomentOfMolecule dipoleMoment
+    Modelica.Units.SI.ElectricDipoleMomentOfMolecule dipoleMoment
       "dipole moment of molecule in Debye (1 debye = 3.33564e10-30 C.m)";
     Boolean hasIdealGasHeatCapacity=false
       "true if ideal gas heat capacity is available";
@@ -63,7 +63,7 @@
       "Difference between specific enthalpy model (s_m) and f.eq. (s_f) (s_m - s_f)";
   end FluidConstants;
 
-  import SI = Modelica.SIunits;
+  import Modelica.Units.SI;
   import Modelica.Math;
   import
     ThermalSeparation.Media.IdealGasMixtures.BaseClasses.PartialMedium.Choices.ReferenceEnthalpy;
@@ -471,8 +471,8 @@
   function dynamicViscosityLowPressure
     "Dynamic viscosity of low pressure gases"
     extends Modelica.Icons.Function;
-    input SI.Temp_K T "Gas temperature";
-    input SI.Temp_K Tc "Critical temperature of gas";
+    input SI.Temperature T "Gas temperature";
+    input SI.Temperature Tc "Critical temperature of gas";
     input SI.MolarMass M "Molar mass of gas";
     input SI.MolarVolume Vc "Critical molar volume of gas";
     input Real w "Acentric factor of gas";
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/SingleGasesData.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/SingleGasesData.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/SingleGasesData.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/Common/SingleGasesData.mo"	2022-03-10 09:58:33.300151132 +0000
@@ -1,6 +1,6 @@
 within ThermalSeparation.Media.IdealGasMixtures.BaseClasses.Common;
 package SingleGasesData "Ideal gas data based on the NASA Glenn coefficients"
-  extends Modelica.Icons.Library;
+  extends Modelica.Icons.Package;
 
   constant
     ThermalSeparation.Media.IdealGasMixtures.BaseClasses.Common.DataRecord Ag(
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/PartialMedium.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/PartialMedium.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/PartialMedium.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/BaseClasses/PartialMedium.mo"	2022-03-10 09:58:28.900150575 +0000
@@ -8,7 +8,7 @@
     package Init
       "Type, constants and menu choices to define initialization, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer NoInit=1;
       constant Integer InitialStates=2;
       constant Integer SteadyState=3;
@@ -34,7 +34,7 @@
     package ReferenceEnthalpy
       "Type, constants and menu choices to define reference enthalpy, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer ZeroAt0K=1;
       constant Integer ZeroAt25C=2;
       constant Integer UserDefined=3;
@@ -60,7 +60,7 @@
     package ReferenceEntropy
       "Type, constants and menu choices to define reference entropy, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer ZeroAt0K=1;
       constant Integer ZeroAt0C=2;
       constant Integer UserDefined=3;
@@ -84,7 +84,7 @@
     package pd
       "Type, constants and menu choices to define whether p or d are known, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer default=1;
       constant Integer p_known=2;
       constant Integer d_known=3;
@@ -107,7 +107,7 @@
     package Th
       "Type, constants and menu choices to define whether T or h are known, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer default=1;
       constant Integer T_known=2;
       constant Integer h_known=3;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/CO2_H2O/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/CO2_H2O/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/CO2_H2O/package.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/CO2_H2O/package.mo"	2022-03-10 09:58:28.864150570 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Media.IdealGasMixtures;
+within ThermalSeparation.Media.IdealGasMixtures;
 package CO2_H2O "CO2, H2O"
 
      constant Integer henry[:] = {4,3};
@@ -52,16 +52,16 @@
    X[i] = max(1e-5,min(1,x[i]*MMX[i]/MM));
   end for;
 
-  p_start=state.p;
-    //     assert(T >= 200 and T <= 6000, "
-    // Temperature T (="   + String(T) + " K = 200 K) is not in the allowed range
-    // 200 K <= T <= 6000 K
-    // required from medium model \""   + mediumName + "\".");
-
-      /***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
-      //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
-      pi =  max(1e-4,p*x[2])*1e-6;//min(p,data.PCRIT)*data.IPSTAR;
-    o[1] =  pi^0.25;
+  p_start=state.p;
+//     assert(T >= 200 and T <= 6000, "
+// Temperature T (="   + String(T) + " K = 200 K) is not in the allowed range
+// 200 K <= T <= 6000 K
+// required from medium model \""   + mediumName + "\".");
+/***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+      pi = max(1e-4, p * x[2]) * 1e-6;
+//min(p,data.PCRIT)*data.IPSTAR;
+      o[1] = pi ^ 0.25;
     o[2] =  -3.2325550322333e6*o[1];
     o[3] =  max(1e-10,pi)^0.5;
     o[4] =  -724213.16703206*o[3];
@@ -82,14 +82,15 @@
     o[19] =  1/o[18];
     o[20] =  2.0*o[19]*o[5];
     T_sat_water =  max(300,0.5*(650.17534844798 + o[20] - (-4.0*(-0.238555575678490 +
-      1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
-
-    //bei der Gleichung MM=molarMass(state): Index-Problem!
-   MM = max(1e-6,sum(x.*MMX));//molarMass(state);
-    h_Jkg = X[2]*(4120*(T_sat_water-0) + 2382e3 + 1875*(T-T_sat_water))+ (X[1]*864)*(T-0);//h_TX(T, X);
-     h = calcSpecificEnthalpy.h;
-    // R = Modelica.Constants.R*X;
-    u_Jkg = h_Jkg - Modelica.Constants.R*T;
+      1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
+//bei der Gleichung MM=molarMass(state): Index-Problem!
+      MM = max(1e-6, sum(x .* MMX));
+//molarMass(state);
+      h_Jkg = X[2] * (4120 * (T_sat_water - 0) + 2382e3 + 1875 * (T - T_sat_water)) + X[1] * 864 * (T - 0);
+//h_TX(T, X);
+      h = calcSpecificEnthalpy.h;
+// R = Modelica.Constants.R*X;
+      u_Jkg = h_Jkg - Modelica.Constants.R * T;
     u = u_Jkg * MM;
     d = p/(Modelica.Constants.R*T);
     cp=2100*x[2]+919*x[1];
@@ -111,7 +112,7 @@
 
   equation
         /***calculation of the saturation temperature of water at the partial pressure of the water vapour***/
-           //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
       pi =  max(1e-4,p*x[2])*1e-6;
     o[1] =  pi^0.25;
     o[2] =  -3.2325550322333e6*o[1];
@@ -160,10 +161,9 @@
       /*** enthalpy ***/
       h[1]=0;
     h[2] = MMX[2]*r_water;
-  // for i in 3:nX loop
-  //   h[i] = 0;
-  // end for;
-
+// for i in 3:nX loop
+//   h[i] = 0;
+// end for;
   end EvaporationEnthalpy;
 
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O.mo"	2022-03-10 09:58:28.760150558 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Media.IdealGasMixtures;
+within ThermalSeparation.Media.IdealGasMixtures;
 package N2_H2O "2 components: N2, H2O"
 
     constant Integer henry[:] = {1};
@@ -55,12 +55,12 @@
      assert(T >= 200 and T <= 6000, "
  Temperature T (="   + String(T) + " K = 200 K) is not in the allowed range
  200 K <= T <= 6000 K
- required from medium model");
-
-       /***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
-       //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
-       pi =  max(1e-4,p*x[2])*1e-6;//min(p,data.PCRIT)*data.IPSTAR;
-     o[1] =  pi^0.25;
+ required from medium model");
+/***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+      pi = max(1e-4, p * x[2]) * 1e-6;
+//min(p,data.PCRIT)*data.IPSTAR;
+      o[1] = pi ^ 0.25;
      o[2] =  -3.2325550322333e6*o[1];
      o[3] =  max(1e-10,pi)^0.5;
      o[4] =  -724213.16703206*o[3];
@@ -81,11 +81,12 @@
      o[19] =  1/o[18];
      o[20] =  2.0*o[19]*o[5];
      T_sat_water =  max(300,0.5*(650.17534844798 + o[20] - (-4.0*(-0.238555575678490 +
-       1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
-
-     //bei der Gleichung MM=molarMass(state): Index-Problem!
-    MM = max(1e-6,sum(x.*MMX));//molarMass(state);
-     h_Jkg = X[2]*(4120*(T_sat_water-0) + 2382e3 + 1875*(T-T_sat_water))+ ( X[1] * 1041)*(T-0);//h_TX(T, X);
+       1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
+//bei der Gleichung MM=molarMass(state): Index-Problem!
+      MM = max(1e-6, sum(x .* MMX));
+//molarMass(state);
+      h_Jkg = X[2] * (4120 * (T_sat_water - 0) + 2382e3 + 1875 * (T - T_sat_water)) + X[1] * 1041 * (T - 0);
+//h_TX(T, X);
       h = calcSpecificEnthalpy.h;
      R = data.R*X;
      u_Jkg = h_Jkg - R*T;
@@ -106,7 +107,7 @@
   equation
 
         /***calculation of the saturation temperature of water at the partial pressure of the water vapour***/
-           //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
       pi =  max(1e-4,p*x[2])*1e-6;
     o[1] =  pi^0.25;
     o[2] =  -3.2325550322333e6*o[1];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_CO2_O2_SO2.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_CO2_O2_SO2.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_CO2_O2_SO2.mo"	2022-03-10 09:57:37.928144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_CO2_O2_SO2.mo"	2022-03-10 09:58:28.720150553 +0000
@@ -1,7 +1,7 @@
-ï»¿within ThermalSeparation.Media.IdealGasMixtures;
+within ThermalSeparation.Media.IdealGasMixtures;
 package N2_H2O_CO2_O2_SO2 "5 components: N2, H2O, CO2, O2, SO2"
 
-    // constant Integer henry[:] = {1,4};
+// constant Integer henry[:] = {1,4};
      constant Integer henry[:]={1,3,4,5};
      constant SI.Pressure henry_H[:] = {8.51e9,0,1.63e8,4.25e9,3.95e6}
     "Henry coefficient";
@@ -54,19 +54,18 @@
  equation
   for i in 1:nX loop
    X[i] = max(1e-5,min(1,x[i]*MMX[i]/MM));
-  end for;
-
-   ///// Tcrit = test();
-  p_start=state.p;
+  end for;
+///// Tcrit = test();
+      p_start = state.p;
     assert(T >= 200 and T <= 6000, "
 Temperature T (="   + String(T) + " K = 200 K) is not in the allowed range
 200 K <= T <= 6000 K
-required from medium model \""   + mediumName + "\".");
-
-      /***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
-      //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
-      pi =  max(1e-4,p*x[2])*1e-6;//min(p,data.PCRIT)*data.IPSTAR;
-    o[1] =  pi^0.25;
+required from medium model \""   + mediumName + "\".");
+/***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+      pi = max(1e-4, p * x[2]) * 1e-6;
+//min(p,data.PCRIT)*data.IPSTAR;
+      o[1] = pi ^ 0.25;
     o[2] =  -3.2325550322333e6*o[1];
     o[3] =  max(1e-10,pi)^0.5;
     o[4] =  -724213.16703206*o[3];
@@ -87,12 +86,13 @@
     o[19] =  1/o[18];
     o[20] =  2.0*o[19]*o[5];
     T_sat_water =  max(300,0.5*(650.17534844798 + o[20] - (-4.0*(-0.238555575678490 +
-      1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
-
-    //bei der Gleichung MM=molarMass(state): Index-Problem!
-   MM = max(1e-6,sum(x.*MMX));//molarMass(state);
-    h_Jkg = X[2]*(4120*(T_sat_water-0) + 2382e3 + 1875*(T-T_sat_water))+ (X[4]*925 + X[3]*864 + X[5]*622  + X[1] * 1041)*(T-0);//h_TX(T, X);
-     h = calcSpecificEnthalpy.h;
+      1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
+//bei der Gleichung MM=molarMass(state): Index-Problem!
+      MM = max(1e-6, sum(x .* MMX));
+//molarMass(state);
+      h_Jkg = X[2] * (4120 * (T_sat_water - 0) + 2382e3 + 1875 * (T - T_sat_water)) + (X[4] * 925 + X[3] * 864 + X[5] * 622 + X[1] * 1041) * (T - 0);
+//h_TX(T, X);
+      h = calcSpecificEnthalpy.h;
     R = data.R*X;
     u_Jkg = h_Jkg - R*T;
     u = u_Jkg * MM;
@@ -112,7 +112,7 @@
 
   equation
         /***calculation of the saturation temperature of water at the partial pressure of the water vapour***/
-          //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
       pi =  max(1e-4,p*x[2])*1e-6;
     o[1] =  pi^0.25;
     o[2] =  -3.2325550322333e6*o[1];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_CO2_O2_SO2_HCl.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_CO2_O2_SO2_HCl.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_CO2_O2_SO2_HCl.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_CO2_O2_SO2_HCl.mo"	2022-03-10 09:58:28.688150547 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Media.IdealGasMixtures;
+within ThermalSeparation.Media.IdealGasMixtures;
 package N2_H2O_CO2_O2_SO2_HCl "6 components: N2, H2O, CO2, O2, SO2, HCl"
         constant Integer henry[:] = {1,3,4,5,6};
              constant SI.Pressure henry_H[:] = {8.51e9,0,1.63e8,4.25e9,3.95e6,3.48e5}
@@ -62,12 +62,12 @@
     assert(T >= 200 and T <= 6000, "
 Temperature T (="   + String(T) + " K = 200 K) is not in the allowed range
 200 K <= T <= 6000 K
-required from medium model \""   + mediumName + "\".");
-
-      /***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
-      //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
-      pi =  max(1e-4,p*x[2])*1e-6;//min(p,data.PCRIT)*data.IPSTAR;
-    o[1] =  pi^0.25;
+required from medium model \""   + mediumName + "\".");
+/***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+      pi = max(1e-4, p * x[2]) * 1e-6;
+//min(p,data.PCRIT)*data.IPSTAR;
+      o[1] = pi ^ 0.25;
     o[2] =  -3.2325550322333e6*o[1];
     o[3] =  max(1e-10,pi)^0.5;
     o[4] =  -724213.16703206*o[3];
@@ -88,12 +88,13 @@
     o[19] =  1/o[18];
     o[20] =  2.0*o[19]*o[5];
     T_sat_water =  max(300,0.5*(650.17534844798 + o[20] - (-4.0*(-0.238555575678490 +
-      1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
-
-    //bei der Gleichung MM=molarMass(state): Index-Problem!
-   MM = max(1e-6,sum(x.*MMX));//molarMass(state);
-    h_Jkg = X[2]*(4120*(T_sat_water-0) + 2382e3 + 1875*(T-T_sat_water))+ (X[4]*925 + X[3]*864 + X[5]*622 + X[6]*799 + X[1] * 1041)*(T-0);//h_TX(T, X);
-    h = calcSpecificEnthalpy.h;
+      1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
+//bei der Gleichung MM=molarMass(state): Index-Problem!
+      MM = max(1e-6, sum(x .* MMX));
+//molarMass(state);
+      h_Jkg = X[2] * (4120 * (T_sat_water - 0) + 2382e3 + 1875 * (T - T_sat_water)) + (X[4] * 925 + X[3] * 864 + X[5] * 622 + X[6] * 799 + X[1] * 1041) * (T - 0);
+//h_TX(T, X);
+      h = calcSpecificEnthalpy.h;
     R = data.R*X;
     u_Jkg = h_Jkg - R*T;
     u = u_Jkg * MM;
@@ -113,7 +114,7 @@
 
   equation
         /***calculation of the saturation temperature of water at the partial pressure of the water vapour***/
-          //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
       pi =  max(1e-4,p*x[2])*1e-6;
     o[1] =  pi^0.25;
     o[2] =  -3.2325550322333e6*o[1];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_O2_CO2.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_O2_CO2.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_O2_CO2.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_O2_CO2.mo"	2022-03-10 09:58:28.620150540 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Media.IdealGasMixtures;
+within ThermalSeparation.Media.IdealGasMixtures;
 package N2_H2O_O2_CO2 "4 components: N2, H2O, O2, CO2"
 
        constant Integer henry[:] = {1,3,4};
@@ -52,18 +52,18 @@
  equation
   for i in 1:nX loop
    X[i] = max(1e-5,min(1,x[i]*MMX[i]/MM));
-  end for;
-   ///// Tcrit = test();
-  p_start=state.p;
+  end for;
+///// Tcrit = test();
+      p_start = state.p;
     assert(T >= 200 and T <= 6000, "
 Temperature T (="   + String(T) + " K = 200 K) is not in the allowed range
 200 K <= T <= 6000 K
-required from medium model \""   + mediumName + "\".");
-
-      /***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
-      //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
-      pi =  max(1e-4,p*x[2])*1e-6;//min(p,data.PCRIT)*data.IPSTAR;
-    o[1] =  pi^0.25;
+required from medium model \""   + mediumName + "\".");
+/***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+      pi = max(1e-4, p * x[2]) * 1e-6;
+//min(p,data.PCRIT)*data.IPSTAR;
+      o[1] = pi ^ 0.25;
     o[2] =  -3.2325550322333e6*o[1];
     o[3] =  max(1e-10,pi)^0.5;
     o[4] =  -724213.16703206*o[3];
@@ -84,12 +84,13 @@
     o[19] =  1/o[18];
     o[20] =  2.0*o[19]*o[5];
     T_sat_water =  max(300,0.5*(650.17534844798 + o[20] - (-4.0*(-0.238555575678490 +
-      1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
-
-    //bei der Gleichung MM=molarMass(state): Index-Problem!
-   MM = max(1e-6,sum(x.*MMX));//molarMass(state);
-    h_Jkg = X[2]*(4120*(T_sat_water-0) + 2382e3 + 1875*(T-T_sat_water))+ (X[3]*925 + X[4]*864  + X[1] * 1041)*(T-0);//h_TX(T, X);
-    h = calcSpecificEnthalpy.h;
+      1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
+//bei der Gleichung MM=molarMass(state): Index-Problem!
+      MM = max(1e-6, sum(x .* MMX));
+//molarMass(state);
+      h_Jkg = X[2] * (4120 * (T_sat_water - 0) + 2382e3 + 1875 * (T - T_sat_water)) + (X[3] * 925 + X[4] * 864 + X[1] * 1041) * (T - 0);
+//h_TX(T, X);
+      h = calcSpecificEnthalpy.h;
     R = data.R*X;
     u_Jkg = h_Jkg - R*T;
     u = u_Jkg * MM;
@@ -109,7 +110,7 @@
 
   equation
         /***calculation of the saturation temperature of water at the partial pressure of the water vapour***/
-          //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
       pi =  max(1e-4,p*x[2])*1e-6;
     o[1] =  pi^0.25;
     o[2] =  -3.2325550322333e6*o[1];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_O2_CO2_SO2.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_O2_CO2_SO2.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_O2_CO2_SO2.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_O2_CO2_SO2.mo"	2022-03-10 09:58:28.556150532 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Media.IdealGasMixtures;
+within ThermalSeparation.Media.IdealGasMixtures;
 package N2_H2O_O2_CO2_SO2 "5 components: N2, H2O, O2, CO2, SO2"
 
      constant Integer henry[:] = {1,3,4,5};
@@ -58,14 +58,13 @@
     assert(T >= 200 and T <= 6000, "
 Temperature T (="   + String(T) + " K = 200 K) is not in the allowed range
 200 K <= T <= 6000 K
-required from medium model \""   + mediumName + "\".");
-
-  //eta_m=dynamicViscosity(state);
-
-      /***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
-      //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
-      pi =  max(1e-4,p*x[2])*1e-6;//min(p,data.PCRIT)*data.IPSTAR;
-    o[1] =  pi^0.25;
+required from medium model \""   + mediumName + "\".");
+//eta_m=dynamicViscosity(state);
+/***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+      pi = max(1e-4, p * x[2]) * 1e-6;
+//min(p,data.PCRIT)*data.IPSTAR;
+      o[1] = pi ^ 0.25;
     o[2] =  -3.2325550322333e6*o[1];
     o[3] =  max(1e-10,pi)^0.5;
     o[4] =  -724213.16703206*o[3];
@@ -86,18 +85,20 @@
     o[19] =  1/o[18];
     o[20] =  2.0*o[19]*o[5];
     T_sat_water =  max(300,0.5*(650.17534844798 + o[20] - (-4.0*(-0.238555575678490 +
-      1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
-
-    //bei der Gleichung MM=molarMass(state): Index-Problem!
-   MM = max(1e-6,sum(x.*MMX));//molarMass(state);
-    h_Jkg = X[2]*(4120*(T_sat_water-0) + 2382e3 + 1875*(T-T_sat_water))+ (X[3]*925 + X[4]*864 + X[5]*622  + X[1] * 1041)*(T-0);//h_TX(T, X);
-   h = calcSpecificEnthalpy.h;
+      1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
+//bei der Gleichung MM=molarMass(state): Index-Problem!
+      MM = max(1e-6, sum(x .* MMX));
+//molarMass(state);
+      h_Jkg = X[2] * (4120 * (T_sat_water - 0) + 2382e3 + 1875 * (T - T_sat_water)) + (X[3] * 925 + X[4] * 864 + X[5] * 622 + X[1] * 1041) * (T - 0);
+//h_TX(T, X);
+      h = calcSpecificEnthalpy.h;
     R = data.R*X;
     u_Jkg = h_Jkg - R*T;
     u = u_Jkg * MM;
     d = p/(R*T);
 
-    annotation (structurallyIncomplete);
+    annotation (structurallyIncomplete);
+
 end BaseProperties;
 
   redeclare replaceable model extends CalcSpecificEnthalpy
@@ -111,7 +112,7 @@
 
   equation
         /***calculation of the saturation temperature of water at the partial pressure of the water vapour***/
-           //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
       pi =  max(1e-4,p*x[2])*1e-6;
     o[1] =  pi^0.25;
     o[2] =  -3.2325550322333e6*o[1];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_O2_CO2_SO2_HCl_HF.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_O2_CO2_SO2_HCl_HF.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_O2_CO2_SO2_HCl_HF.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/N2_H2O_O2_CO2_SO2_HCl_HF.mo"	2022-03-10 09:58:28.500150525 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Media.IdealGasMixtures;
+within ThermalSeparation.Media.IdealGasMixtures;
 package N2_H2O_O2_CO2_SO2_HCl_HF "7C, Rauchgas: N2, H2O, O2, CO2, SO2, HCl, HF"
 
         constant Integer henry[:] = {1,3,4,5,6,7};
@@ -62,12 +62,12 @@
     assert(T >= 200 and T <= 6000, "
 Temperature T (="   + String(T) + " K = 200 K) is not in the allowed range
 200 K <= T <= 6000 K
-required from medium model \""   + mediumName + "\".");
-
-      /***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
-      //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
-      pi =  max(1e-4,p*x[2])*1e-6;//min(p,data.PCRIT)*data.IPSTAR;
-    o[1] =  pi^0.25;
+required from medium model \""   + mediumName + "\".");
+/***Berechnung der SÃ¤ttigungstemperatur von Wasser beim Partialdruck des Wasserdampfes***/
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+      pi = max(1e-4, p * x[2]) * 1e-6;
+//min(p,data.PCRIT)*data.IPSTAR;
+      o[1] = pi ^ 0.25;
     o[2] =  -3.2325550322333e6*o[1];
     o[3] =  max(1e-10,pi)^0.5;
     o[4] =  -724213.16703206*o[3];
@@ -88,13 +88,13 @@
     o[19] =  1/o[18];
     o[20] =  2.0*o[19]*o[5];
     T_sat_water =  max(300,0.5*(650.17534844798 + o[20] - (-4.0*(-0.238555575678490 +
-      1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
-
-    //bei der Gleichung MM=molarMass(state): Index-Problem!
-   MM = max(1e-6,sum(x.*MMX));//molarMass(state);
-
-    h_Jkg = X[2]*(4120*(T_sat_water-0) + 2382e3 + 1875*(T-T_sat_water))+ (X[3]*925 + X[4]*864 + X[5]*622 + X[6]*799 + X[7]*800 + X[1] * 1041)*(T-0);//h_TX(T, X);
-     h = calcSpecificEnthalpy.h;
+      1300.35069689596*o[19]*o[5]) + (650.17534844798 + o[20])^2.0)^0.5));
+//bei der Gleichung MM=molarMass(state): Index-Problem!
+      MM = max(1e-6, sum(x .* MMX));
+//molarMass(state);
+      h_Jkg = X[2] * (4120 * (T_sat_water - 0) + 2382e3 + 1875 * (T - T_sat_water)) + (X[3] * 925 + X[4] * 864 + X[5] * 622 + X[6] * 799 + X[7] * 800 + X[1] * 1041) * (T - 0);
+//h_TX(T, X);
+      h = calcSpecificEnthalpy.h;
     R = data.R*X;
     u_Jkg = h_Jkg - R*T;
     u = u_Jkg * MM;
@@ -115,7 +115,7 @@
 
   equation
         /***calculation of the saturation temperature of water at the partial pressure of the water vapour***/
-           //Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
+//Vorkehrungen treffen, falls der Wasseranteil null ist (x[1] = 0)
       pi =  max(1e-4,p*x[2])*1e-6;
     o[1] =  pi^0.25;
     o[2] =  -3.2325550322333e6*o[1];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/PartialMediumPure.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/PartialMediumPure.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/PartialMediumPure.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/IdealGasMixtures/PartialMediumPure.mo"	2022-03-10 09:58:28.440150516 +0000
@@ -2,8 +2,8 @@
 partial package PartialMediumPure
   "Partial medium properties (base package of all media packages)"
 
-  import SI = Modelica.SIunits;
-  extends Modelica.Icons.Library;
+  import Modelica.Units.SI;
+  extends Modelica.Icons.Package;
 
   // Constants to be set in Medium
   constant String mediumName = "unusablePartialMedium" "Name of the medium";
@@ -25,7 +25,7 @@
     "Default mass fractions of medium";
   constant AbsolutePressure p_default=101325
     "Default value for pressure of medium (for initialization)";
-  constant Temperature T_default = Modelica.SIunits.Conversions.from_degC(20)
+  constant Temperature T_default = Modelica.Units.Conversions.from_degC(20)
     "Default value for temperature of medium (for initialization)";
   constant SpecificEnthalpy h_default = specificEnthalpy_pTX(p_default, T_default, X_default)
     "Default value for specific enthalpy of medium (for initialization)";
@@ -87,11 +87,11 @@
     parameter Boolean preferredMediumStates=false
       "= true if StateSelect.prefer shall be used for the independent property variables of the medium"
       annotation (Hide=true, Evaluate=true, Dialog(tab="Advanced"));
-    SI.Conversions.NonSIunits.Temperature_degC T_degC=
-        Modelica.SIunits.Conversions.to_degC(T)
+    Modelica.Units.NonSI.Temperature_degC T_degC=
+        Modelica.Units.Conversions.to_degC(T)
       "Temperature of medium in [degC]";
-    SI.Conversions.NonSIunits.Pressure_bar p_bar=
-     Modelica.SIunits.Conversions.to_bar(p)
+    Modelica.Units.NonSI.Pressure_bar p_bar=
+     Modelica.Units.Conversions.to_bar(p)
       "Absolute pressure of medium in [bar]";
     parameter Boolean standardOrderComponents = true
       "if true, last element in components is computed from 1-sum(Xi)";
@@ -624,7 +624,7 @@
     package Init
       "Type, constants and menu choices to define initialization, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer NoInit=1;
       constant Integer InitialStates=2;
       constant Integer SteadyState=3;
@@ -650,7 +650,7 @@
     package ReferenceEnthalpy
       "Type, constants and menu choices to define reference enthalpy, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer ZeroAt0K=1;
       constant Integer ZeroAt25C=2;
       constant Integer UserDefined=3;
@@ -676,7 +676,7 @@
     package ReferenceEntropy
       "Type, constants and menu choices to define reference entropy, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer ZeroAt0K=1;
       constant Integer ZeroAt0C=2;
       constant Integer UserDefined=3;
@@ -700,7 +700,7 @@
     package pd
       "Type, constants and menu choices to define whether p or d are known, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer default=1;
       constant Integer p_known=2;
       constant Integer d_known=3;
@@ -723,7 +723,7 @@
     package Th
       "Type, constants and menu choices to define whether T or h are known, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer default=1;
       constant Integer T_known=2;
       constant Integer h_known=3;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Interfaces.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Interfaces.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Interfaces.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Interfaces.mo"	2022-03-10 09:58:28.344150504 +0000
@@ -195,7 +195,7 @@
       "Default mass fractions of medium";
     constant AbsolutePressure p_default=101325
       "Default value for pressure of medium (for initialization)";
-    constant Temperature T_default=Modelica.SIunits.Conversions.from_degC(20)
+    constant Temperature T_default=Modelica.Units.Conversions.from_degC(20)
       "Default value for temperature of medium (for initialization)";
     constant SpecificEnthalpy h_default=specificEnthalpy_pTX(
             p_default,
@@ -246,11 +246,11 @@
         annotation (Evaluate=true, Dialog(tab="Advanced"));
       parameter Boolean standardOrderComponents=true
         "If true, and reducedX = true, the last element of X will be computed from the other ones";
-      SI.Conversions.NonSIunits.Temperature_degC T_degC=
-          Modelica.SIunits.Conversions.to_degC(T)
+      Modelica.Units.NonSI.Temperature_degC T_degC=
+          Modelica.Units.Conversions.to_degC(T)
         "Temperature of medium in [degC]";
-      SI.Conversions.NonSIunits.Pressure_bar p_bar=
-          Modelica.SIunits.Conversions.to_bar(p)
+      Modelica.Units.NonSI.Pressure_bar p_bar=
+          Modelica.Units.Conversions.to_bar(p)
         "Absolute pressure of medium in [bar]";
 
       // Local connector definition, used for equation balancing check
@@ -2965,7 +2965,7 @@
         AbsolutePressure triplePointPressure=3e5 "Triple point pressure";
         Temperature meltingPoint "Melting point at 101325 Pa";
         Temperature normalBoilingPoint "Normal boiling point (at 101325 Pa)";
-        Modelica.SIunits.ElectricDipoleMomentOfMolecule dipoleMoment
+        Modelica.Units.SI.ElectricDipoleMomentOfMolecule dipoleMoment
           "Dipole moment of molecule in Debye (1 debye = 3.33564e10-30 C.m)";
         Boolean hasIdealGasHeatCapacity=false
           "True if ideal gas heat capacity is available";
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Methylacetatsynthese_Liq.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Methylacetatsynthese_Liq.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Methylacetatsynthese_Liq.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Methylacetatsynthese_Liq.mo"	2022-03-10 09:58:27.748150430 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Media;
+within ThermalSeparation.Media;
 package Methylacetatsynthese_Liq "Methylacetat, EssigsÃ¤e, Methanol, Wasser"
   extends BaseMediumLiquidReaction(
   has_etaSubstance=fill(true,nSubstance),
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Methylacetatsynthese_Vap.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Methylacetatsynthese_Vap.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Methylacetatsynthese_Vap.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/Methylacetatsynthese_Vap.mo"	2022-03-10 09:58:27.672150420 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Media;
+within ThermalSeparation.Media;
 package Methylacetatsynthese_Vap "Methylacetat, EssigsÃ¤ure, Methanol, Wasser"
   extends BaseMediumVapour(nSubstance=n, V = {73.78, 53.26, 31.25, 13.1},  eq_Tsonopoulos = {0, 0,0, 6},  sigma = {4.936, 4.5, 3.626, 2.641},
  epsilon_k = {469.8, 470, 481.8, 809.1}, MMX={0.0741,0.0601,0.03204,0.018});
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/Common/ThermoFluidSpecial.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/Common/ThermoFluidSpecial.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/Common/ThermoFluidSpecial.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/Common/ThermoFluidSpecial.mo"	2022-03-10 09:58:27.200150359 +0000
@@ -486,7 +486,7 @@
    Real vt(unit="m3.kg-1.K-1")
       "derivative of specific volume w.r.t. temperature";
    Real vp(unit="m4.kg-2.s2") "derivative of specific volume w.r.t. pressure";
-   Modelica.SIunits.Density d;
+   Modelica.Units.SI.Density d;
  algorithm
    pro.R := g.R;
    pro.p := g.p;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/IF97_Utilities.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/IF97_Utilities.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/IF97_Utilities.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/IF97_Utilities.mo"	2022-03-10 09:58:27.092150346 +0000
@@ -1,12 +1,12 @@
-ï»¿within ThermalSeparation.Media.WaterBasedLiquid.BaseClasses;
+within ThermalSeparation.Media.WaterBasedLiquid.BaseClasses;
 package IF97_Utilities
   "Low level and utility computation for high accuracy water properties according to the IAPWS/IF97 standard"
 
-  extends Modelica.Icons.Library;
+  extends Modelica.Icons.Package;
 
   package BaseIF97
     "Modelica Physical Property Model: the new industrial formulation IAPWS-IF97"
-    extends Modelica.Icons.Library;
+    extends Modelica.Icons.Package;
     record IterationData "constants for iterations internal to some functions"
 
       extends Modelica.Icons.Record;
@@ -195,7 +195,7 @@
     package Regions
       "functions to find the current region for given pairs of input variables"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
 
       //===================================================================
       //                      "Public" functions
@@ -1621,7 +1621,7 @@
 
     package Basic "Base functions as described in IAWPS/IF97"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
 
       function g1 "Gibbs function for region 1: g(p,T)"
         extends Modelica.Icons.Function;
@@ -3302,7 +3302,7 @@
           extends Modelica.Icons.Function;
           input SI.Pressure p "Pressure";
           input SI.SpecificEnthalpy h "specific enthalpy";
-          output SI.Temp_K T "Temperature";
+          output SI.Temperature T "Temperature";
       protected
           constant Real[:] n=
             {-0.133645667811215e-6,0.455912656802978e-5,-0.146294640700979e-4, 0.639341312970080e-2,0.372783927268847e3,
@@ -3317,7 +3317,7 @@
           constant Real[:] J = { 0,1,2,6,14,16,20,22,1,5,12,0,2,4,10,2,0,1,3,4,0,2,0,1,1,0,1,0,3,4,5};
           constant SI.SpecificEnthalpy hstar = 2300e3 "normalization enthalpy";
           constant SI.Pressure pstar = 100e6 "normalization pressure";
-          constant SI.Temp_K Tstar = 760 "normalization temperature";
+          constant SI.Temperature Tstar = 760 "normalization temperature";
           Real pi = p/pstar "normalized specific pressure";
           Real eta = h/hstar "normalized specific enthalpy";
       algorithm
@@ -3344,7 +3344,7 @@
           extends Modelica.Icons.Function;
           input SI.Pressure p "Pressure";
           input SI.SpecificEnthalpy h "specific enthalpy";
-          output SI.Temp_K T "Temperature";
+          output SI.Temperature T "Temperature";
       protected
           constant Real[:] n=
             {0.323254573644920e-4,-0.127575556587181e-3,-0.475851877356068e-3,0.156183014181602e-2,
@@ -3357,7 +3357,7 @@
           constant Real[:] I = {-12,-12,-10,-10,-10,-10,-10,-8,-8,-8,-8,
                                 -8,-6,-6,-6,-4,-4,-3,-2,-2,-1,-1,-1,-1,-1,-1,0,0,1,3,5,6,8};
           constant Real[:] J = {0,1,0,1,5,10,12,0,1,2,4,10,0,1,2,0,1,5,0,4,2,4,6,10,14,16,0,2,1,1,1,1,1};
-          constant SI.Temp_K Tstar = 860 "normalization temperature";
+          constant SI.Temperature Tstar = 860 "normalization temperature";
           constant SI.Pressure pstar = 100e6 "normalization pressure";
           constant SI.SpecificEnthalpy hstar = 2800e3 "normalization enthalpy";
           Real pi = p/pstar "normalized specific pressure";
@@ -3470,7 +3470,7 @@
           extends Modelica.Icons.Function;
           input SI.Pressure p "Pressure";
           input SI.SpecificEntropy s "specific entropy";
-          output SI.Temp_K T "Temperature";
+          output SI.Temperature T "Temperature";
       protected
           constant Real[:] n=
             {0.150042008263875e10,-0.159397258480424e12,0.502181140217975e-3,-0.672057767855466e2,
@@ -3483,7 +3483,7 @@
           constant Real[:] I = {-12,-12,-10,-10,-10,-10,-8,-8,
                                 -8,-8,-6,-6,-6,-5,-5,-5,-4,-4,-4,-2,-2,-1,-1,0,0,0,1,2,2,3,8,8,10};
           constant Real[:] J = {28,32,4,10,12,14,5,7,8,28,2,6,32,0,14,32,6,10,36,1,4,1,6,0,1,4,0,0,3,2,0,1,2};
-          constant SI.Temp_K Tstar = 760 "normalization temperature";
+          constant SI.Temperature Tstar = 760 "normalization temperature";
           constant SI.Pressure pstar = 100e6 "normalization pressure";
           constant SI.SpecificEntropy sstar = 4.4e3 "normalization entropy";
           Real pi = p/pstar "normalized specific pressure";
@@ -3512,7 +3512,7 @@
           extends Modelica.Icons.Function;
           input SI.Pressure p "Pressure";
           input SI.SpecificEntropy s "specific entropy";
-          output SI.Temp_K T "Temperature";
+          output SI.Temperature T "Temperature";
       protected
           constant Real[:] n=
             {0.527111701601660,-0.401317830052742e2,0.153020073134484e3,-0.224799398218827e4,
@@ -3523,7 +3523,7 @@
              -0.699997000152457e-3,0.119845803210767e-1,0.193848122022095e-4,-0.215095749182309e-4};
           constant Real[:] I = {-12,-12,-12,-12,-8,-8,-8,-6,-6,-6,-5,-5,-5,-5,-5,-4,-3,-3,-2,0,2,3,4,5,6,8,12,14};
           constant Real[:] J = {1,3,4,7,0,1,3,0,2,4,0,1,2,4,6,12,1,6,2,0,1,1,0,24,0,3,1,2};
-          constant SI.Temp_K Tstar = 860 "normalization temperature";
+          constant SI.Temperature Tstar = 860 "normalization temperature";
           constant SI.Pressure pstar = 100e6 "normalization pressure";
           constant SI.SpecificEntropy sstar = 5.3e3 "normalization entropy";
           Real pi = p/pstar "normalized specific pressure";
@@ -3705,14 +3705,15 @@
   package IceBoundaries
       "the melting line and sublimation line curves from IAPWS"
 
+
       function pmIceI_T
         "Melting pressure of ice I (temperature range from 273.16 to 251.165 K)"
         extends Modelica.Icons.Function;
-        input SI.Temp_K T "Temperature";
+        input SI.Temperature T "Temperature";
         output SI.Pressure pm
           "Melting pressure of iceI(for T from 273.16 to 251.165 K)";
       protected
-        constant SI.Temp_K Tn = 273.16 "normalization temperature";
+        constant SI.Temperature Tn = 273.16 "normalization temperature";
         constant SI.Pressure pn = 611.657 "normalization pressure";
         Real sigma = T/Tn "normalized temperature";
       algorithm
@@ -3734,11 +3735,11 @@
       function pmIceIII_T
         "Melting pressure of ice III (temperature range from 251.165 to 256.164 K)"
         extends Modelica.Icons.Function;
-        input SI.Temp_K T "Temperature";
+        input SI.Temperature T "Temperature";
         output SI.Pressure pm
           "Melting pressure of iceIII(for T from 251.165 to 256.164 K)";
       protected
-        constant SI.Temp_K Tn = 251.165 "normalization temperature";
+        constant SI.Temperature Tn = 251.165 "normalization temperature";
         constant SI.Pressure pn = 209.9e6 "normalization pressure";
         Real sigma = T/Tn "normalized temperature";
       algorithm
@@ -3760,11 +3761,11 @@
       function pmIceV_T
         "Melting pressure of ice V (temperature range from 256.164 to 273.31 K)"
         extends Modelica.Icons.Function;
-        input SI.Temp_K T "Temperature";
+        input SI.Temperature T "Temperature";
         output SI.Pressure pm
           "Melting pressure of iceV(for T from 256.164 to 273.31 K)";
       protected
-        constant SI.Temp_K Tn = 256.164 "normalization temperature";
+        constant SI.Temperature Tn = 256.164 "normalization temperature";
         constant SI.Pressure pn = 350.1e6 "normalization pressure";
         Real sigma = T/Tn "normalized temperature";
 
@@ -3787,11 +3788,11 @@
       function sublimationPressure_T
         "Sublimation pressure, valid from 190 to 273.16 K"
         extends Modelica.Icons.Function;
-        input SI.Temp_K T "Temperature";
+        input SI.Temperature T "Temperature";
         output SI.Pressure psubl
           "sublimation pressure (for T from 190 to 273.16)";
       protected
-        constant SI.Temp_K Tn = 273.16 "normalization temperature";
+        constant SI.Temperature Tn = 273.16 "normalization temperature";
         constant SI.Pressure pn = 611.657 "normalization pressure";
         constant Real[2] a = {-13.9281690,34.7078238} "constant values";
         Real sigma = T/Tn "normalized temperature";
@@ -3810,7 +3811,6 @@
   </html>
   "));
       end sublimationPressure_T;
-
       annotation (                                                                                                    uses(Modelica(version="1.6")),
   Documentation(info="<html>
 <p>
@@ -3826,7 +3826,7 @@
 
     package Transport "transport properties for water according to IAPWS/IF97"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
 
       function visc_dTp "dynamic viscosity eta(d,T,p), industrial formulation"
         extends Modelica.Icons.Function;
@@ -4122,7 +4122,7 @@
     package Isentropic
       "functions for calculating the isentropic enthalpy from pressure p and specific entropy s"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
 
       function hofpT1
         "intermediate function for isentropic specific enthalpy in region 1"
@@ -4556,7 +4556,7 @@
         input SI.SpecificEntropy s "specific entropy";
         output SI.SpecificEnthalpy h "specific enthalpy";
       protected
-        SI.Temp_K Tsat "saturation temperature";
+        SI.Temperature Tsat "saturation temperature";
         SI.MassFraction x "dryness fraction";
         SI.SpecificEntropy sl "saturated liquid specific entropy";
         SI.SpecificEntropy sv "saturated vapour specific entropy";
@@ -4727,7 +4727,7 @@
     //work needed: (Pr,lam,eta) = f(d,T,p, region?)
     package Inverses "efficient inverses for selected pairs of variables"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
 
       //===================================================================
       //            Iterative version for some pairs/regions
@@ -5356,7 +5356,7 @@
 
     package ByRegion "simple explicit functions for one region only"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       function waterR1_pT "standard properties for region 1, (p,T) as inputs"
 
         extends Modelica.Icons.Function;
@@ -5462,7 +5462,7 @@
     package TwoPhase
       "steam properties in the two-phase rgion and on the phase boundaries"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
 
       function waterLiq_p "properties on the liquid phase boundary of region 4"
 
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/PartialMedium.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/PartialMedium.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/PartialMedium.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/PartialMedium.mo"	2022-03-10 09:58:19.652149403 +0000
@@ -3,9 +3,9 @@
   "Partial medium properties (base package of all media packages)"
   extends ThermalSeparation.Media.BaseMediumLiquid;
   //import SI = Modelica.SIunits;
-  extends Modelica.Icons.Library;
+  extends Modelica.Icons.Package;
 
-  // Constants to be set in Medium
+// Constants to be set in Medium
   constant String mediumName = "unusablePartialMedium" "Name of the medium";
   constant String substanceNames[:]={mediumName}
     "Names of the mixture substances. Set substanceNames={mediumName} if only one substance.";
@@ -25,7 +25,7 @@
     "Default mass fractions of medium";
   constant AbsolutePressure p_default=101325
     "Default value for pressure of medium (for initialization)";
-  constant Temperature T_default = Modelica.SIunits.Conversions.from_degC(20)
+  constant Temperature T_default = Modelica.Units.Conversions.from_degC(20)
     "Default value for temperature of medium (for initialization)";
   constant SpecificEnthalpy h_default = ThermalSeparation.Media.WaterBasedLiquid.BaseClasses.PartialMedium.specificEnthalpy_pTX(p_default, T_default, X_default)
     "Default value for specific enthalpy of medium (for initialization)";
@@ -119,11 +119,11 @@
     parameter Boolean preferredMediumStates=false
       "= true if StateSelect.prefer shall be used for the independent property variables of the medium"
       annotation (Hide=true, Evaluate=true, Dialog(tab="Advanced"));
-    Modelica.SIunits.Conversions.NonSIunits.Temperature_degC T_degC=
-        Modelica.SIunits.Conversions.to_degC(T)
+    Modelica.Units.NonSI.Temperature_degC T_degC=
+        Modelica.Units.Conversions.to_degC(T)
       "Temperature of medium in [degC]";
-    Modelica.SIunits.Conversions.NonSIunits.Pressure_bar p_bar=
-     Modelica.SIunits.Conversions.to_bar(p)
+    Modelica.Units.NonSI.Pressure_bar p_bar=
+     Modelica.Units.Conversions.to_bar(p)
       "Absolute pressure of medium in [bar]";
     parameter Boolean standardOrderComponents = true
       "if true, last element in components is computed from 1-sum(Xi)";
@@ -275,7 +275,7 @@
 
     output Density d "Density";
   algorithm
-   // d := density_phX(p, h, fill(0,0), phase);
+// d := density_phX(p, h, fill(0,0), phase);
      d :=
       ThermalSeparation.Media.WaterBasedLiquid.BaseClasses.IF97_Utilities.rho_ph(
         p,
@@ -373,7 +373,7 @@
       "2 for two-phase, 1 for one-phase, 0 if not known";
     output Density d "Density";
   algorithm
-   // d := density_psX(p, s, fill(0,0), phase);
+// d := density_psX(p, s, fill(0,0), phase);
      d :=
       ThermalSeparation.Media.WaterBasedLiquid.BaseClasses.IF97_Utilities.rho_ps(
         p,
@@ -755,7 +755,7 @@
     "Return overall the isothermal compressibility factor"
     extends Modelica.Icons.Function;
     input ThermodynamicState state "thermodynamic state record";
-    output Modelica.SIunits.IsothermalCompressibility kappa "Isothermal compressibility";
+    output Modelica.Units.SI.IsothermalCompressibility kappa "Isothermal compressibility";
   algorithm
     if dT_explicit then
       kappa :=
@@ -778,7 +778,8 @@
 
   function kappa = isothermalCompressibility
     "alias of isothermalCompressibility for user convenience";
-  // explicit derivative functions for finite element models
+  // explicit derivative functions for finite element models
+
   function density_derp_h
     "Return density derivative wrt pressure at const specific enthalpy"
     extends Modelica.Icons.Function;
@@ -936,7 +937,7 @@
    function bubbleEnthalpy "Return bubble point specific enthalpy"
       extends Modelica.Icons.Function;
       input SaturationProperties sat "saturation property record";
-      output Modelica.SIunits.SpecificEnthalpy hl "boiling curve specific enthalpy";
+      output Modelica.Units.SI.SpecificEnthalpy hl "boiling curve specific enthalpy";
    algorithm
      hl :=
        ThermalSeparation.Media.WaterBasedLiquid.BaseClasses.IF97_Utilities.BaseIF97.Regions.hl_p(
@@ -947,7 +948,7 @@
     function dewEnthalpy "Return dew point specific enthalpy"
       extends Modelica.Icons.Function;
       input SaturationProperties sat "saturation property record";
-      output Modelica.SIunits.SpecificEnthalpy hv "dew curve specific enthalpy";
+      output Modelica.Units.SI.SpecificEnthalpy hv "dew curve specific enthalpy";
 
     algorithm
       hv :=
@@ -959,7 +960,7 @@
     function bubbleEntropy "Return bubble point specific entropy"
     extends Modelica.Icons.Function;
     input SaturationProperties sat "saturation property record";
-    output Modelica.SIunits.SpecificEntropy sl "boiling curve specific entropy";
+    output Modelica.Units.SI.SpecificEntropy sl "boiling curve specific entropy";
     algorithm
       sl :=
         ThermalSeparation.Media.WaterBasedLiquid.BaseClasses.IF97_Utilities.BaseIF97.Regions.sl_p(
@@ -971,7 +972,7 @@
     replaceable partial function dewEntropy "Return dew point specific entropy"
     extends Modelica.Icons.Function;
     input SaturationProperties sat "saturation property record";
-    output Modelica.SIunits.SpecificEntropy sv "dew curve specific entropy";
+    output Modelica.Units.SI.SpecificEntropy sv "dew curve specific entropy";
     algorithm
       sv :=
         ThermalSeparation.Media.WaterBasedLiquid.BaseClasses.IF97_Utilities.BaseIF97.Regions.sv_p(
@@ -1236,10 +1237,10 @@
 
   function rho_boiling
     input Integer i;
-    output Modelica.SIunits.Density rho_boiling "density at boiling temperatur in kg/m3";
-   //constant values at 1 bar; O2, N2, SO2, H2O: Refprop, CO2: Refprop extrapolated, HF, HCl: Linde
+    output Modelica.Units.SI.Density rho_boiling "density at boiling temperatur in kg/m3";
+   //constant values at 1 bar; O2, N2, SO2, H2O: Refprop, CO2: Refprop extrapolated, HF, HCl: Linde
   protected
-    Modelica.SIunits.Density rho_boiling_const[:] = {807, 1142, 1300, 959};
+    Modelica.Units.SI.Density rho_boiling_const[:] = {807, 1142, 1300, 959};
   algorithm
     rho_boiling:=rho_boiling_const[i];
   end rho_boiling;
@@ -1248,7 +1249,7 @@
     package Init
       "Type, constants and menu choices to define initialization, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer NoInit=1;
       constant Integer InitialStates=2;
       constant Integer SteadyState=3;
@@ -1274,7 +1275,7 @@
     package ReferenceEnthalpy
       "Type, constants and menu choices to define reference enthalpy, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer ZeroAt0K=1;
       constant Integer ZeroAt25C=2;
       constant Integer UserDefined=3;
@@ -1300,7 +1301,7 @@
     package ReferenceEntropy
       "Type, constants and menu choices to define reference entropy, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer ZeroAt0K=1;
       constant Integer ZeroAt0C=2;
       constant Integer UserDefined=3;
@@ -1324,7 +1325,7 @@
     package pd
       "Type, constants and menu choices to define whether p or d are known, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer default=1;
       constant Integer p_known=2;
       constant Integer d_known=3;
@@ -1347,7 +1348,7 @@
     package Th
       "Type, constants and menu choices to define whether T or h are known, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer default=1;
       constant Integer T_known=2;
       constant Integer h_known=3;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/PartialMediumReaction.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/PartialMediumReaction.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/PartialMediumReaction.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/PartialMediumReaction.mo"	2022-03-10 09:58:19.520149386 +0000
@@ -2,8 +2,8 @@
 partial package PartialMediumReaction
   "Partial medium properties (base package of all media packages)"
   extends ThermalSeparation.Media.BaseMediumLiquidReaction;
-  import SI = Modelica.SIunits;
-  extends Modelica.Icons.Library;
+  import Modelica.Units.SI;
+  extends Modelica.Icons.Package;
 
   // Constants to be set in Medium
   constant String mediumName = "unusablePartialMedium" "Name of the medium";
@@ -25,7 +25,7 @@
     "Default mass fractions of medium";
   constant AbsolutePressure p_default=101325
     "Default value for pressure of medium (for initialization)";
-  constant Temperature T_default = Modelica.SIunits.Conversions.from_degC(20)
+  constant Temperature T_default = Modelica.Units.Conversions.from_degC(20)
     "Default value for temperature of medium (for initialization)";
   constant SpecificEnthalpy h_default = specificEnthalpy_pTX(p_default, T_default, X_default)
     "Default value for specific enthalpy of medium (for initialization)";
@@ -120,11 +120,11 @@
     parameter Boolean preferredMediumStates=false
       "= true if StateSelect.prefer shall be used for the independent property variables of the medium"
       annotation (Hide=true, Evaluate=true, Dialog(tab="Advanced"));
-    SI.Conversions.NonSIunits.Temperature_degC T_degC=
-        Modelica.SIunits.Conversions.to_degC(T)
+    Modelica.Units.NonSI.Temperature_degC T_degC=
+        Modelica.Units.Conversions.to_degC(T)
       "Temperature of medium in [degC]";
-    SI.Conversions.NonSIunits.Pressure_bar p_bar=
-     Modelica.SIunits.Conversions.to_bar(p)
+    Modelica.Units.NonSI.Pressure_bar p_bar=
+     Modelica.Units.Conversions.to_bar(p)
       "Absolute pressure of medium in [bar]";
     parameter Boolean standardOrderComponents = true
       "if true, last element in components is computed from 1-sum(Xi)";
@@ -1371,7 +1371,7 @@
     package Init
       "Type, constants and menu choices to define initialization, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer NoInit=1;
       constant Integer InitialStates=2;
       constant Integer SteadyState=3;
@@ -1397,7 +1397,7 @@
     package ReferenceEnthalpy
       "Type, constants and menu choices to define reference enthalpy, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer ZeroAt0K=1;
       constant Integer ZeroAt25C=2;
       constant Integer UserDefined=3;
@@ -1423,7 +1423,7 @@
     package ReferenceEntropy
       "Type, constants and menu choices to define reference entropy, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer ZeroAt0K=1;
       constant Integer ZeroAt0C=2;
       constant Integer UserDefined=3;
@@ -1447,7 +1447,7 @@
     package pd
       "Type, constants and menu choices to define whether p or d are known, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer default=1;
       constant Integer p_known=2;
       constant Integer d_known=3;
@@ -1470,7 +1470,7 @@
     package Th
       "Type, constants and menu choices to define whether T or h are known, as temporary solution until enumerations are available"
 
-      extends Modelica.Icons.Library;
+      extends Modelica.Icons.Package;
       constant Integer default=1;
       constant Integer T_known=2;
       constant Integer h_known=3;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/package.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/BaseClasses/package.mo"	2022-03-10 09:58:27.580150407 +0000
@@ -2,7 +2,7 @@
 package BaseClasses "Medium models for water"
 
 
-extends Modelica.Icons.Library;
+extends Modelica.Icons.Package;
   constant
   ThermalSeparation.Media.WaterBasedLiquid.BaseClasses.PartialWaterBased.FluidConstants[
                                                            1] waterConstants(
@@ -37,6 +37,7 @@
 //     "Water using the IF97 standard, explicit in p and T. Recommended for one-phase applications";
 
 
+
 annotation (Documentation(info="<html>
 <p>This package contains different medium models for water:</p>
 <ul>
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/CO2_H2O.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/CO2_H2O.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/CO2_H2O.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Media/WaterBasedLiquid/CO2_H2O.mo"	2022-03-10 09:58:19.260149353 +0000
@@ -1,7 +1,7 @@
 within ThermalSeparation.Media.WaterBasedLiquid;
 package CO2_H2O "water: CO2, pure H2O for Siemens PilotPlant"
-//adapted dynamic viscosity and heat capacity
-constant Real f_psat = 1;
+  //adapted dynamic viscosity and heat capacity
+  constant Real f_psat = 1;
 constant Boolean psat_Antoine = false;
        constant Real phi[nSubstance]= {1,2.26}
     "association factor of each substance, if this substance is to be the solvent - used for claculation of diffusion coeffcients";
@@ -31,60 +31,59 @@
      nSubstance= 2,
      henry={true,false});
 
- // N2,
- // H2O,
- // O2,
- // CO2,
- // SO2,
- // HCl,
- // HF
- //
- //
- // Tcrit
- //    126.2,
- //    647.14,
- //    154.58,
- //    304.12,
- //    430.8,
- //    324.6,
- //    461.15
- //
- //  pcrit
- //    3.398e6,
- //    2.2064e7,
- //    5.043e6,
- //    7.374e6,
- //    7.884e6,
- //    8.31e6,
- //    6.48e6,
- //
- // Vcrit
- // 90.1e-6,
- // 55.95e-6,
- // 73.37e-6,
- // 94.07e-6,
- // 122e-6,
- // 222e-6,
- // 3448e-6,
- //
- // omega
- // 0.037,
- // 0.344,
- // 0.022,
- // 0.225,
- // 0.245,
- // 0.131,
- // 0.329
- //
- // mu
- // 0,
- // 1.8
- // 0,
- // 0,
- // 1.6
- // 0,
- // 0
-
+// N2,
+  // H2O,
+  // O2,
+  // CO2,
+  // SO2,
+  // HCl,
+  // HF
+  //
+  //
+  // Tcrit
+  //    126.2,
+  //    647.14,
+  //    154.58,
+  //    304.12,
+  //    430.8,
+  //    324.6,
+  //    461.15
+  //
+  //  pcrit
+  //    3.398e6,
+  //    2.2064e7,
+  //    5.043e6,
+  //    7.374e6,
+  //    7.884e6,
+  //    8.31e6,
+  //    6.48e6,
+  //
+  // Vcrit
+  // 90.1e-6,
+  // 55.95e-6,
+  // 73.37e-6,
+  // 94.07e-6,
+  // 122e-6,
+  // 222e-6,
+  // 3448e-6,
+  //
+  // omega
+  // 0.037,
+  // 0.344,
+  // 0.022,
+  // 0.225,
+  // 0.245,
+  // 0.131,
+  // 0.329
+  //
+  // mu
+  // 0,
+  // 1.8
+  // 0,
+  // 0,
+  // 1.6
+  // 0,
+  // 0
        constant Integer n = nSubstance "number of components";
      constant SI.MolarMass MM_substances[n]=MMX;
 
@@ -95,9 +94,8 @@
     p(stateSelect=if (pT_explicit or ph_explicit) and preferredMediumStates then StateSelect.prefer else StateSelect.default))
     "Base properties of water"
 
-   // SaturationProperties sat(Tsat(start=300.0), psat(start=1.0e5))
-   //   "saturation temperature and pressure";
-
+// SaturationProperties sat(Tsat(start=300.0), psat(start=1.0e5))
+      //   "saturation temperature and pressure";
           CalcSpecificEnthalpy calcSpecificEnthalpy(T0=T0, p=p, T=T, x=x);
 
   /***density and enthalpy ***/
@@ -134,10 +132,10 @@
     Real test[42];
     final parameter Integer counter[6]={0, 7, 14, 21, 28, 35};
 
-    //dynamic viscosity for each component in the liquid phase
-    //if a pure component does not exist as liquid at system pressure and temperature any value can be given
-    //as long as the corresponding entry in the constant eta_pure is false
-
+//dynamic viscosity for each component in the liquid phase
+    //if a pure component does not exist as liquid at system pressure and temperature any value can be given
+    //as long as the corresponding entry in the constant eta_pure is false
+    
   public
     SI.SpecificHeatCapacity cp_solution= 2.8571*T + 2505.7;
 
@@ -150,14 +148,15 @@
     Real test2=max(0,if time< 1 then 1 else 1-(time-1)/100);
 
   equation
-    sigma =  235.8e-3*(1 - Theta)^1.256*(1 - 0.625*(1 - Theta));//surfaceTension(sat);
-  MM=max(1e-5, sum(x.*MM_substances));
+    sigma =  235.8e-3*(1 - Theta)^1.256*(1 - 0.625*(1 - Theta));
+//surfaceTension(sat);
+      MM = max(1e-5, sum(x .* MM_substances));
 
   /*** enthalpy ***/
-        h=calcSpecificEnthalpy.h;//x[2]*4180*MM_substances[2]*(T-0) + x[1]*21e3;
-
-          /*** density ***/
-        d = d_water;
+        h=calcSpecificEnthalpy.h;
+//x[2]*4180*MM_substances[2]*(T-0) + x[1]*21e3;
+/*** density ***/
+      d = d_water;
       pi = p/data.PSTAR1;
       pi1 = 7.1000000000000 - pi;
       tau = data.TSTAR1 /T;
@@ -289,7 +288,7 @@
   /*** enthalpy ***/
   input SI.Pressure p;
   input SI.Temperature T;
-  //input SI.MoleFraction x[n];
+  //input SI.MoleFraction x[n];
   ThermalSeparation.Units.MolarEnthalpy h[n];
 
   protected
@@ -353,11 +352,10 @@
   o_s[6] = o_s[4]*o_s[4];
   o_s[7] = 14.9151086135300*o_s[6];
   o_s[8] = 405113.40542057 + o_s[5] + o_s[7];
-
-// if psat_Antoine then
-//    /*** Antoine Siemens ***/
-//  p_sat = fill(exp(24.9022-5342.9/(T+21.2826)),n);
-//  else
+// if psat_Antoine then
+//    /*** Antoine Siemens ***/
+//  p_sat = fill(exp(24.9022-5342.9/(T+21.2826)),n);
+//  else
       p_sat = fill(f_psat,n).*fill(16.0e6*o_s[8]*o_s[8]*o_s[8]*o_s[8]*1/(3.2325550322333e6 -
         12020.8247024700*o_s[4] + 17.0738469400920*o_s[6] + (-4.0*(-724213.16703206
          + 1167.05214527670*o_s[4] + o_s[6])*o_s[8] + (-3.2325550322333e6 +
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/AbsorberGamma.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/AbsorberGamma.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/AbsorberGamma.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/AbsorberGamma.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -1,13 +1,13 @@
 within ThermalSeparation.PhaseEquilibrium.ActivityCoefficient;
 model AbsorberGamma
-  "frickel gamma des Absorbers (nur für CO2-H2O Modell) + komische Definition von xGas"
+  "frickel gamma des Absorbers (nur fÃ¼r CO2-H2O Modell) + komische Definition von xGas"
   extends BaseActivityCoefficient;
   parameter Real gamma_water = 1.0;
   parameter Real factor_gamma_CO2 = 1.0;
 equation
 
 //der Term (1+x_l[j,1]) beinhaltet die etwas seltsame Definition von xGas --> in gamma reingepackt
-//damit man das nicht in BaseStage ändern muß (dann würde das ja für alles gelten)
+//damit man das nicht in BaseStage Ã¤ndern muÃŸ (dann wÃ¼rde das ja fÃ¼r alles gelten)
        gamma[1] = factor_gamma_CO2*(exp(exp(8.99511377 - 0.0203825*T + 2.23e-5*T^2)*x_l[1]))/(1+x_l[1]);
         //  gamma_aux[j,1] = exp(exp(8.99511377 - 0.0203825*T[j] + 2.23e-5*T[j]^2)*x_l[j,1]);
     gamma[2]=gamma_water;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/AbsorberGammaMediengetauscht.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/AbsorberGammaMediengetauscht.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/AbsorberGammaMediengetauscht.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/AbsorberGammaMediengetauscht.mo"	2022-03-10 09:58:12.524148500 +0000
@@ -1,11 +1,11 @@
 within ThermalSeparation.PhaseEquilibrium.ActivityCoefficient;
 model AbsorberGammaMediengetauscht
-  "frickel gamma des Absorbers (nur für CO2-H2O Modell) + komische Definition von xGas, getauschte Medien"
+  "frickel gamma des Absorbers (nur fÃ¼r CO2-H2O Modell) + komische Definition von xGas, getauschte Medien"
   extends BaseActivityCoefficient;
 
 equation
 //der Term (1+x_l[j,1]) beinhaltet die etwas seltsame Definition von xGas --> in gamma reingepackt
-//damit man das nicht in BaseStage ändern muß (dann würde das ja für alles gelten)
+//damit man das nicht in BaseStage Ã¤ndern muÃŸ (dann wÃ¼rde das ja fÃ¼r alles gelten)
        gamma[3] = (exp(exp(8.99511377 - 0.0203825*T + 2.23e-5*T^2)*x_l[2]))/(1+x_l[2]);
         //  gamma_aux[j,1] = exp(exp(8.99511377 - 0.0203825*T[j] + 2.23e-5*T[j]^2)*x_l[j,1]);
     gamma[1]=1;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/DesorberGamma.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/DesorberGamma.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/DesorberGamma.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/DesorberGamma.mo"	2022-03-10 09:58:12.524148500 +0000
@@ -1,11 +1,11 @@
 within ThermalSeparation.PhaseEquilibrium.ActivityCoefficient;
 model DesorberGamma
-  "frickel gamma des Desorbers (nur für CO2-H2O Modell) + komische Definition von xGas"
+  "frickel gamma des Desorbers (nur fÃ¼r CO2-H2O Modell) + komische Definition von xGas"
   extends BaseActivityCoefficient;
 equation
 
 //der Term (1+x_l[j,1]) beinhaltet die etwas seltsame Definition von xGas --> in gamma reingepackt
-//damit man das nicht in BaseStage ändern muß (dann würde das ja für alles gelten)
+//damit man das nicht in BaseStage Ã¤ndern muÃŸ (dann wÃ¼rde das ja fÃ¼r alles gelten)
 
        gamma[1] = 1*(exp(exp(8.99511377 - 0.0203825*T + 2.23e-5*T^2)*x_l[1]))/(1+x_l[1]);
         //  gamma_aux[j,1] = exp(exp(8.99511377 - 0.0203825*T[j] + 2.23e-5*T[j]^2)*x_l[j,1]);
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/DesorberGammaBremsen.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/DesorberGammaBremsen.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/DesorberGammaBremsen.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/DesorberGammaBremsen.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -1,6 +1,6 @@
 within ThermalSeparation.PhaseEquilibrium.ActivityCoefficient;
 model DesorberGammaBremsen
-  "frickel gamma des Desorbers (nur für CO2-H2O Modell) + komische Definition von xGas + bremsen"
+  "frickel gamma des Desorbers (nur fÃ¼r CO2-H2O Modell) + komische Definition von xGas + bremsen"
   extends BaseActivityCoefficient;
 Real bremsen(start=0);
 Real K=1;
@@ -11,7 +11,7 @@
 equation
 
 //der Term (1+x_l[j,1]) beinhaltet die etwas seltsame Definition von xGas --> in gamma reingepackt
-//damit man das nicht in BaseStage ändern muß (dann würde das ja für alles gelten)
+//damit man das nicht in BaseStage Ã¤ndern muÃŸ (dann wÃ¼rde das ja fÃ¼r alles gelten)
 //bremsen[j] = (max(1/0.0001,1/x_l_total[j,3])^0.3)-10000^0.3 ;
 der(bremsen)=K* ((max(1/bremsenStart,1/x_l[3])^1)-(1/bremsenStart)^1 - bremsen);
        gamma[1] = 1*(exp(exp(8.99511377 - 0.0203825*T + 2.23e-5*T^2)*x_l[1]))/(1+x_l[1])+bremsen;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/Margules.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/Margules.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/Margules.mo"	2022-03-10 09:57:37.932144117 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/Margules.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -7,7 +7,7 @@
 
  // parameter Real a[nS+5] = fill(100,nS+5)
   //  "vector with binary coefficients: for example: {a12, a13, a23}";
-  //                                        //hier nochmal gucken.. wusste nicht genau was das ist und hab es so geändert dass es läuft!
+  //                                        //hier nochmal gucken.. wusste nicht genau was das ist und hab es so geÃ¤ndert dass es lÃ¤uft!
   parameter Real a[aux2] = fill(100,aux2);
 protected
   Real A[nS,nS] "matrix with the binary coefficients";
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/UNIFAC.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/UNIFAC.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/UNIFAC.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/ActivityCoefficient/UNIFAC.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -1,25 +1,25 @@
 within ThermalSeparation.PhaseEquilibrium.ActivityCoefficient;
 model UNIFAC
-            //** Alle Werte sowie Beispiel in Gmehling & Kolbe S. 246 ff.*** // Nur für binäre Gemische
+            //** Alle Werte sowie Beispiel in Gmehling & Kolbe S. 246 ff.*** // Nur fÃ¼r binÃ¤re Gemische
   extends BaseActivityCoefficient;
 
-   //müssen ins Medienmodel:
+   //mÃ¼ssen ins Medienmodel:
    parameter Integer SG_1=2;//Anzahl der verschiedenen Strukturgruppen einer Komponente (z.B. '1'=n-Hexan, '2'=Butanon)
    parameter Integer SG_2=3;
    parameter Integer SG_v=3;//Anzahl der insgesamt verschiedenen Strukturgruppen
-   parameter Real Q_m[SG_v]={0.848,0.54,1.488};//relative van der Waalsschen Gruppenoberflächen
+   parameter Real Q_m[SG_v]={0.848,0.54,1.488};//relative van der Waalsschen GruppenoberflÃ¤chen
    parameter Real Q_1[SG_1]={0.848,0.54};
    parameter Real Q_2[SG_2]={0.848,0.54,1.488};
    parameter Real R_m[SG_v]={0.9011,0.6744,1.6724};//relative van der Waalsschen Gruppenvolumina
 //    parameter Real HSG_1[SG_1]={1,0,0};// '1'=Hauptgruppe ; '0' = Untergruppe
 //    parameter Real HSG_2[SG_2]={0,0,1};
    //parameter Real b_1[SG_1,SG_2]={{0,1},{
-   parameter Real A_m[SG_v,SG_v]={{0,0,476.4},{0,0,476.4},{26.76,26.76,0}}; //Matrix mit Werten für die Gruppenwechselwirkungsparameter der Hauptstrukturgruppen
+   parameter Real A_m[SG_v,SG_v]={{0,0,476.4},{0,0,476.4},{26.76,26.76,0}}; //Matrix mit Werten fÃ¼r die Gruppenwechselwirkungsparameter der Hauptstrukturgruppen
    parameter Real A_1[SG_1,SG_1]={{0,0},{0,0}};
    parameter Real A_2[SG_2,SG_2]={{0,0,476.4},{0,0,476.4},{26.76,26.76,0}};
 
 //    parameter Real A_21[SG_2,SG_1]={{0,0},{0,0},{26.76,26.76}};
-   parameter Real v[nS,SG_v]={{2,4,0},{1,1,1}}; // Anzahl der einzelnen Strukturgruppen innerhalb eines Moleküls
+   parameter Real v[nS,SG_v]={{2,4,0},{1,1,1}}; // Anzahl der einzelnen Strukturgruppen innerhalb eines MolekÃ¼ls
 
 protected
    Real psi_m[SG_v,SG_v];
@@ -32,8 +32,8 @@
    Real theta_m[SG_v];
    Real theta_1[SG_1];
    Real theta_2[SG_2];
-   Real ln_Gamma_m[SG_v];//Gruppenaktivitätskoeffizient der Mischung
-   Real ln_Gamma_r_1[SG_1];//Gruppenaktivitätskoeffizient der Reinstoffe
+   Real ln_Gamma_m[SG_v];//GruppenaktivitÃ¤tskoeffizient der Mischung
+   Real ln_Gamma_r_1[SG_1];//GruppenaktivitÃ¤tskoeffizient der Reinstoffe
    Real ln_Gamma_r_2[SG_2];
    Real V[nS];
    Real F[nS];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/CO2_CO2_MEA_StartUpReboiler_newFormulation.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/CO2_CO2_MEA_StartUpReboiler_newFormulation.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/CO2_CO2_MEA_StartUpReboiler_newFormulation.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/CO2_CO2_MEA_StartUpReboiler_newFormulation.mo"	2022-03-10 09:58:18.828149300 +0000
@@ -5,8 +5,8 @@
 Real eq_koeff[9];
 Real alpha(start=0.5); // loading in mol CO2 / mol MEA
 input Boolean startUp;
-Modelica.SIunits.Temperature Theta = T-273.15;
-Modelica.SIunits.Pressure p_sat_H2O(start=1.3e5);
+Modelica.Units.SI.Temperature Theta = T-273.15;
+Modelica.Units.SI.Pressure p_sat_H2O(start=1.3e5);
 
    parameter Real omega_k=0.05 "large value if change between constant and variable shall be steep";
    parameter Real omega_time = 500 "Wendepunkt der tanh-Funktion";
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/CO2_CO2_MEA_StartUpReboiler_newFormulation_Des.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/CO2_CO2_MEA_StartUpReboiler_newFormulation_Des.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/CO2_CO2_MEA_StartUpReboiler_newFormulation_Des.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/CO2_CO2_MEA_StartUpReboiler_newFormulation_Des.mo"	2022-03-10 09:58:18.820149299 +0000
@@ -5,8 +5,8 @@
 Real eq_koeff[9];
 Real alpha(start=0.5); // loading in mol CO2 / mol MEA
 //input Boolean startUp;
-Modelica.SIunits.Temperature Theta = T-273.15;
-Modelica.SIunits.Pressure p_sat_H2O(start=1.3e5);
+Modelica.Units.SI.Temperature Theta = T-273.15;
+Modelica.Units.SI.Pressure p_sat_H2O(start=1.3e5);
 
    parameter Real omega_k=0.05 "large value if change between constant and variable shall be steep";
    parameter Real omega_time = 500 "Wendepunkt der tanh-Funktion";
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/LiquidPhase/SaturationFugacitycoefficient.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/LiquidPhase/SaturationFugacitycoefficient.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/LiquidPhase/SaturationFugacitycoefficient.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/LiquidPhase/SaturationFugacitycoefficient.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -24,10 +24,10 @@
 Real f2[n,nS];
 Real f3[n,nS];
 Real Summe[n,nS];
-Real B[n,nS] "in m³/mol";// zweite Virialkoeffizient des Reinstoffs
+Real B[n,nS] "in mÂ³/mol";// zweite Virialkoeffizient des Reinstoffs
 Real R = Modelica.Constants.R*1000;
 Real pcrit_bar[nS];
-//Tsonopoulos Parameter für 2ten Virialkoeff.
+//Tsonopoulos Parameter fÃ¼r 2ten Virialkoeff.
 Real a[nS]= satFugacityCoeff_TsonopoulosConstants.a;
 Real b[nS]= satFugacityCoeff_TsonopoulosConstants.b;
 
@@ -53,9 +53,9 @@
 
   Summe[m,k] = f0[m,k] + omega[k]*f1[m,k]+a[k]*f2[m,k]+b[k]*f3[m,k];
 
-  B[m,k] = Modelica.Constants.R*Tcrit[k]/pcrit[k]*Summe[m,k] "in m³/mol";
+  B[m,k] = Modelica.Constants.R*Tcrit[k]/pcrit[k]*Summe[m,k] "in mÂ³/mol";
 
-  // Berechnung des Fugazitätskoeffizienten
+  // Berechnung des FugazitÃ¤tskoeffizienten
 help1[m,k]=(1-exp(B[m,k]*1e3*p_sat[m,k]/R/T[m]))/3;
 help2[m,k]=exp(B[m,k]*1e3*p_sat[m,k]/R/T[m]);
   phi_sat_aux[m,k]=1-help1[m,k];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/LiquidPhase/SaturationFugacitycoefficient2.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/LiquidPhase/SaturationFugacitycoefficient2.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/LiquidPhase/SaturationFugacitycoefficient2.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/LiquidPhase/SaturationFugacitycoefficient2.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -21,10 +21,10 @@
 Real f2[nS];
 Real f3[nS];
 Real Summe[nS];
-Real B[nS] "in m³/mol";// zweite Virialkoeffizient des Reinstoffs
+Real B[nS] "in mÂ³/mol";// zweite Virialkoeffizient des Reinstoffs
 Real R = Modelica.Constants.R*1000;
 Real pcrit_bar[nS];
-//Tsonopoulos Parameter für 2ten Virialkoeff.
+//Tsonopoulos Parameter fÃ¼r 2ten Virialkoeff.
 Real a[nS]= satFugacityCoeff_TsonopoulosConstants2.a;
 Real b[nS]= satFugacityCoeff_TsonopoulosConstants2.b;
 
@@ -51,9 +51,9 @@
   Summe[k] = f0[k] + omega[k]*f1[k]+a[k]*f2[k]+b[k]*f3[k];
 
   B[k] = Modelica.Constants.R*max(1e-6,Tcrit[k])/max(1e-6,pcrit[k])*Summe[k]
-      "in m³/mol";
+      "in mÂ³/mol";
 
-  // Berechnung des Fugazitätskoeffizienten
+  // Berechnung des FugazitÃ¤tskoeffizienten
 help1[k]=(1-exp(B[k]*1e3*p_sat[k]/R/T))/3;
 help2[k]=exp(B[k]*1e3*p_sat[k]/R/T);
   phi_sat[k]=1-help1[k];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/LiquidPhase/TestModell.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/LiquidPhase/TestModell.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/LiquidPhase/TestModell.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/LiquidPhase/TestModell.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -9,7 +9,7 @@
 // parameter Real omega[nS] = MediumVapour.omega;
 // parameter SI.Temperature Tcrit[nS] = MediumVapour.Tcrit;
 // parameter SI.Pressure pcrit[nS] = MediumVapour.pcrit;
-// // Wert muss im Medium package wie Tcrit und pcrit ergänzt werden (ThermalSeparation.Media.ModelicaMedia.IdealGases.Common.MixtureGasNasa)
+// // Wert muss im Medium package wie Tcrit und pcrit ergÃ¤nzt werden (ThermalSeparation.Media.ModelicaMedia.IdealGases.Common.MixtureGasNasa)
 // parameter Integer NoOfEq[nS] = {1,6};
 
 parameter SI.Temperature T[n] = fill(343.15,n);//{343.15};
@@ -18,7 +18,7 @@
 parameter Real omega[nS] = {Medium.omega[reorgLiq[i]] for i in 1:nS};
 parameter SI.Temperature Tcrit[nS] = {Medium.Tcrit[reorgLiq[i]] for i in 1:nS};
 parameter SI.Pressure pcrit[nS] = {Medium.pcrit[reorgLiq[i]] for i in 1:nS};
-// Wert muss im Medium package wie Tcrit und pcrit ergänzt werden (ThermalSeparation.Media.ModelicaMedia.IdealGases.Common.MixtureGasNasa)
+// Wert muss im Medium package wie Tcrit und pcrit ergÃ¤nzt werden (ThermalSeparation.Media.ModelicaMedia.IdealGases.Common.MixtureGasNasa)
 parameter Integer NoOfEq[nS] = {4,6};
 parameter Integer reorgLiq[nS] = {1,2};
 parameter Boolean inertLiquid[nS]=fill(false,2);
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/Cubic.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/Cubic.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/Cubic.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/Cubic.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -7,8 +7,8 @@
   parameter Real kij[nS,nS]= fill(0.01,nS,nS)
     "binary interaction coefficient for Redlich-Kwong equation";
 
-  parameter Integer u=1 "nach Redlich Kwong Näherung";
-  parameter Integer w=0 "nach Redlich Kwong Näherung";
+  parameter Integer u=1 "nach Redlich Kwong NÃ¤herung";
+  parameter Integer w=0 "nach Redlich Kwong NÃ¤herung";
 
 protected
   Real h[n,nS] "Hilfsvariable ohne phys. Bedeutung";
@@ -20,8 +20,8 @@
   Real B[n] "Mischkoeffizient";
   Real B1[n] "eigentlich B*";
   Real A1[n] "eigentlich A*";
-  Real a[n,nS] "Konstanten nach Redlich Kwong für einzelne Komponenten";
-  Real b[n,nS] "Konstanten nach Redlich Kwong für einzelne Komponenten";
+  Real a[n,nS] "Konstanten nach Redlich Kwong fÃ¼r einzelne Komponenten";
+  Real b[n,nS] "Konstanten nach Redlich Kwong fÃ¼r einzelne Komponenten";
   Real am[n] "Konstanten a des Gemischs";
   Real bm[n] "Konstanten b des Gemischs";
 Real test[n,nS];
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/LeeKesler.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/LeeKesler.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/LeeKesler.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/LeeKesler.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -1,9 +1,9 @@
 within ThermalSeparation.PhaseEquilibrium.FugacityCoefficient.VapourPhase;
 model LeeKesler
 /*Die Universelle Gaskonstante wird im folgenden in der Einheit [bar*cm3/mol*K] verwendet.
-Daraus folgt der Faktor 10 für die Umrechnung aus [J/mol*K]. */
+Daraus folgt der Faktor 10 fÃ¼r die Umrechnung aus [J/mol*K]. */
 /*Der Druck und der kritische Druck wird in [bar] verwendet. Die Eingaben sind in [Pa]. 
-Es folgt ein Faktor 1e5 für die Umrechnung!*/
+Es folgt ein Faktor 1e5 fÃ¼r die Umrechnung!*/
 /*Das Volumen wird in [cm3/mol] verwendet. Da die Eingaben in [m3/mol] sind, muss ein Faktor von 1e6 verwendet werden*/
 
 extends BaseFugacityCoefficient;
@@ -13,19 +13,19 @@
   //   parameter Integer a = inter[nS-1]
  //   "number of binary interaction parameters depending on the number of substances";
 
-/*Die Variablen y1-y6 sind Tabellenwerte, die nach dem ersten Durchlauf mit Hilfe von Trm und prm bestimmt werden müssen*/
+/*Die Variablen y1-y6 sind Tabellenwerte, die nach dem ersten Durchlauf mit Hilfe von Trm und prm bestimmt werden mÃ¼ssen*/
 /*** Die Tabellennummern beziehen sich auf: Reid, Prausnitz: The Properties of Gases & Liquids, 4th edition, McGraw-Hill,
 die Gleichungen sind in Tabelle 5-13 (S. 145) aufgelistet. ***/
   Real y1[n];//=fill(-0.001,n) "
-   //log (f/p)(0) aus Tabelle für reduzierte Temp und Druck des Gemischs!, Tabelle 5-6";
+   //log (f/p)(0) aus Tabelle fÃ¼r reduzierte Temp und Druck des Gemischs!, Tabelle 5-6";
   Real y2[n];//=fill(0.0015,n) "=  {-0.014}
-   // log (f/p)(1) aus Tabelle für reduzierte Temp und Druck des Gemischs!, Tabelle 5-7";
+   // log (f/p)(1) aus Tabelle fÃ¼r reduzierte Temp und Druck des Gemischs!, Tabelle 5-7";
   Real y3[n];//=fill(0.01,n) "= {0.466} (H0-H/RTcm)0 aus Tabelle 5-2!";
   Real y4[n];//=fill(-0.001,n) "= {0.433} (H0-H/RTcm)1 aus Tabelle 5-3";
   Real y5[n];//=fill(0.998,n) "0.8455}
-   // Z0 Zur Bestimmung des Kompressibiltätsfaktors des Gemischs, Tabelle 3-2";
+   // Z0 Zur Bestimmung des KompressibiltÃ¤tsfaktors des Gemischs, Tabelle 3-2";
   Real y6[n];//=fill(0.001,n) "={-0.0335}
-   // Z1 Zur Bestimmung des Kompressibiltätsfaktors des Gemischs, Tabelle 3-3";
+   // Z1 Zur Bestimmung des KompressibiltÃ¤tsfaktors des Gemischs, Tabelle 3-3";
 
   Real Tcm[n] "[K]";
   Real pcm[n] "[bar]";
@@ -59,14 +59,14 @@
 
 // initial equation
 //    //Erstellen der kij Matrix:
-//      //Erstellen einer Matrix aus den binären Interaktionsparametern
+//      //Erstellen einer Matrix aus den binÃ¤ren Interaktionsparametern
 //       for i in 1:nS loop
 //         for m in i:nS loop
 //           if i==m then
-//             //die Einträge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
+//             //die EintrÃ¤ge auf der Diagonalen, werden auf irgendeinen Wert gesetzt, da eh nie benutzt
 //             kij[i,m] = 0.07;
 //           else
-//             //die Einträge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
+//             //die EintrÃ¤ge des Vektors werden an die richtigen Stellen auf der Matrix verteilt
 //             kij[i,m] = kij_user[m-2+i];
 //             end if;
 //           end for;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/PengRobinson.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/PengRobinson.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/PengRobinson.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/PengRobinson.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -1,6 +1,6 @@
 within ThermalSeparation.PhaseEquilibrium.FugacityCoefficient.VapourPhase;
 model PengRobinson
-                      //Lüdecke, Lüdecke, Thermodynamik S.566 / Mischungsgrößen: Gmehling & Kolbe Thermodynamik S43.
+                      //LÃ¼decke, LÃ¼decke, Thermodynamik S.566 / MischungsgrÃ¶ÃŸen: Gmehling & Kolbe Thermodynamik S43.
   extends BaseFugacityCoefficient;
  parameter Real kij[aux2]= fill(0.0267,aux2);
  final parameter Integer aux[:] = {1,3,6,10,15, 21, 28, 36, 45};
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/TestModell.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/TestModell.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/TestModell.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/TestModell.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -15,7 +15,7 @@
 
   replaceable package MediumVapour = 
       ThermalSeparation.Media.IdealGasMixtures.N2_H2O;
-      //für N2-CH4 Mischung: kij = 0.0267
+      //fÃ¼r N2-CH4 Mischung: kij = 0.0267
 
 //  Virial_SecondVirialCoefficient Virial_Coeff(redeclare replaceable package
 //       MediumVapour =
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/Virial_SecondVirialCoefficient.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/Virial_SecondVirialCoefficient.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/Virial_SecondVirialCoefficient.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/FugacityCoefficient/VapourPhase/Virial_SecondVirialCoefficient.mo"	2022-03-10 09:58:12.520148500 +0000
@@ -20,7 +20,7 @@
   input SI.Temperature T[n] "[K]";
   input Integer NoOfEq[nS];
 
-  output Real B[n,nS,nS] "in m³/mol";
+  output Real B[n,nS,nS] "in mÂ³/mol";
 
   Virial_TsonopoulosConstants TsonopoulosConstants(redeclare replaceable
       package MediumVapour = 
@@ -44,7 +44,7 @@
   Real f3[n,nS,nS];
   Real Summe[n,nS,nS];
 
-//Tsonopoulos Parameter für 2ten Virialkoeff.
+//Tsonopoulos Parameter fÃ¼r 2ten Virialkoeff.
   Real ai[nS]= TsonopoulosConstants.a;
   Real bi[nS]= TsonopoulosConstants.b;
 
@@ -103,14 +103,14 @@
       if i==k then
 
         Tr[j,i,k]=  T[j]/Tci[i];
-        B[j,i,k] = Modelica.Constants.R*Tci[i]/pci[i]*Summe[j,i,k] "in m³/mol";
+        B[j,i,k] = Modelica.Constants.R*Tci[i]/pci[i]*Summe[j,i,k] "in mÂ³/mol";
         //Bij[i,j]= ((0.083-(0.422/Tr[i,j]^(1/6)))+omega[i]*(0.139-(0.172/Tr[i,j]^(4.2))))*(Modelica.Constants.R*Tci[i])/pci[i];
       else
 
         Tr[j,i,k]=  T[j]/Tcik[i,k];
 
         B[j,i,k] = Modelica.Constants.R*Tcik[i,k]/pcik[i,k]*Summe[j,i,k]
-            "in m³/mol";
+            "in mÂ³/mol";
 
         //Bij[i,j]= ((0.083-(0.422/Tr[i,j]^(1/6)))+omegaij[i,j]*(0.139-(0.172/Tr[i,j]^(4.2))))*(Modelica.Constants.R*Tcij[i,j])/pcij[i,j];
       end if;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/H2O_CO2_MEA.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/H2O_CO2_MEA.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/H2O_CO2_MEA.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/H2O_CO2_MEA.mo"	2022-03-10 09:58:18.804149296 +0000
@@ -5,8 +5,8 @@
 
 Real eq_koeff[9];
 Real alpha(start=0.5); // loading in mol CO2 / mol MEA
-Modelica.SIunits.Pressure p_sat_H2O(start=1.3e5);
-Modelica.SIunits.Temperature Theta = T-273.15;
+Modelica.Units.SI.Pressure p_sat_H2O(start=1.3e5);
+Modelica.Units.SI.Temperature Theta = T-273.15;
 
    parameter Real omega_k=0.05
     "large value if change between constant and variable shall be steep";
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/H2O_CO2_MEA_startUp.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/H2O_CO2_MEA_startUp.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/H2O_CO2_MEA_startUp.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/H2O_CO2_MEA_startUp.mo"	2022-03-10 09:58:18.792149294 +0000
@@ -5,8 +5,8 @@
 
 Real eq_koeff[9];
 Real alpha(start=0.5); // loading in mol CO2 / mol MEA
-Modelica.SIunits.Pressure p_sat_H2O(start=1.3e5);
-Modelica.SIunits.Temperature Theta = T-273.15;
+Modelica.Units.SI.Pressure p_sat_H2O(start=1.3e5);
+Modelica.Units.SI.Temperature Theta = T-273.15;
 
    parameter Real omega_k=0.05
     "large value if change between constant and variable shall be steep";
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/package.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PhaseEquilibrium/package.mo"	2022-03-10 09:58:18.840149301 +0000
@@ -1,7 +1,7 @@
 within ThermalSeparation;
 package PhaseEquilibrium "Models for the Phase Equilibrium between the two Phases"
       extends Icons.Library.Orange;
-  import SI = Modelica.SIunits;
+  import Modelica.Units.SI;
 
 
   model CO2_CO2_MEA_StartUpReboiler "StartUp CO2-CO2-MEA eq. incl. reaction for Reboiler"
@@ -10,8 +10,8 @@
   Real eq_koeff[9];
   Real alpha(start=0.5); // loading in mol CO2 / mol MEA
   input Boolean startUp;
-  Modelica.SIunits.Pressure p_sat_H2O(start=1.3e5);
-  Modelica.SIunits.Temperature Theta = T-273.15;
+  Modelica.Units.SI.Pressure p_sat_H2O(start=1.3e5);
+  Modelica.Units.SI.Temperature Theta = T-273.15;
 
      parameter Real omega_k=0.05 "large value if change between constant and variable shall be steep";
      parameter Real omega_time = 500 "Wendepunkt der tanh-Funktion";
@@ -52,6 +52,26 @@
 
   end CO2_CO2_MEA_StartUpReboiler;
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 annotation(preferedView="info", Documentation(info="<html>
 <p><h4><font color=\"#008000\">Phase Equilibrium</font></h4></p>
 <p>Two phases are in equilibrium if the fugacities are the same: fiV = fiL. The vapour fugacity can be expressed in terms of the partial pressure, the fugacity coefficient and the Poynting factor. The liquid fugacity depends on the liquid composition, the saturation fugacity coefficient, the activity coefficient &gamma;i and the saturation pressure.</p>
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PackedColumn/NominalLinear.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PackedColumn/NominalLinear.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PackedColumn/NominalLinear.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PackedColumn/NominalLinear.mo"	2022-03-10 09:58:12.528148502 +0000
@@ -23,7 +23,7 @@
    Fr[j] =max(0, w_eff_l[j]*w_eff_l[j]/(geometry.S*Modelica.Constants.g_n));
    Ft[j] = 29.12 * (We[j]*Fr[j])^0.15*geometry.S^0.359/(Re[j]^0.2*geometry.eps^0.6*(1-0.93*0.62)*sin_theta^0.3);
  end for;
-  // die max-Abfrage braucht man, für den Fall, daß man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall würde sonst ein Volumenstrom in die falsche Richtung entstehen
+  // die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
 
   for j in 1:n - 1 loop
       Vdot[j] = max(0,sign(p[j] - p[j + 1])*max(0, (abs(p[j] - p[j + 1])/K)));
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PackedColumn/Particlemodel.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PackedColumn/Particlemodel.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PackedColumn/Particlemodel.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PackedColumn/Particlemodel.mo"	2022-03-10 09:58:12.528148502 +0000
@@ -20,10 +20,10 @@
   Real f_out "dimensionless factor for the outlet";
 Real test= 0.05;
 equation
-//Gleichung aus Engel: Fluiddynamik in Füllkörper- und Packungskolonnen ..., Gl. (10); in der Gleichung (3.13b) von Forner ist wohl ein Fehler (h_j)
-//Volker Engel: "Fluiddynamik in Füllkörper- und Packungskolonnen für
-//Gas/Flüssigsysteme", Chemie Ingenieur Technik (72), S. 700-703
-// die max-Abfrage braucht man, für den Fall, daß man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall würde sonst ein Volumenstrom in die falsche Richtung entstehen
+//Gleichung aus Engel: Fluiddynamik in FÃ¼llkÃ¶rper- und Packungskolonnen ..., Gl. (10); in der Gleichung (3.13b) von Forner ist wohl ein Fehler (h_j)
+//Volker Engel: "Fluiddynamik in FÃ¼llkÃ¶rper- und Packungskolonnen fÃ¼r
+//Gas/FlÃ¼ssigsysteme", Chemie Ingenieur Technik (72), S. 700-703
+// die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
 
 for j in 1:n-1 loop
   hu_dyn_av[j] = (hu_dyn[j]+hu_dyn[j+1])/2;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PackedColumn/Rocha.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PackedColumn/Rocha.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PackedColumn/Rocha.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PackedColumn/Rocha.mo"	2022-03-10 09:58:12.528148502 +0000
@@ -40,7 +40,7 @@
    Ft[j] = 29.12 * (We[j]*Fr[j])^0.15*geometry.S^0.359/(Re[j]^0.2*geometry.eps^0.6*(1-0.93*0.62)*sin_theta^0.3);
  end for;
 
-  // die max-Abfrage braucht man, für den Fall, daß man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall würde sonst ein Volumenstrom in die falsche Richtung entstehen
+  // die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
 
   for j in 1:n - 1 loop
   //  A[j]*w_sup_v[j]^2 + B[j]*w_sup_v[j] - (p[j] - p[j + 1])/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l[j]*sin_theta*geometry.eps*9.81*((rho_l[j]-rho_v[j])/rho_l[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5=0;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PlateColumn/Vdot_DryHydro.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PlateColumn/Vdot_DryHydro.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PlateColumn/Vdot_DryHydro.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PlateColumn/Vdot_DryHydro.mo"	2022-03-10 09:58:12.528148502 +0000
@@ -1,7 +1,7 @@
 within ThermalSeparation.PressureLoss.PlateColumn;
 model Vdot_DryHydro
   "calculation of the volume flow rate using the dry pressure loss and the hydrostatic pressure loss"
- //"extends ..." wurde auskommentiert, damit man das Modell nicht auswählen kann, weil das nicht so dolle ist
+ //"extends ..." wurde auskommentiert, damit man das Modell nicht auswÃ¤hlen kann, weil das nicht so dolle ist
 
  // extends BasicPressureLossPlate;
 SI.Pressure deltaP_liq[n] "pressure loss due to the liquid on the tray";
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PlateColumn/Vdot_DryHydro_p.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PlateColumn/Vdot_DryHydro_p.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PlateColumn/Vdot_DryHydro_p.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/PlateColumn/Vdot_DryHydro_p.mo"	2022-03-10 09:58:12.528148502 +0000
@@ -7,7 +7,7 @@
   SI.Density rho_v_av[n-1];
 
 equation
-// die max-Abfrage braucht man, für den Fall, daß man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall würde sonst ein Volumenstrom in die falsche Richtung entstehen
+// die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
 
 for j in 1:n loop
   deltaP_liq[j] = h[j] * eps_liq_2ph[j] * rho_l_calc[j]* Modelica.Constants.g_n;
@@ -31,7 +31,7 @@
 //   SI.Density rho_v_av[n-1];
 //
 // equation
-// // die max-Abfrage braucht man, für den Fall, daß man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall würde sonst ein Volumenstrom in die falsche Richtung entstehen
+// // die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
 //
 // for j in 1:n loop
 //   deltaP_liq[j] = h[j] * eps_liq_2ph[j] * rho_l_calc[j]* Modelica.Constants.g_n;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/RandomPackedColumn/Rocha.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/RandomPackedColumn/Rocha.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/RandomPackedColumn/Rocha.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/RandomPackedColumn/Rocha.mo"	2022-03-10 09:58:18.640149275 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.PressureLoss.RandomPackedColumn;
+within ThermalSeparation.PressureLoss.RandomPackedColumn;
 model Rocha "correlation from Rocha et al."
 
   extends
@@ -41,50 +41,38 @@
    Ft[j]*(Re[j]^0.2*geometry.eps^0.6*(1-0.93*0.62)*sin_theta^0.3) = 29.12 * (We[j]*Fr[j])^0.15*geometry.S^0.359;
  end for;
 
-if homotopyMethod.bool_dp and homotopyMethod.useHomotopy then
-  // die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
+if homotopyMethod.bool_dp and homotopyMethod.useHomotopy then
+// die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
+    for j in 1:n - 1 loop
+// C[j]=- (p[j] - p[j + 1])/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
+      p[j] - p[j + 1] = homotopy(actual = -C[j] * (geometry.H / n) / (1 - (0.164 + 71.35 * geometry.S) * (4 * Ft[j] / geometry.S) ^ (2 / 3) * (3 * eta_l_calc[j] * w_sup_l[j] / (rho_l_calc[j] * sin_theta * geometry.eps * 9.81 * ((rho_l_calc[j] - rho_v_calc[j]) / rho_l_calc[j] * max(0.1, 1 - (p[j] - p[j + 1]) / (geometry.H / n) / deltaP_flood)))) ^ (1 / 3)) ^ 5, simplified = homotopyMethod.dp);
+      w_sup_v[j] = ((-B[j]) + sqrt(max(0, B[j] ^ 2 - 4 * A[j] * C[j]))) / (2 * A[j]);
+    end for;
+//   /*** outlet: half of the n-th discreet element ***/
+    for j in n:n loop
+// C[j]=- (p[j] - p[j + 1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
+      p[j] - p[j + 1] = homotopy(actual = -C[j] / 2 * (geometry.H / n) / (1 - (0.164 + 71.35 * geometry.S) * (4 * Ft[j] / geometry.S) ^ (2 / 3) * (3 * eta_l_calc[j] * w_sup_l[j] / (rho_l_calc[j] * sin_theta * geometry.eps * 9.81 * ((rho_l_calc[j] - rho_v_calc[j]) / rho_l_calc[j] * max(0.1, 1 - (p[j] - p[j + 1]) / (geometry.H / n) / deltaP_flood)))) ^ (1 / 3)) ^ 5, simplified = homotopyMethod.dp / 2);
+      w_sup_v[j] = ((-B[j]) + sqrt(max(0, B[j] ^ 2 - 4 * A[j] * C[j]))) / (2 * A[j]);
+    end for;
+// A[1]*w_sup_v_in^2 + B[1]*w_sup_v_in - (p_v_in - p[1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[1]/geometry.S)^(2/3)  *(3*eta_l_calc[1] * w_sup_l[1]/(rho_l_calc[1]*sin_theta*geometry.eps*9.81*((rho_l_calc[1]-rho_v_calc[1])/rho_l_calc[1]*max(0.1,(1-(p_v_in - p[1])*2/(geometry.H/n)/deltaP_flood/2)))))^(1/3))^5=0;
+    p_v_in - p[1] = homotopy(actual = (A[1] * w_sup_v_in ^ 2 + B[1] * w_sup_v_in) / 2 * (geometry.H / n) / (1 - (0.164 + 71.35 * geometry.S) * (4 * Ft[1] / geometry.S) ^ (2 / 3) * (3 * eta_l_calc[1] * w_sup_l[1] / (rho_l_calc[1] * sin_theta * geometry.eps * 9.81 * ((rho_l_calc[1] - rho_v_calc[1]) / rho_l_calc[1] * max(0.1, 1 - (p_v_in - p[1]) * 2 / (geometry.H / n) / deltaP_flood / 2)))) ^ (1 / 3)) ^ 5, simplified = homotopyMethod.dp / 2);
+
+else
+// die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
+    for j in 1:n - 1 loop
+// C[j]=- (p[j] - p[j + 1])/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
+      p[j] - p[j + 1] = -C[j] * (geometry.H / n) / (1 - (0.164 + 71.35 * geometry.S) * (4 * Ft[j] / geometry.S) ^ (2 / 3) * (3 * eta_l_calc[j] * w_sup_l[j] / (rho_l_calc[j] * sin_theta * geometry.eps * 9.81 * ((rho_l_calc[j] - rho_v_calc[j]) / rho_l_calc[j] * max(0.1, 1 - (p[j] - p[j + 1]) / (geometry.H / n) / deltaP_flood)))) ^ (1 / 3)) ^ 5;
+      w_sup_v[j] = ((-B[j]) + sqrt(max(0, B[j] ^ 2 - 4 * A[j] * C[j]))) / (2 * A[j]);
+    end for;
+//   /*** outlet: half of the n-th discreet element ***/
+    for j in n:n loop
+// C[j]=- (p[j] - p[j + 1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
+      p[j] - p[j + 1] = -C[j] / 2 * (geometry.H / n) / (1 - (0.164 + 71.35 * geometry.S) * (4 * Ft[j] / geometry.S) ^ (2 / 3) * (3 * eta_l_calc[j] * w_sup_l[j] / (rho_l_calc[j] * sin_theta * geometry.eps * 9.81 * ((rho_l_calc[j] - rho_v_calc[j]) / rho_l_calc[j] * max(0.1, 1 - (p[j] - p[j + 1]) / (geometry.H / n) / deltaP_flood)))) ^ (1 / 3)) ^ 5;
+      w_sup_v[j] = ((-B[j]) + sqrt(max(0, B[j] ^ 2 - 4 * A[j] * C[j]))) / (2 * A[j]);
+    end for;
+// A[1]*w_sup_v_in^2 + B[1]*w_sup_v_in - (p_v_in - p[1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[1]/geometry.S)^(2/3)  *(3*eta_l_calc[1] * w_sup_l[1]/(rho_l_calc[1]*sin_theta*geometry.eps*9.81*((rho_l_calc[1]-rho_v_calc[1])/rho_l_calc[1]*max(0.1,(1-(p_v_in - p[1])*2/(geometry.H/n)/deltaP_flood/2)))))^(1/3))^5=0;
+    p_v_in - p[1] = (A[1] * w_sup_v_in ^ 2 + B[1] * w_sup_v_in) / 2 * (geometry.H / n) / (1 - (0.164 + 71.35 * geometry.S) * (4 * Ft[1] / geometry.S) ^ (2 / 3) * (3 * eta_l_calc[1] * w_sup_l[1] / (rho_l_calc[1] * sin_theta * geometry.eps * 9.81 * ((rho_l_calc[1] - rho_v_calc[1]) / rho_l_calc[1] * max(0.1, 1 - (p_v_in - p[1]) * 2 / (geometry.H / n) / deltaP_flood / 2)))) ^ (1 / 3)) ^ 5;
 
-  for j in 1:n - 1 loop
- // C[j]=- (p[j] - p[j + 1])/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
- (p[j] - p[j + 1])=homotopy(actual=- C[j]*(geometry.H/n)/(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5,simplified=homotopyMethod.dp);
-
- w_sup_v[j] = (-B[j] + sqrt(max(0,B[j]^2 - 4*A[j]*C[j])))/(2*A[j]);
-  end for;
-
-//   /*** outlet: half of the n-th discreet element ***/
-
-for j in n:n loop
- // C[j]=- (p[j] - p[j + 1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
- (p[j] - p[j + 1])=homotopy(actual=- C[j]/2*(geometry.H/n)/(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5,simplified=homotopyMethod.dp/2);
-
- w_sup_v[j] = (-B[j] + sqrt(max(0,B[j]^2 - 4*A[j]*C[j])))/(2*A[j]);
-end for;
-
-    // A[1]*w_sup_v_in^2 + B[1]*w_sup_v_in - (p_v_in - p[1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[1]/geometry.S)^(2/3)  *(3*eta_l_calc[1] * w_sup_l[1]/(rho_l_calc[1]*sin_theta*geometry.eps*9.81*((rho_l_calc[1]-rho_v_calc[1])/rho_l_calc[1]*max(0.1,(1-(p_v_in - p[1])*2/(geometry.H/n)/deltaP_flood/2)))))^(1/3))^5=0;
-     (p_v_in - p[1])=homotopy(actual=(A[1]*w_sup_v_in^2 + B[1]*w_sup_v_in)/2*(geometry.H/n)/(1-(0.164 + 71.35*geometry.S)*(4*Ft[1]/geometry.S)^(2/3)  *(3*eta_l_calc[1] * w_sup_l[1]/(rho_l_calc[1]*sin_theta*geometry.eps*9.81*((rho_l_calc[1]-rho_v_calc[1])/rho_l_calc[1]*max(0.1,(1-(p_v_in - p[1])*2/(geometry.H/n)/deltaP_flood/2)))))^(1/3))^5,simplified=homotopyMethod.dp/2);
-
-else
-
-  // die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
-
-  for j in 1:n - 1 loop
- // C[j]=- (p[j] - p[j + 1])/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
- (p[j] - p[j + 1])=- C[j]*(geometry.H/n)/(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
-
- w_sup_v[j] = (-B[j] + sqrt(max(0,B[j]^2 - 4*A[j]*C[j])))/(2*A[j]);
-  end for;
-
-//   /*** outlet: half of the n-th discreet element ***/
-
-for j in n:n loop
- // C[j]=- (p[j] - p[j + 1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
- (p[j] - p[j + 1])=- C[j]/2*(geometry.H/n)/(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
-
- w_sup_v[j] = (-B[j] + sqrt(max(0,B[j]^2 - 4*A[j]*C[j])))/(2*A[j]);
-end for;
-
-    // A[1]*w_sup_v_in^2 + B[1]*w_sup_v_in - (p_v_in - p[1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[1]/geometry.S)^(2/3)  *(3*eta_l_calc[1] * w_sup_l[1]/(rho_l_calc[1]*sin_theta*geometry.eps*9.81*((rho_l_calc[1]-rho_v_calc[1])/rho_l_calc[1]*max(0.1,(1-(p_v_in - p[1])*2/(geometry.H/n)/deltaP_flood/2)))))^(1/3))^5=0;
-     (p_v_in - p[1])=(A[1]*w_sup_v_in^2 + B[1]*w_sup_v_in)/2*(geometry.H/n)/(1-(0.164 + 71.35*geometry.S)*(4*Ft[1]/geometry.S)^(2/3)  *(3*eta_l_calc[1] * w_sup_l[1]/(rho_l_calc[1]*sin_theta*geometry.eps*9.81*((rho_l_calc[1]-rho_v_calc[1])/rho_l_calc[1]*max(0.1,(1-(p_v_in - p[1])*2/(geometry.H/n)/deltaP_flood/2)))))^(1/3))^5;
 end if;
 
   annotation (Documentation(info="<html>
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/SprayColumn/PipeFlow.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/SprayColumn/PipeFlow.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/SprayColumn/PipeFlow.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/SprayColumn/PipeFlow.mo"	2022-03-10 09:58:18.508149258 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.PressureLoss.SprayColumn;
+within ThermalSeparation.PressureLoss.SprayColumn;
 model PipeFlow "calculation of Vdot using the particle model and zeta values"
 
   extends BasicPressureLossSpray;
@@ -17,16 +17,14 @@
   // Real Re_in;
   // Real Re_out;
 
-equation
-//Gleichung aus Engel: Fluiddynamik in FÃ¼llkÃ¶rper- und Packungskolonnen ..., Gl. (10); in der Gleichung (3.13b) von Forner ist wohl ein Fehler (h_j)
-
-// die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
-
-for j in 1:n-1 loop
-  rho_v_av[j] = (rho_v_calc[j]+rho_v_calc[j+1])/2;
-
-lambda[j] =lambda_const;// 0.3164/Re[j];
-end for;
+equation
+//Gleichung aus Engel: Fluiddynamik in FÃ¼llkÃ¶rper- und Packungskolonnen ..., Gl. (10); in der Gleichung (3.13b) von Forner ist wohl ein Fehler (h_j)
+// die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
+  for j in 1:n - 1 loop
+    rho_v_av[j] = (rho_v_calc[j] + rho_v_calc[j + 1]) / 2;
+    lambda[j] = lambda_const;
+// 0.3164/Re[j];
+  end for;
 
 for j in 1:n-1 loop
 Vdot[j] = sign(p[j]-p[j+1])*sqrt(abs(p[j]-p[j+1]) *2 /rho_v_av[j] /h*geometry.r1*2/lambda[j]*geometry.A^2);
@@ -34,13 +32,14 @@
 
 /*** outlet: half of the n-th discreet element ***/
 
-lambda_out =lambda_const;//  0.3164/Re_out;
-Vdot[n] =  sign(p[n]-p[n+1])*sqrt(max(1e-5,abs(p[n]-p[n+1]))*2 /rho_v_calc[n] /(h/2)*geometry.r1*2/lambda_out*geometry.A^2);
+lambda_out =lambda_const;
+//  0.3164/Re_out;
+  Vdot[n] = sign(p[n] - p[n + 1]) * sqrt(max(1e-5, abs(p[n] - p[n + 1])) * 2 / rho_v_calc[n] / (h / 2) * geometry.r1 * 2 / lambda_out * geometry.A ^ 2);
 
 /*** entry: half of the first discreet element ***/
-lambda_in =lambda_const;//  0.3164/Re_in;
-p_v_in = p[1]+ sign(Vdot_in)*Vdot_in*Vdot_in/geometry.A^2 * rho_v_calc[1]/2 * lambda_in * (h/2)/geometry.r1/2;//max(1e-10,f_in/ (6*hu_dyn[1] / d_L_in + geometry.a)/ rho_v_calc[1] * (geometry.A_free)^2))*(h/2);
-
-assert(not homotopyMethod.bool_dp,"this pressure loss model does not support homotopy - please deactivate");
-
+lambda_in =lambda_const;
+//  0.3164/Re_in;
+  p_v_in = p[1] + sign(Vdot_in) * Vdot_in * Vdot_in / geometry.A ^ 2 * rho_v_calc[1] / 2 * lambda_in * (h / 2) / geometry.r1 / 2;
+//max(1e-10,f_in/ (6*hu_dyn[1] / d_L_in + geometry.a)/ rho_v_calc[1] * (geometry.A_free)^2))*(h/2);
+  assert(not homotopyMethod.bool_dp, "this pressure loss model does not support homotopy - please deactivate");
 end PipeFlow;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/StructuredPackedColumn/NominalLinear.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/StructuredPackedColumn/NominalLinear.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/StructuredPackedColumn/NominalLinear.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/StructuredPackedColumn/NominalLinear.mo"	2022-03-10 09:58:18.480149256 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.PressureLoss.StructuredPackedColumn;
+within ThermalSeparation.PressureLoss.StructuredPackedColumn;
 model NominalLinear "linear pressure drop with nominal values"
 
   extends
@@ -6,26 +6,26 @@
   parameter SI.Pressure deltaP_nom=0.05e5 "nominal pressure drop";
   parameter SI.VolumeFlowRate Vdot_nom=0.4 "nominal volume flow rate";
   final parameter Real K=(deltaP_nom/Vdot_nom)/n;
-// SI.ReynoldsNumber Re[n];
-//   SI.WeberNumber We[n];
-//   SI.FroudeNumber Fr[n];
-//     SI.Velocity w_eff_l[n] "effective liquid velocity";
+  // SI.ReynoldsNumber Re[n];
+  //   SI.WeberNumber We[n];
+  //   SI.FroudeNumber Fr[n];
+  //     SI.Velocity w_eff_l[n] "effective liquid velocity";
 protected
       SI.Velocity w_sup_l[n] = Vdot_l/geometry.A "superficial liquid velocity";
       SI.Velocity w_sup_v[n] = Vdot/geometry.A;
-     // Real Ft[n];
+     // Real Ft[n];
        SI.DynamicViscosity eta_v[n] = propsVap.eta;
       SI.DynamicViscosity eta_l[n] = propsLiq.eta;
       Real sin_theta = Modelica.Math.sin(geometry.theta*2*Modelica.Constants.pi/360);
 equation
-//    for j in 1:n loop
-//       w_eff_l[j]=max(1e-9,w_sup_l[j]/(geometry.eps*eps_liq[j]*Modelica.Math.sin(geometry.theta/180*Modelica.Constants.pi)));
-//    Re[j] = w_eff_l[j]*geometry.S*rho_l[j]/eta_l[j];
-//      We[j] = max(0,w_eff_l[j]*w_eff_l[j]*rho_l[j]*geometry.S/sigma_l[j]);
-//    Fr[j] =max(0, w_eff_l[j]*w_eff_l[j]/(geometry.S*Modelica.Constants.g_n));
-//    Ft[j] = 29.12 * (We[j]*Fr[j])^0.15*geometry.S^0.359/(Re[j]^0.2*geometry.eps^0.6*(1-0.93*0.62)*sin_theta^0.3);
-//  end for;
-  // die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
+//    for j in 1:n loop
+//       w_eff_l[j]=max(1e-9,w_sup_l[j]/(geometry.eps*eps_liq[j]*Modelica.Math.sin(geometry.theta/180*Modelica.Constants.pi)));
+//    Re[j] = w_eff_l[j]*geometry.S*rho_l[j]/eta_l[j];
+//      We[j] = max(0,w_eff_l[j]*w_eff_l[j]*rho_l[j]*geometry.S/sigma_l[j]);
+//    Fr[j] =max(0, w_eff_l[j]*w_eff_l[j]/(geometry.S*Modelica.Constants.g_n));
+//    Ft[j] = 29.12 * (We[j]*Fr[j])^0.15*geometry.S^0.359/(Re[j]^0.2*geometry.eps^0.6*(1-0.93*0.62)*sin_theta^0.3);
+//  end for;
+// die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
 
 if homotopyMethod.bool_dp and homotopyMethod.useHomotopy then
   for j in 1:n - 1 loop
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/StructuredPackedColumn/Rocha.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/StructuredPackedColumn/Rocha.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/StructuredPackedColumn/Rocha.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/StructuredPackedColumn/Rocha.mo"	2022-03-10 09:58:18.444149250 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.PressureLoss.StructuredPackedColumn;
+within ThermalSeparation.PressureLoss.StructuredPackedColumn;
 model Rocha "correlation from Rocha et al."
 
   extends
@@ -41,50 +41,38 @@
    Ft[j]*(Re[j]^0.2*geometry.eps^0.6*(1-0.93*0.62)*sin_theta^0.3) = 29.12 * (We[j]*Fr[j])^0.15*geometry.S^0.359;
  end for;
 
-if homotopyMethod.bool_dp and homotopyMethod.useHomotopy then
-  // die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
+if homotopyMethod.bool_dp and homotopyMethod.useHomotopy then
+// die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
+    for j in 1:n - 1 loop
+// C[j]=- (p[j] - p[j + 1])/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
+      p[j] - p[j + 1] = homotopy(actual = -C[j] * (geometry.H / n) / (1 - (0.164 + 71.35 * geometry.S) * (4 * Ft[j] / geometry.S) ^ (2 / 3) * (3 * eta_l_calc[j] * w_sup_l[j] / (rho_l_calc[j] * sin_theta * geometry.eps * 9.81 * ((rho_l_calc[j] - rho_v_calc[j]) / rho_l_calc[j] * max(0.1, 1 - (p[j] - p[j + 1]) / (geometry.H / n) / deltaP_flood)))) ^ (1 / 3)) ^ 5, simplified = homotopyMethod.dp);
+      w_sup_v[j] = ((-B[j]) + sqrt(max(0, B[j] ^ 2 - 4 * A[j] * C[j]))) / (2 * A[j]);
+    end for;
+//   /*** outlet: half of the n-th discreet element ***/
+    for j in n:n loop
+// C[j]=- (p[j] - p[j + 1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
+      p[j] - p[j + 1] = homotopy(actual = -C[j] / 2 * (geometry.H / n) / (1 - (0.164 + 71.35 * geometry.S) * (4 * Ft[j] / geometry.S) ^ (2 / 3) * (3 * eta_l_calc[j] * w_sup_l[j] / (rho_l_calc[j] * sin_theta * geometry.eps * 9.81 * ((rho_l_calc[j] - rho_v_calc[j]) / rho_l_calc[j] * max(0.1, 1 - (p[j] - p[j + 1]) / (geometry.H / n) / deltaP_flood)))) ^ (1 / 3)) ^ 5, simplified = homotopyMethod.dp / 2);
+      w_sup_v[j] = ((-B[j]) + sqrt(max(0, B[j] ^ 2 - 4 * A[j] * C[j]))) / (2 * A[j]);
+    end for;
+// A[1]*w_sup_v_in^2 + B[1]*w_sup_v_in - (p_v_in - p[1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[1]/geometry.S)^(2/3)  *(3*eta_l_calc[1] * w_sup_l[1]/(rho_l_calc[1]*sin_theta*geometry.eps*9.81*((rho_l_calc[1]-rho_v_calc[1])/rho_l_calc[1]*max(0.1,(1-(p_v_in - p[1])*2/(geometry.H/n)/deltaP_flood/2)))))^(1/3))^5=0;
+    p_v_in - p[1] = homotopy(actual = (A[1] * w_sup_v_in ^ 2 + B[1] * w_sup_v_in) / 2 * (geometry.H / n) / (1 - (0.164 + 71.35 * geometry.S) * (4 * Ft[1] / geometry.S) ^ (2 / 3) * (3 * eta_l_calc[1] * w_sup_l[1] / (rho_l_calc[1] * sin_theta * geometry.eps * 9.81 * ((rho_l_calc[1] - rho_v_calc[1]) / rho_l_calc[1] * max(0.1, 1 - (p_v_in - p[1]) * 2 / (geometry.H / n) / deltaP_flood / 2)))) ^ (1 / 3)) ^ 5, simplified = homotopyMethod.dp / 2);
+
+else
+// die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
+    for j in 1:n - 1 loop
+// C[j]=- (p[j] - p[j + 1])/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
+      p[j] - p[j + 1] = -C[j] * (geometry.H / n) / (1 - (0.164 + 71.35 * geometry.S) * (4 * Ft[j] / geometry.S) ^ (2 / 3) * (3 * eta_l_calc[j] * w_sup_l[j] / (rho_l_calc[j] * sin_theta * geometry.eps * 9.81 * ((rho_l_calc[j] - rho_v_calc[j]) / rho_l_calc[j] * max(0.1, 1 - (p[j] - p[j + 1]) / (geometry.H / n) / deltaP_flood)))) ^ (1 / 3)) ^ 5;
+      w_sup_v[j] = ((-B[j]) + sqrt(max(0, B[j] ^ 2 - 4 * A[j] * C[j]))) / (2 * A[j]);
+    end for;
+//   /*** outlet: half of the n-th discreet element ***/
+    for j in n:n loop
+// C[j]=- (p[j] - p[j + 1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
+      p[j] - p[j + 1] = -C[j] / 2 * (geometry.H / n) / (1 - (0.164 + 71.35 * geometry.S) * (4 * Ft[j] / geometry.S) ^ (2 / 3) * (3 * eta_l_calc[j] * w_sup_l[j] / (rho_l_calc[j] * sin_theta * geometry.eps * 9.81 * ((rho_l_calc[j] - rho_v_calc[j]) / rho_l_calc[j] * max(0.1, 1 - (p[j] - p[j + 1]) / (geometry.H / n) / deltaP_flood)))) ^ (1 / 3)) ^ 5;
+      w_sup_v[j] = ((-B[j]) + sqrt(max(0, B[j] ^ 2 - 4 * A[j] * C[j]))) / (2 * A[j]);
+    end for;
+// A[1]*w_sup_v_in^2 + B[1]*w_sup_v_in - (p_v_in - p[1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[1]/geometry.S)^(2/3)  *(3*eta_l_calc[1] * w_sup_l[1]/(rho_l_calc[1]*sin_theta*geometry.eps*9.81*((rho_l_calc[1]-rho_v_calc[1])/rho_l_calc[1]*max(0.1,(1-(p_v_in - p[1])*2/(geometry.H/n)/deltaP_flood/2)))))^(1/3))^5=0;
+    p_v_in - p[1] = (A[1] * w_sup_v_in ^ 2 + B[1] * w_sup_v_in) / 2 * (geometry.H / n) / (1 - (0.164 + 71.35 * geometry.S) * (4 * Ft[1] / geometry.S) ^ (2 / 3) * (3 * eta_l_calc[1] * w_sup_l[1] / (rho_l_calc[1] * sin_theta * geometry.eps * 9.81 * ((rho_l_calc[1] - rho_v_calc[1]) / rho_l_calc[1] * max(0.1, 1 - (p_v_in - p[1]) * 2 / (geometry.H / n) / deltaP_flood / 2)))) ^ (1 / 3)) ^ 5;
 
-  for j in 1:n - 1 loop
- // C[j]=- (p[j] - p[j + 1])/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
- (p[j] - p[j + 1])=homotopy(actual=- C[j]*(geometry.H/n)/(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5,simplified=homotopyMethod.dp);
-
- w_sup_v[j] = (-B[j] + sqrt(max(0,B[j]^2 - 4*A[j]*C[j])))/(2*A[j]);
-  end for;
-
-//   /*** outlet: half of the n-th discreet element ***/
-
-for j in n:n loop
- // C[j]=- (p[j] - p[j + 1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
- (p[j] - p[j + 1])=homotopy(actual=- C[j]/2*(geometry.H/n)/(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5,simplified=homotopyMethod.dp/2);
-
- w_sup_v[j] = (-B[j] + sqrt(max(0,B[j]^2 - 4*A[j]*C[j])))/(2*A[j]);
-end for;
-
-    // A[1]*w_sup_v_in^2 + B[1]*w_sup_v_in - (p_v_in - p[1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[1]/geometry.S)^(2/3)  *(3*eta_l_calc[1] * w_sup_l[1]/(rho_l_calc[1]*sin_theta*geometry.eps*9.81*((rho_l_calc[1]-rho_v_calc[1])/rho_l_calc[1]*max(0.1,(1-(p_v_in - p[1])*2/(geometry.H/n)/deltaP_flood/2)))))^(1/3))^5=0;
-     (p_v_in - p[1])=homotopy(actual=(A[1]*w_sup_v_in^2 + B[1]*w_sup_v_in)/2*(geometry.H/n)/(1-(0.164 + 71.35*geometry.S)*(4*Ft[1]/geometry.S)^(2/3)  *(3*eta_l_calc[1] * w_sup_l[1]/(rho_l_calc[1]*sin_theta*geometry.eps*9.81*((rho_l_calc[1]-rho_v_calc[1])/rho_l_calc[1]*max(0.1,(1-(p_v_in - p[1])*2/(geometry.H/n)/deltaP_flood/2)))))^(1/3))^5,simplified=homotopyMethod.dp/2);
-
-else
-
-  // die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
-
-  for j in 1:n - 1 loop
- // C[j]=- (p[j] - p[j + 1])/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
- (p[j] - p[j + 1])=- C[j]*(geometry.H/n)/(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
-
- w_sup_v[j] = (-B[j] + sqrt(max(0,B[j]^2 - 4*A[j]*C[j])))/(2*A[j]);
-  end for;
-
-//   /*** outlet: half of the n-th discreet element ***/
-
-for j in n:n loop
- // C[j]=- (p[j] - p[j + 1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
- (p[j] - p[j + 1])=- C[j]/2*(geometry.H/n)/(1-(0.164 + 71.35*geometry.S)*(4*Ft[j]/geometry.S)^(2/3)  *(3*eta_l_calc[j] * w_sup_l[j]/(rho_l_calc[j]*sin_theta*geometry.eps*9.81*((rho_l_calc[j]-rho_v_calc[j])/rho_l_calc[j]*max(0.1,(1-(p[j] - p[j + 1])/(geometry.H/n)/deltaP_flood)))))^(1/3))^5;
-
- w_sup_v[j] = (-B[j] + sqrt(max(0,B[j]^2 - 4*A[j]*C[j])))/(2*A[j]);
-end for;
-
-    // A[1]*w_sup_v_in^2 + B[1]*w_sup_v_in - (p_v_in - p[1])*2/(geometry.H/n)*(1-(0.164 + 71.35*geometry.S)*(4*Ft[1]/geometry.S)^(2/3)  *(3*eta_l_calc[1] * w_sup_l[1]/(rho_l_calc[1]*sin_theta*geometry.eps*9.81*((rho_l_calc[1]-rho_v_calc[1])/rho_l_calc[1]*max(0.1,(1-(p_v_in - p[1])*2/(geometry.H/n)/deltaP_flood/2)))))^(1/3))^5=0;
-     (p_v_in - p[1])=(A[1]*w_sup_v_in^2 + B[1]*w_sup_v_in)/2*(geometry.H/n)/(1-(0.164 + 71.35*geometry.S)*(4*Ft[1]/geometry.S)^(2/3)  *(3*eta_l_calc[1] * w_sup_l[1]/(rho_l_calc[1]*sin_theta*geometry.eps*9.81*((rho_l_calc[1]-rho_v_calc[1])/rho_l_calc[1]*max(0.1,(1-(p_v_in - p[1])*2/(geometry.H/n)/deltaP_flood/2)))))^(1/3))^5;
 end if;
 
   annotation (Documentation(info="<html>
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/TrayColumn.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/TrayColumn.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/TrayColumn.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/TrayColumn.mo"	2022-03-10 09:58:18.388149243 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.PressureLoss;
+within ThermalSeparation.PressureLoss;
 package TrayColumn
   partial model BasicPressureLossPlate
     "basic pressure loss model for a plate column"
@@ -73,9 +73,8 @@
     final parameter Real K=(deltaP_nom/Vdot_nom)/n;
 
   equation
-    // die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
-
-  if homotopyMethod.bool_dp and homotopyMethod.useHomotopy then
+// die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
+    if homotopyMethod.bool_dp and homotopyMethod.useHomotopy then
     for j in 1:n - 1 loop
        max(0,sign(p[j] - p[j + 1])*max(0, (abs(p[j] - p[j + 1]))))=homotopy(actual=K*Vdot[j],simplified=homotopyMethod.dp);
     end for;
@@ -111,8 +110,7 @@
     final parameter Real K=(deltaP_nom/Vdot_nom)/n;
 
   equation
-    // die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
-
+// die max-Abfrage braucht man, fÃ¼r den Fall, daÃŸ man die Kolonne leer initialisiert und das Inertgas nicht mit abbildet: in dem Fall wÃ¼rde sonst ein Volumenstrom in die falsche Richtung entstehen
     for j in 1:n - 1 loop
         Vdot[j] = if startUp[j] then 0 else  max(0,sign(p[j] - p[j + 1])*max(0, (abs(p[j] - p[j + 1])/K)));
     end for;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/package.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/PressureLoss/package.mo"	2022-03-10 09:58:18.712149284 +0000
@@ -1,7 +1,8 @@
 within ThermalSeparation;
 package PressureLoss "Pressure Loss Models for the Vapor Flow"
       extends Icons.Library.Orange;
-  import SI = Modelica.SIunits;
+  import Modelica.Units.SI;
+
 
 
 annotation(preferedView="info");
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Reaction/Homogeneous/ReactionBulk.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Reaction/Homogeneous/ReactionBulk.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Reaction/Homogeneous/ReactionBulk.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Reaction/Homogeneous/ReactionBulk.mo"	2022-03-10 09:58:12.516148500 +0000
@@ -25,8 +25,8 @@
   parameter Real a_R[nR] = {38.814} "h_R [J/mol] = a_R * T [K] + b_R";
   parameter Real b_R[nR] = {-89155} "h_R [J/mol] = a_R * T [K] + b_R";
 
-//vielleicht kann man hier was mit conditional model machen (so dass man für jede Reaktion ein anderes ReactionRateCoeff-Model verwenden kann
-//und überhaupt sollte man sich nochmal angucken, ob man die Temperatur so übergeben kann, oder ob man eine for-Schleife braucht
+//vielleicht kann man hier was mit conditional model machen (so dass man fÃ¼r jede Reaktion ein anderes ReactionRateCoeff-Model verwenden kann
+//und Ã¼berhaupt sollte man sich nochmal angucken, ob man die Temperatur so Ã¼bergeben kann, oder ob man eine for-Schleife braucht
   replaceable model RRC = 
       ThermalSeparation.Reaction.ReactionRateCoeff.Arrhenius;
   RRC rrc( nR=nR, T = T);
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Reaction/Homogeneous/ReactionBulkActivity.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Reaction/Homogeneous/ReactionBulkActivity.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Reaction/Homogeneous/ReactionBulkActivity.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Reaction/Homogeneous/ReactionBulkActivity.mo"	2022-03-10 09:58:12.516148500 +0000
@@ -25,8 +25,8 @@
   parameter Real a_R[nR] = {38.814} "h_R [J/mol] = a_R * T [K] + b_R";
   parameter Real b_R[nR] = {-89155} "h_R [J/mol] = a_R * T [K] + b_R";
 
-//vielleicht kann man hier was mit conditional model machen (so dass man für jede Reaktion ein anderes ReactionRateCoeff-Model verwenden kann
-//und überhaupt sollte man sich nochmal angucken, ob man die Temperatur so übergeben kann, oder ob man eine for-Schleife braucht
+//vielleicht kann man hier was mit conditional model machen (so dass man fÃ¼r jede Reaktion ein anderes ReactionRateCoeff-Model verwenden kann
+//und Ã¼berhaupt sollte man sich nochmal angucken, ob man die Temperatur so Ã¼bergeben kann, oder ob man eine for-Schleife braucht
   replaceable model RRC = 
       ThermalSeparation.Reaction.ReactionRateCoeff.Arrhenius;
   RRC rrc( nR=nR, T = T, k_0=8.497e6*ones(nR), E=60.47e3*ones(nR));
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Units.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Units.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Units.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Units.mo"	2022-03-10 09:58:18.104149207 +0000
@@ -1,6 +1,6 @@
 within ThermalSeparation;
 package Units "Type Definitions"
-  import SI = Modelica.SIunits;
+  import Modelica.Units.SI;
 
   type CoefficentOfMassTransfer = Real (quantity="CoefficentOfMassTransfer", final unit="m/s");
   type F_Factor =Real (quantity="F_Factor", final unit="1");
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Utilities/Adapt_k.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Utilities/Adapt_k.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Utilities/Adapt_k.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Utilities/Adapt_k.mo"	2022-03-10 09:58:18.080149204 +0000
@@ -7,7 +7,7 @@
 
   Modelica.Blocks.Math.Add add_vap
     annotation (Placement(transformation(extent={{6,-6},{26,14}})));
-  Modelica.Blocks.Tables.CombiTable1D table(       u={error}, table=[0,-1; 1e-7,
+  Modelica.Blocks.Tables.CombiTable1Dv table(       u={error}, table=[0,-1; 1e-7,
         -0.5; 1e-6,0; 1e-5,0.5; 1e-4,0.7; 1e-3,0.9; 1e-2,1; 1e-1,1.5])
     annotation (Placement(transformation(extent={{-72,40},{-52,60}})));
   Modelica.Blocks.Math.Product product_vap
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Utilities/LimPID_Input.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Utilities/LimPID_Input.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Utilities/LimPID_Input.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Utilities/LimPID_Input.mo"	2022-03-10 09:58:18.064149202 +0000
@@ -1,10 +1,9 @@
 within ThermalSeparation.Utilities;
 block LimPID_Input
   "P, PI, PD, and PID controller with limited output, anti-windup compensation and setpoint weighting using inputs instead of connectors for u_s and u_m"
-  import Modelica.Blocks.Types.InitPID;
-  import Modelica.Blocks.Types.SimpleController;
   import Modelica.Blocks.Types.Init;
-  extends Modelica.Blocks.Interfaces.BlockIcon;
+  import Modelica.Blocks.Types.SimpleController;
+  extends Modelica.Blocks.Icons.Block;
 
   Modelica.Blocks.Interfaces.RealOutput y "Connector of actuator output signal"
     annotation (Placement(transformation(extent={{100,-10},{120,10}},
@@ -17,11 +16,11 @@
   parameter Modelica.Blocks.Types.SimpleController controllerType=
          Modelica.Blocks.Types.SimpleController.PID "Type of controller";
   parameter Real k(min=0) = 1 "Gain of controller";
-  parameter Modelica.SIunits.Time Ti(min=Modelica.Constants.small, start=0.5)=0.5
+  parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small, start=0.5)=0.5
     "Time constant of Integrator block"
      annotation(Dialog(enable=controllerType==SimpleController.PI or
                               controllerType==SimpleController.PID));
-  parameter Modelica.SIunits.Time Td(min=0, start=0.1)=0.1
+  parameter Modelica.Units.SI.Time Td(min=0, start=0.1)=0.1
     "Time constant of Derivative block"
        annotation(Dialog(enable=controllerType==SimpleController.PD or
                                 controllerType==SimpleController.PID));
@@ -39,7 +38,7 @@
     "The higher Nd, the more ideal the derivative block"
        annotation(Dialog(enable=controllerType==SimpleController.PD or
                                 controllerType==SimpleController.PID));
-  parameter Modelica.Blocks.Types.InitPID initType= Modelica.Blocks.Types.InitPID.DoNotUse_InitialIntegratorState
+  parameter Modelica.Blocks.Types.Init initType= Modelica.Blocks.Types.Init.InitialState
     "Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)"
                                      annotation(Evaluate=true,
       Dialog(group="Initialization"));
@@ -73,19 +72,13 @@
             -20,60}}, rotation=0)));
   Modelica.Blocks.Continuous.Integrator I(
     k=unitTime/Ti, y_start=xi_start,
-    initType=if initType==InitPID.SteadyState then
-                Init.SteadyState else
-             if initType==InitPID.InitialState or
-                initType==InitPID.DoNotUse_InitialIntegratorState then
-                Init.InitialState else Init.NoInit) if with_I
+    initType=if initType == Init.SteadyState then
+                Init.SteadyState else if initType == Init.InitialState or initType == Init.InitialState then Init.InitialState else Init.NoInit) if with_I
     annotation (Placement(transformation(extent={{-40,-60},{-20,-40}},
           rotation=0)));
   Modelica.Blocks.Continuous.Derivative D(
     k=Td/unitTime, T=max([Td/Nd, 1.e-14]), x_start=xd_start,
-    initType=if initType==InitPID.SteadyState or
-                initType==InitPID.InitialOutput then Init.SteadyState else
-             if initType==InitPID.InitialState then Init.InitialState else
-                Init.NoInit) if with_D
+    initType=if initType == Init.SteadyState or initType == Init.InitialOutput then Init.SteadyState else if initType == Init.InitialState then Init.InitialState else Init.NoInit) if with_D
     annotation (Placement(transformation(extent={{-40,-10},{-20,10}},
           rotation=0)));
   Modelica.Blocks.Math.Gain gainPID(k=k)
@@ -107,8 +100,7 @@
            0)));
   Modelica.Blocks.Nonlinear.Limiter limiter(
     uMax=yMax,
-    uMin=yMin,
-    limitsAtInit=limitsAtInit)
+    uMin=yMin)
     annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=
             0)));
 protected
@@ -130,7 +122,7 @@
   Modelica.Blocks.Interfaces.RealInput input_u_m;
     Modelica.Blocks.Interfaces.RealInput input_u_s;
 initial equation
-  if initType==InitPID.InitialOutput then
+  if initType== Init.InitialOutput then
      gainPID.y = y_start;
   end if;
 equation
@@ -139,7 +131,7 @@
     output_u_m=u_m;
   assert(yMax >= yMin, "LimPID: Limits must be consistent. However, yMax (=" + String(yMax) +
                        ") < yMin (=" + String(yMin) + ")");
-  if initType == InitPID.InitialOutput and (y_start < yMin or y_start > yMax) then
+  if initType == Init.InitialOutput and (y_start < yMin or y_start > yMax) then
       Modelica.Utilities.Streams.error("LimPID: Start value y_start (=" + String(y_start) +
          ") is outside of the limits of yMin (=" + String(yMin) +") and yMax (=" + String(yMax) + ")");
   end if;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Utilities/PI_Input.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Utilities/PI_Input.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Utilities/PI_Input.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Utilities/PI_Input.mo"	2022-03-10 09:58:17.908149182 +0000
@@ -15,7 +15,7 @@
     annotation(Dialog(enable=initType == Init.SteadyState or initType == Init.InitialOutput, group=
           "Initialization"));
 
-  extends Modelica.Blocks.Interfaces.BlockIcon;
+  extends Modelica.Blocks.Icons.Block;
 
   input Real u "Connector of Real input signal";
   Modelica.Blocks.Interfaces.RealOutput y "Connector of Real output signal"
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Wall/NaturalConvection.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Wall/NaturalConvection.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Wall/NaturalConvection.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/Wall/NaturalConvection.mo"	2022-03-10 09:58:17.804149170 +0000
@@ -1,4 +1,4 @@
-ï»¿within ThermalSeparation.Wall;
+within ThermalSeparation.Wall;
 model NaturalConvection
   "Heat Transfer with natural convection of the outside air"
   extends ThermalSeparation.Wall.BaseWall;
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/openmodelica.metadata.json" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/openmodelica.metadata.json"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/openmodelica.metadata.json"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/openmodelica.metadata.json"	2022-03-10 09:58:39.572151927 +0000
@@ -1 +1 @@
-{"path":"ThermalSeparation", "provides":["0.1.0"], "sha":"d52b8306b9439885c36ab037c7a84a7042fb7fbb", "support":"noSupport", "uses":{"Modelica":"3.2.3"}, "version":"0.2.0-master", "zipfile":"https://github.com/modelica-3rdparty/ThermalSeparation/archive/d52b8306b9439885c36ab037c7a84a7042fb7fbb.zip"}
+{"path": "ThermalSeparation", "provides": ["0.1.0"], "sha": "d52b8306b9439885c36ab037c7a84a7042fb7fbb", "support": "noSupport", "uses": {"Modelica": "4.0.0"}, "version": "0.2.0-master", "zipfile": "https://github.com/modelica-3rdparty/ThermalSeparation/archive/d52b8306b9439885c36ab037c7a84a7042fb7fbb.zip", "extraInfo": "Conversion script /home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 4.0.0+maint.om//Resources/Scripts/Conversion/ConvertModelica_from_3.2.3_to_4.0.0.mos was applied"}
\ No newline at end of file
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/package.mo" "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/package.mo"	2022-03-10 09:57:37.936144118 +0000
+++ "converted-libraries/.openmodelica/libraries/ThermalSeparation 0.2.0-master/package.mo"	2022-03-10 09:58:39.568151925 +0000
@@ -2,13 +2,46 @@
 package ThermalSeparation "Thermal Separation Library"
 constant Integer inter[:] = {1,3,6,10,15, 21, 28, 36, 45}
   "number of binary interaction values depending on the number of substances";
-import SI = Modelica.SIunits;
+import Modelica.Units.SI;
 
 
 
-annotation (preferedView="info",
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  annotation (preferedView="info",
   version="0.2",
-uses(Modelica(version="3.2.3")),
+uses(Modelica(version= "4.0.0")),
      Icon(graphics={Ellipse(
         extent={{-70,70},{70,-70}},
         lineColor={0,0,0},
